Use the correct amount of random bytes in DH request

The official documentation says a 2048 *bit* number.
`os.urandom` takes an argument that represents the number of *bytes*.
2048 bits is 256 bytes
This commit is contained in:
Hasan 2017-06-18 17:38:14 -04:00 committed by Lonami
parent 8afb0a3f6b
commit c13164f5cf

View File

@ -148,7 +148,7 @@ def do_authentication(transport):
server_time = dh_inner_data_reader.read_int() server_time = dh_inner_data_reader.read_int()
time_offset = server_time - int(time.time()) time_offset = server_time - int(time.time())
b = get_int(os.urandom(2048), signed=False) b = get_int(os.urandom(256), signed=False)
gb = pow(g, b, dh_prime) gb = pow(g, b, dh_prime)
gab = pow(ga, b, dh_prime) gab = pow(ga, b, dh_prime)