Remove logging of sensitive information

rsa-aes
Andri Yngvason 2023-09-10 17:47:18 +00:00
parent 89b759c838
commit c700a2c02c
2 changed files with 0 additions and 14 deletions

View File

@ -664,7 +664,6 @@ void crypto_rsa_pub_key_exponent(const struct crypto_rsa_pub_key* key,
uint8_t* dst, size_t dst_size)
{
char* str = mpz_get_str(NULL, 16, key->key.e);
nvnc_trace("e: %s", str);
free(str);
crypto_export(dst, dst_size, key->key.e);

View File

@ -537,8 +537,6 @@ static int rsa_aes_send_challenge(struct nvnc_client* client,
client->rsa.challenge, client->rsa.challenge_len);
msg->length = htons(len);
nvnc_trace("Challenge length is %zd", len);
stream_write(client->net_stream, buffer, sizeof(*msg) + len, NULL, NULL);
return 0;
}
@ -558,14 +556,9 @@ static int on_rsa_aes_public_key(struct nvnc_client* client)
sizeof(*msg) + byte_length * 2)
return 0;
nvnc_trace("Got public key with bit size %d", bit_length);
const uint8_t* modulus = msg->modulus_and_exponent;
const uint8_t* exponent = msg->modulus_and_exponent + byte_length;
crypto_dump_base16("Got public key modulus", modulus, byte_length);
crypto_dump_base16("Got public key exponent", exponent, byte_length);
client->rsa.pub =
crypto_rsa_pub_key_import(modulus, exponent, byte_length);
assert(client->rsa.pub);
@ -599,14 +592,8 @@ static int on_rsa_aes_challenge(struct nvnc_client* client)
if (client->buffer_len - client->buffer_index < sizeof(*msg) + length)
return 0;
crypto_dump_base16("client buffer", client->msg_buffer +
client->buffer_index, client->buffer_len -
client->buffer_index);
struct nvnc* server = client->server;
nvnc_trace("Encrypted challenge has length: %d", length);
uint8_t client_random[32] = {};
ssize_t len = crypto_rsa_decrypt(server->rsa_priv, client_random,
client->rsa.challenge_len, msg->challenge, length);