mirror of
https://github.com/ComradCollective/Comrad
synced 2024-11-03 23:15:33 +00:00
updates
This commit is contained in:
parent
85cc5936c0
commit
33461367b0
@ -133,8 +133,8 @@ class Message(Logger):
|
||||
|
||||
# decrypt msg
|
||||
self.msg = self.msg_d['msg'] = decr_msg_b = SMessage(
|
||||
self.to_whom.privkey,
|
||||
self.from_whom.pubkey
|
||||
self.to_whom.privkey.data,
|
||||
self.from_whom.pubkey.data
|
||||
).unwrap(self.msg)
|
||||
# self.log('Am I decrypted?',self)
|
||||
|
||||
|
@ -67,6 +67,7 @@ class Persona(Caller):
|
||||
passphrase = self.cli.status_keymaker_part2(name,passphrase,pubkey,privkey,hasher,self)
|
||||
else:
|
||||
if not passphrase: passphrase=getpass('Enter a memorable password to encrypt your private key with: ')
|
||||
self.passphrase=passphrase
|
||||
|
||||
## 4) Get hashed password
|
||||
passhash = hasher(passphrase)
|
||||
@ -84,8 +85,9 @@ class Persona(Caller):
|
||||
|
||||
self._keychain['pubkey']=pubkey
|
||||
self._keychain['privkey_encr']=privkey_encr_obj
|
||||
self._keychain['privkey_decr']=privkey_decr
|
||||
# self._keychain['privkey_decr']=privkey_decr
|
||||
# we should be able to reassemble privkey now?
|
||||
# self.log('this is my keychain now:')
|
||||
assert 'privkey' in self.keychain()
|
||||
|
||||
# self.log('My keychain now looks like:',dict_format(self.keychain()))
|
||||
@ -137,7 +139,7 @@ def test_register():
|
||||
botname=f'marx{str(num).zfill(3)}'
|
||||
marxbot = Persona(botname)
|
||||
# marxbot=Persona()
|
||||
marxbot.register(passphrase='acc')
|
||||
marxbot.register()
|
||||
|
||||
if __name__=='__main__':
|
||||
test_register()
|
||||
|
@ -120,13 +120,13 @@ def check_phonelines():
|
||||
builtin_keys = pickle.loads(b64decode(builtin_keys_b64))
|
||||
# print(builtin_keys)
|
||||
|
||||
for name in builtin_keys:
|
||||
pubkey=builtin_keys[name]['pubkey']
|
||||
uri_id=b64encode(pubkey)
|
||||
for keyname,keyval in builtin_keys[name].items():
|
||||
uri=name if keyname=='pubkey' else uri_id
|
||||
if not keycrypt.has(uri,f'/{keyname}/'):
|
||||
keycrypt.set(uri,keyval,f'/{keyname}/')
|
||||
# for name in builtin_keys:
|
||||
# pubkey=builtin_keys[name]['pubkey']
|
||||
# uri_id=b64encode(pubkey)
|
||||
# for keyname,keyval in builtin_keys[name].items():
|
||||
# uri=name if keyname=='pubkey' else uri_id
|
||||
# if not keycrypt.has(uri,f'/{keyname}/'):
|
||||
# keycrypt.set(uri,keyval,f'/{keyname}/')
|
||||
|
||||
# make sure world's qr is there too
|
||||
ofnfn = os.path.join(PATH_QRCODES,WORLD_NAME+'.png')
|
||||
|
@ -38,7 +38,7 @@ class TheOperator(Operator):
|
||||
keychain = check_phonelines()[OPERATOR_NAME]
|
||||
self._keychain = self.load_keychain_from_bytes(keychain)
|
||||
self._keychain = self.keychain()
|
||||
self.log('@Operator booted with keychain:',dict_format(self._keychain))
|
||||
# self.log('@Operator booted with keychain:',dict_format(self._keychain))
|
||||
|
||||
def ring(self,
|
||||
from_caller=None,
|
||||
|
Loading…
Reference in New Issue
Block a user