fix public key shittery
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-26 22:02:06 +02:00
parent 90969aeadb
commit d40b20e753
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -26,7 +26,7 @@ class NetWrapper:
self.authenticationInstance = authenticationInstance self.authenticationInstance = authenticationInstance
def ecryptRSAMessage(self, message: str) -> bytes: def ecryptRSAMessage(self, message: str) -> bytes:
cipher_rsa = PKCS1_OAEP.new(self.clientPublicKey) cipher_rsa = PKCS1_OAEP.new(self.currentClientPublicKey)
encrypted_msg = cipher_rsa.encrypt(message.encode('UTF-8')) encrypted_msg = cipher_rsa.encrypt(message.encode('UTF-8'))
return encrypted_msg return encrypted_msg
@ -40,7 +40,7 @@ class NetWrapper:
def verifyRSAHeaderSignature(self, header: bytes, headersignature: bytes) -> bool: def verifyRSAHeaderSignature(self, header: bytes, headersignature: bytes) -> bool:
h = SHA512.new(header) h = SHA512.new(header)
try: try:
pkcs1_15.new(self.clientPublicKey).verify(h, headersignature) pkcs1_15.new(self.currentClientPublicKey).verify(h, headersignature)
return True return True
except Exception: except Exception:
return False return False