Skip to content

Commit

Permalink
crypto: works better WITH id_hash
Browse files Browse the repository at this point in the history
only hmac-sha-256 for now, blake2b can be added later.
  • Loading branch information
ThomasWaldmann committed Mar 18, 2022
1 parent 264ca1d commit 0518dce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/borg/crypto/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def init_ciphers(self, manifest_data=None, iv=0):
self.cipher = self._get_cipher(self.sessionid, iv=0)


class AESOCBKeyfileKey(AEADKeyBase, FlexiKey):
class AESOCBKeyfileKey(ID_HMAC_SHA_256, AEADKeyBase, FlexiKey):
TYPES_ACCEPTABLE = {KeyType.AESOCBKEYFILE, KeyType.AESOCBREPO}
TYPE = KeyType.AESOCBKEYFILE
NAME = 'key file AES-OCB'
Expand All @@ -800,7 +800,7 @@ class AESOCBKeyfileKey(AEADKeyBase, FlexiKey):
CIPHERSUITE = AES256_OCB


class AESOCBRepoKey(AEADKeyBase, FlexiKey):
class AESOCBRepoKey(ID_HMAC_SHA_256, AEADKeyBase, FlexiKey):
TYPES_ACCEPTABLE = {KeyType.AESOCBKEYFILE, KeyType.AESOCBREPO}
TYPE = KeyType.AESOCBREPO
NAME = 'repokey AES-OCB'
Expand All @@ -809,7 +809,7 @@ class AESOCBRepoKey(AEADKeyBase, FlexiKey):
CIPHERSUITE = AES256_OCB


class CHPOKeyfileKey(AEADKeyBase, FlexiKey):
class CHPOKeyfileKey(ID_HMAC_SHA_256, AEADKeyBase, FlexiKey):
TYPES_ACCEPTABLE = {KeyType.CHPOKEYFILE, KeyType.CHPOREPO}
TYPE = KeyType.CHPOKEYFILE
NAME = 'key file ChaCha20-Poly1305'
Expand All @@ -818,7 +818,7 @@ class CHPOKeyfileKey(AEADKeyBase, FlexiKey):
CIPHERSUITE = CHACHA20_POLY1305


class CHPORepoKey(AEADKeyBase, FlexiKey):
class CHPORepoKey(ID_HMAC_SHA_256, AEADKeyBase, FlexiKey):
TYPES_ACCEPTABLE = {KeyType.CHPOKEYFILE, KeyType.CHPOREPO}
TYPE = KeyType.CHPOREPO
NAME = 'repokey ChaCha20-Poly1305'
Expand Down

0 comments on commit 0518dce

Please sign in to comment.