fixed broken deterministic addresses made it so we do not use forward secrecy when sending to self
parent
403150300e
commit
6b25a9301c
|
@ -718,7 +718,7 @@ class Core:
|
|||
|
||||
return True
|
||||
|
||||
def insertBlock(self, data, header='txt', sign=False, encryptType='', symKey='', asymPeer='', meta = {}, expire=None):
|
||||
def insertBlock(self, data, header='txt', sign=False, encryptType='', symKey='', asymPeer='', meta = {}, expire=None, disableForward=False):
|
||||
'''
|
||||
Inserts a block into the network
|
||||
encryptType must be specified to encrypt a block
|
||||
|
@ -765,6 +765,7 @@ class Core:
|
|||
pass
|
||||
|
||||
if encryptType == 'asym':
|
||||
if not disableForward and asymPeer != self._crypto.pubKey:
|
||||
try:
|
||||
forwardEncrypted = onionrusers.OnionrUser(self, asymPeer).forwardEncrypt(data)
|
||||
data = forwardEncrypted[0]
|
||||
|
|
|
@ -210,12 +210,9 @@ class OnionrCrypto:
|
|||
ops = nacl.pwhash.argon2id.OPSLIMIT_SENSITIVE
|
||||
mem = nacl.pwhash.argon2id.MEMLIMIT_SENSITIVE
|
||||
|
||||
key = kdf(nacl.secret.SecretBox.KEY_SIZE, passphrase, salt, opslimit=ops, memlimit=mem)
|
||||
key = nacl.public.PrivateKey(key, nacl.encoding.RawEncoder())
|
||||
publicKey = key.public_key
|
||||
|
||||
return (publicKey.encode(encoder=nacl.encoding.Base32Encoder()),
|
||||
key.encode(encoder=nacl.encoding.Base32Encoder()))
|
||||
key = kdf(32, passphrase, salt, opslimit=ops, memlimit=mem) # Generate seed for ed25519 key
|
||||
key = nacl.signing.SigningKey(key)
|
||||
return (key.verify_key.encode(nacl.encoding.Base32Encoder).decode(), key.encode(nacl.encoding.Base32Encoder).decode())
|
||||
|
||||
def pubKeyHashID(self, pubkey=''):
|
||||
'''Accept a ed25519 public key, return a truncated result of X many sha3_256 hash rounds'''
|
||||
|
|
Loading…
Reference in New Issue