Remove self. from self.rsa_private_key, not used elsewhere.

This variable is not used anywhere outside this function,
so it does not need to be an instance attribute.
This commit is contained in:
Ethan Dalool 2020-03-09 14:55:25 -07:00
parent ebca1d4826
commit 2ba447ebad

View file

@ -119,20 +119,20 @@ class Mega:
) )
private_key = a32_to_str(rsa_private_key) private_key = a32_to_str(rsa_private_key)
self.rsa_private_key = [0, 0, 0, 0] rsa_private_key = [0, 0, 0, 0]
for i in range(4): for i in range(4):
l = int( l = int(
((private_key[0]) * 256 + (private_key[1]) + 7) / 8 ((private_key[0]) * 256 + (private_key[1]) + 7) / 8
) + 2 ) + 2
self.rsa_private_key[i] = mpi_to_int(private_key[:l]) rsa_private_key[i] = mpi_to_int(private_key[:l])
private_key = private_key[l:] private_key = private_key[l:]
encrypted_sid = mpi_to_int(base64_url_decode(resp['csid'])) encrypted_sid = mpi_to_int(base64_url_decode(resp['csid']))
rsa_decrypter = RSA.construct( rsa_decrypter = RSA.construct(
( (
self.rsa_private_key[0] * self.rsa_private_key[1], 257, rsa_private_key[0] * rsa_private_key[1], 257,
self.rsa_private_key[2], self.rsa_private_key[0], rsa_private_key[2], rsa_private_key[0],
self.rsa_private_key[1] rsa_private_key[1]
) )
) )
sid = '%x' % rsa_decrypter._decrypt(encrypted_sid) sid = '%x' % rsa_decrypter._decrypt(encrypted_sid)