Remove logging of sensitive information
parent
89b759c838
commit
c700a2c02c
|
@ -664,7 +664,6 @@ void crypto_rsa_pub_key_exponent(const struct crypto_rsa_pub_key* key,
|
||||||
uint8_t* dst, size_t dst_size)
|
uint8_t* dst, size_t dst_size)
|
||||||
{
|
{
|
||||||
char* str = mpz_get_str(NULL, 16, key->key.e);
|
char* str = mpz_get_str(NULL, 16, key->key.e);
|
||||||
nvnc_trace("e: %s", str);
|
|
||||||
free(str);
|
free(str);
|
||||||
|
|
||||||
crypto_export(dst, dst_size, key->key.e);
|
crypto_export(dst, dst_size, key->key.e);
|
||||||
|
|
13
src/server.c
13
src/server.c
|
@ -537,8 +537,6 @@ static int rsa_aes_send_challenge(struct nvnc_client* client,
|
||||||
client->rsa.challenge, client->rsa.challenge_len);
|
client->rsa.challenge, client->rsa.challenge_len);
|
||||||
msg->length = htons(len);
|
msg->length = htons(len);
|
||||||
|
|
||||||
nvnc_trace("Challenge length is %zd", len);
|
|
||||||
|
|
||||||
stream_write(client->net_stream, buffer, sizeof(*msg) + len, NULL, NULL);
|
stream_write(client->net_stream, buffer, sizeof(*msg) + len, NULL, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -558,14 +556,9 @@ static int on_rsa_aes_public_key(struct nvnc_client* client)
|
||||||
sizeof(*msg) + byte_length * 2)
|
sizeof(*msg) + byte_length * 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
nvnc_trace("Got public key with bit size %d", bit_length);
|
|
||||||
|
|
||||||
const uint8_t* modulus = msg->modulus_and_exponent;
|
const uint8_t* modulus = msg->modulus_and_exponent;
|
||||||
const uint8_t* exponent = msg->modulus_and_exponent + byte_length;
|
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 =
|
client->rsa.pub =
|
||||||
crypto_rsa_pub_key_import(modulus, exponent, byte_length);
|
crypto_rsa_pub_key_import(modulus, exponent, byte_length);
|
||||||
assert(client->rsa.pub);
|
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)
|
if (client->buffer_len - client->buffer_index < sizeof(*msg) + length)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
crypto_dump_base16("client buffer", client->msg_buffer +
|
|
||||||
client->buffer_index, client->buffer_len -
|
|
||||||
client->buffer_index);
|
|
||||||
|
|
||||||
struct nvnc* server = client->server;
|
struct nvnc* server = client->server;
|
||||||
|
|
||||||
nvnc_trace("Encrypted challenge has length: %d", length);
|
|
||||||
|
|
||||||
uint8_t client_random[32] = {};
|
uint8_t client_random[32] = {};
|
||||||
ssize_t len = crypto_rsa_decrypt(server->rsa_priv, client_random,
|
ssize_t len = crypto_rsa_decrypt(server->rsa_priv, client_random,
|
||||||
client->rsa.challenge_len, msg->challenge, length);
|
client->rsa.challenge_len, msg->challenge, length);
|
||||||
|
|
Loading…
Reference in New Issue