From 9952dbb8bcf1dfa6207485489650189739f5e0b4 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 26 Mar 2022 16:03:04 +0100 Subject: [PATCH] define type bytes using the 4:4 split 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, ... --- src/borg/constants.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/borg/constants.py b/src/borg/constants.py index 9b8af740546..5fb6b9a65ab 100644 --- a/src/borg/constants.py +++ b/src/borg/constants.py @@ -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. @@ -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.