Skip to content

Commit

Permalink
define type bytes using the 4:4 split
Browse files Browse the repository at this point in the history
upper 4 bits are ciphersuite:
0 == legacy AES-CTR based stuff
1+ == new AEAD stuff

lower 4 bits are keytype:
legacy: a bit mixed up, as it was...
new stuff: 0=keyfile 1=repokey, ...
  • Loading branch information
ThomasWaldmann committed Mar 26, 2022
1 parent d47d0bb commit 9952dbb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/borg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ class KeyBlobStorage:


class KeyType:
# legacy crypto
# upper 4 bits are ciphersuite, 0 == legacy AES-CTR
KEYFILE = 0x00
# repos with PASSPHRASE mode could not be created any more since borg 1.0, see #97.
# in borg 1.3 all of its code and also the "borg key migrate-to-repokey" command was removed.
Expand All @@ -123,15 +125,16 @@ class KeyType:
BLAKE2REPO = 0x05
BLAKE2AUTHENTICATED = 0x06
AUTHENTICATED = 0x07
# new crypto starts at 0xa0
AESOCBKEYFILE = 0xa0
AESOCBREPO = 0xa1
CHPOKEYFILE = 0xa2
CHPOREPO = 0xa3
BLAKE2AESOCBKEYFILE = 0xa4
BLAKE2AESOCBREPO = 0xa5
BLAKE2CHPOKEYFILE = 0xa6
BLAKE2CHPOREPO = 0xa7
# new crypto
# upper 4 bits are ciphersuite, lower 4 bits are keytype
AESOCBKEYFILE = 0x10
AESOCBREPO = 0x11
CHPOKEYFILE = 0x20
CHPOREPO = 0x21
BLAKE2AESOCBKEYFILE = 0x30
BLAKE2AESOCBREPO = 0x31
BLAKE2CHPOKEYFILE = 0x40
BLAKE2CHPOREPO = 0x41


REPOSITORY_README = """This is a Borg Backup repository.
Expand Down

0 comments on commit 9952dbb

Please sign in to comment.