diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-09 09:24:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-09 09:24:16 -0400 |
commit | 418f3d6298beb27e050618e2f59e01d6d3b2f45b (patch) | |
tree | 97ac6a038194559561a34d245fbd74584cb5f9c6 /src/or/routerkeys.c | |
parent | 9696021593d28a7ae3b6a88ac57ff31234b469f5 (diff) | |
download | tor-418f3d6298beb27e050618e2f59e01d6d3b2f45b.tar.gz tor-418f3d6298beb27e050618e2f59e01d6d3b2f45b.zip |
Make sure we always wind up checking i2d_*'s output.
The biggest offender here was sometimes not checking the output of
crypto_pk_get_digest.
Fixes bug 19418. Reported by Guido Vranken.
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r-- | src/or/routerkeys.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index ca32228fc7..5a41d62618 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -1079,7 +1079,9 @@ make_tap_onion_key_crosscert(const crypto_pk_t *onion_key, uint8_t signed_data[DIGEST_LEN + ED25519_PUBKEY_LEN]; *len_out = 0; - crypto_pk_get_digest(rsa_id_key, (char*)signed_data); + if (crypto_pk_get_digest(rsa_id_key, (char*)signed_data) < 0) { + return NULL; + } memcpy(signed_data + DIGEST_LEN, master_id_key->pubkey, ED25519_PUBKEY_LEN); int r = crypto_pk_private_sign(onion_key, |