Skip to content
Snippets Groups Projects
Commit 1e9488f2 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Extract expressions in construct_ntor_key_map()

No behavioral change here: this is just refactoring.
parent 02840169
No related branches found
No related tags found
No related merge requests found
......@@ -278,19 +278,16 @@ construct_ntor_key_map(void)
{
di_digest256_map_t *m = NULL;
if (!tor_mem_is_zero((const char*)
curve25519_onion_key.pubkey.public_key,
CURVE25519_PUBKEY_LEN)) {
dimap_add_entry(&m,
curve25519_onion_key.pubkey.public_key,
const uint8_t *cur_pk = curve25519_onion_key.pubkey.public_key;
const uint8_t *last_pk = last_curve25519_onion_key.pubkey.public_key;
if (!tor_mem_is_zero((const char *)cur_pk, CURVE25519_PUBKEY_LEN)) {
dimap_add_entry(&m, cur_pk,
tor_memdup(&curve25519_onion_key,
sizeof(curve25519_keypair_t)));
}
if (!tor_mem_is_zero((const char*)
last_curve25519_onion_key.pubkey.public_key,
CURVE25519_PUBKEY_LEN)) {
dimap_add_entry(&m,
last_curve25519_onion_key.pubkey.public_key,
if (!tor_mem_is_zero((const char*)last_pk, CURVE25519_PUBKEY_LEN)) {
dimap_add_entry(&m, last_pk,
tor_memdup(&last_curve25519_onion_key,
sizeof(curve25519_keypair_t)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment