2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-03 23:15:33 +00:00

komrade update!

This commit is contained in:
quadrismegistus 2020-09-17 09:34:27 +01:00
parent 2618bd4876
commit a712961ff1

View File

@ -265,18 +265,22 @@ class Keymaker(Logger):
def find_pubkey(self,name=None): def find_pubkey(self,name=None):
self.log('<-',name)
if not name: name=self.name if not name: name=self.name
if 'pubkey' in self._keychain and self._keychain['pubkey']: if 'pubkey' in self._keychain and self._keychain['pubkey']:
pk=self._keychain['pubkey'] pk=self._keychain['pubkey']
return KomradeAsymmetricPublicKey(b64dec(pk)) if type(pk)==bytes else pk return KomradeAsymmetricPublicKey(b64dec(pk)) if type(pk)==bytes else pk
res = self.load_qr(self.name) res = self.load_qr(self.name)
self.log(f'load_qr({name}) -->',res)
if not res: if not res:
res = self.crypt_keys.get(name, prefix='/pubkey/') res = self.crypt_keys.get(name, prefix='/pubkey/')
if not res: return if not res: return
return KomradeAsymmetricPublicKey(b64dec(res)) key = KomradeAsymmetricPublicKey(b64dec(res))
self.log('-->',key)
return key
# self.log('I don\'t know my public key! Do I need to register?') # self.log('I don\'t know my public key! Do I need to register?')
# raise KomradeException(f'I don\'t know my public key!\n{self}\n{self._keychain}') # raise KomradeException(f'I don\'t know my public key!\n{self}\n{self._keychain}')
# return res # return res