version 1.20, 2001/01/22 23:06:40 |
version 1.21, 2001/01/29 19:47:31 |
|
|
int i, len; |
int i, len; |
|
|
/* Decrypt the challenge using the private key. */ |
/* Decrypt the challenge using the private key. */ |
rsa_private_decrypt(challenge, challenge, prv); |
/* XXX think about Bleichenbacher, too */ |
|
if (rsa_private_decrypt(challenge, challenge, prv) <= 0) |
|
packet_disconnect( |
|
"respond_to_rsa_challenge: rsa_private_decrypt failed"); |
|
|
/* Compute the response. */ |
/* Compute the response. */ |
/* The response is MD5 of decrypted challenge plus session id. */ |
/* The response is MD5 of decrypted challenge plus session id. */ |
len = BN_num_bytes(challenge); |
len = BN_num_bytes(challenge); |
if (len <= 0 || len > sizeof(buf)) |
if (len <= 0 || len > sizeof(buf)) |
packet_disconnect("respond_to_rsa_challenge: bad challenge length %d", |
packet_disconnect( |
len); |
"respond_to_rsa_challenge: bad challenge length %d", len); |
|
|
memset(buf, 0, sizeof(buf)); |
memset(buf, 0, sizeof(buf)); |
BN_bn2bin(challenge, buf + sizeof(buf) - len); |
BN_bn2bin(challenge, buf + sizeof(buf) - len); |