mirror of
https://github.com/ComradCollective/Comrad
synced 2024-11-03 23:15:33 +00:00
komrade update!
This commit is contained in:
parent
3207d5648c
commit
dde300c7ad
@ -227,12 +227,13 @@ KEYMAKER_DEFAULT_KEY_TYPES = {
|
|||||||
|
|
||||||
|
|
||||||
def get_key_obj(keyname,data,key_types=KEYMAKER_DEFAULT_KEY_TYPES):
|
def get_key_obj(keyname,data,key_types=KEYMAKER_DEFAULT_KEY_TYPES):
|
||||||
try:
|
if keyname.endswith('_decr'):
|
||||||
data_s = data.decode()
|
try:
|
||||||
if data_s == KomradeSymmetricKeyWithPassphrase.__name__:
|
data_s = data.decode()
|
||||||
return KomradeSymmetricKeyWithPassphrase()
|
if data_s == KEY_TYPE_SYMMETRIC_WITH_PASSPHRASE:
|
||||||
except UnicodeDecodeError:
|
return KomradeSymmetricKeyWithPassphrase()
|
||||||
pass
|
except UnicodeDecodeError:
|
||||||
|
return KomradeSymmetricKeyWithoutPassphrase(data)
|
||||||
|
|
||||||
return key_types[keyname](data)
|
return key_types[keyname](data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user