Adress some crypto functions correctly.
This commit is contained in:
parent
bb7580e9fb
commit
f5971eaa30
|
@ -281,7 +281,7 @@ class EncryptedStanzaSession(StanzaSession):
|
||||||
if (not 1 < e < (p - 1)):
|
if (not 1 < e < (p - 1)):
|
||||||
raise exceptions.NegotiationError, "invalid DH value"
|
raise exceptions.NegotiationError, "invalid DH value"
|
||||||
|
|
||||||
return self.sha256(self.encode_mpi(self.powmod(e, y, p)))
|
return crypto.sha256(crypto.encode_mpi(crypto.powmod(e, y, p)))
|
||||||
|
|
||||||
def c7lize_mac_id(self, form):
|
def c7lize_mac_id(self, form):
|
||||||
kids = form.getChildren()
|
kids = form.getChildren()
|
||||||
|
@ -741,7 +741,7 @@ class EncryptedStanzaSession(StanzaSession):
|
||||||
|
|
||||||
# 4.5.5
|
# 4.5.5
|
||||||
if srs:
|
if srs:
|
||||||
srshash = crypto.hmac(srs, 'Shared Retained Secret')
|
srshash = self.hmac(srs, 'Shared Retained Secret')
|
||||||
else:
|
else:
|
||||||
srshash = crypto.random_bytes(32)
|
srshash = crypto.random_bytes(32)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue