aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-11-25 22:28:12 -0500
committerNick Mathewson <nickm@torproject.org>2015-11-25 22:28:12 -0500
commitc875265bbbddc50674f65169ee49d5612bef72a7 (patch)
tree60db6e9b5c83f08fb34f5da3b60300a67c4272a1 /src/common
parente14f9dd44f637c0211530e5e630eba1a129d1650 (diff)
parentb1b8f7982ebac1347a86d5eb9eee8e5f3bd3d39c (diff)
downloadtor-c875265bbbddc50674f65169ee49d5612bef72a7.tar.gz
tor-c875265bbbddc50674f65169ee49d5612bef72a7.zip
Merge remote-tracking branch 'teor/check-crypto-errors-v2'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/crypto.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 913d1c26c9..86357b0a43 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1906,11 +1906,14 @@ crypto_hmac_sha256(char *hmac_out,
const char *key, size_t key_len,
const char *msg, size_t msg_len)
{
+ unsigned char *rv = NULL;
/* If we've got OpenSSL >=0.9.8 we can use its hmac implementation. */
tor_assert(key_len < INT_MAX);
tor_assert(msg_len < INT_MAX);
- HMAC(EVP_sha256(), key, (int)key_len, (unsigned char*)msg, (int)msg_len,
- (unsigned char*)hmac_out, NULL);
+ tor_assert(hmac_out);
+ rv = HMAC(EVP_sha256(), key, (int)key_len, (unsigned char*)msg, (int)msg_len,
+ (unsigned char*)hmac_out, NULL);
+ tor_assert(rv);
}
/* DH */