diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-03-26 15:34:54 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-03-26 15:34:54 +0200 |
commit | d11976b8bd4bded2939ff973d7b2beb36c201bf0 (patch) | |
tree | a0fd4b5df11eba889d7fa393b2b32aea57984331 /src/feature/relay/routerkeys.c | |
parent | 2790ee3685ac2d906cab99d1eac8f7a627b00d90 (diff) | |
parent | 6c652eae0a95cae095f5adad9cc51e1f1a183245 (diff) | |
download | tor-d11976b8bd4bded2939ff973d7b2beb36c201bf0.tar.gz tor-d11976b8bd4bded2939ff973d7b2beb36c201bf0.zip |
Merge branch 'tor-github/pr/709'
Diffstat (limited to 'src/feature/relay/routerkeys.c')
-rw-r--r-- | src/feature/relay/routerkeys.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/feature/relay/routerkeys.c b/src/feature/relay/routerkeys.c index 876f908d41..d965777ad6 100644 --- a/src/feature/relay/routerkeys.c +++ b/src/feature/relay/routerkeys.c @@ -631,14 +631,14 @@ get_master_identity_keypair(void) } #endif /* defined(TOR_UNIT_TESTS) */ -const ed25519_keypair_t * -get_master_signing_keypair(void) +MOCK_IMPL(const ed25519_keypair_t *, +get_master_signing_keypair,(void)) { return master_signing_key; } -const struct tor_cert_st * -get_master_signing_key_cert(void) +MOCK_IMPL(const struct tor_cert_st *, +get_master_signing_key_cert,(void)) { return signing_key_cert; } @@ -706,6 +706,8 @@ make_tap_onion_key_crosscert(const crypto_pk_t *onion_key, *len_out = 0; if (crypto_pk_get_digest(rsa_id_key, (char*)signed_data) < 0) { + log_info(LD_OR, "crypto_pk_get_digest failed in " + "make_tap_onion_key_crosscert!"); return NULL; } memcpy(signed_data + DIGEST_LEN, master_id_key->pubkey, ED25519_PUBKEY_LEN); @@ -713,8 +715,12 @@ make_tap_onion_key_crosscert(const crypto_pk_t *onion_key, int r = crypto_pk_private_sign(onion_key, (char*)signature, sizeof(signature), (const char*)signed_data, sizeof(signed_data)); - if (r < 0) + if (r < 0) { + /* It's probably missing the private key */ + log_info(LD_OR, "crypto_pk_private_sign failed in " + "make_tap_onion_key_crosscert!"); return NULL; + } *len_out = r; |