summaryrefslogtreecommitdiffstats
path: root/crypto/hmac/hm_pmeth.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-12-29 16:11:58 +0000
committerBen Laurie <ben@openssl.org>2008-12-29 16:11:58 +0000
commit0eab41fb78cf4d7c76e563fd677ab6c32fc28bb0 (patch)
treeda848c7424ced86fc60823f4948b0fc79e52a381 /crypto/hmac/hm_pmeth.c
parent8aa02e97a782a4229936d5df6da42db3efe4acd1 (diff)
If we're going to return errors (no matter how stupid), then we should
test for them!
Diffstat (limited to 'crypto/hmac/hm_pmeth.c')
-rw-r--r--crypto/hmac/hm_pmeth.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/hmac/hm_pmeth.c b/crypto/hmac/hm_pmeth.c
index aff7013b76..985921ca1a 100644
--- a/crypto/hmac/hm_pmeth.c
+++ b/crypto/hmac/hm_pmeth.c
@@ -157,7 +157,11 @@ static int hmac_signctx(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
{
unsigned int hlen;
HMAC_PKEY_CTX *hctx = ctx->data;
- *siglen = EVP_MD_CTX_size(mctx);
+ int l = EVP_MD_CTX_size(mctx);
+
+ if (l < 0)
+ return 0;
+ *siglen = l;
if (!sig)
return 1;