diff options
Diffstat (limited to 'src/lib/libcrypto/evp/digest.c')
-rw-r--r-- | src/lib/libcrypto/evp/digest.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c index 4a18aff657..c9fb60d49b 100644 --- a/src/lib/libcrypto/evp/digest.c +++ b/src/lib/libcrypto/evp/digest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: digest.c,v 1.24 2014/11/09 19:12:18 miod Exp $ */ | 1 | /* $OpenBSD: digest.c,v 1.25 2015/02/10 09:52:35 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -249,7 +249,10 @@ EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | |||
249 | { | 249 | { |
250 | int ret; | 250 | int ret; |
251 | 251 | ||
252 | OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); | 252 | if ((size_t)ctx->digest->md_size > EVP_MAX_MD_SIZE) { |
253 | EVPerr(EVP_F_EVP_DIGESTFINAL_EX, EVP_R_TOO_LARGE); | ||
254 | return 0; | ||
255 | } | ||
253 | ret = ctx->digest->final(ctx, md); | 256 | ret = ctx->digest->final(ctx, md); |
254 | if (size != NULL) | 257 | if (size != NULL) |
255 | *size = ctx->digest->md_size; | 258 | *size = ctx->digest->md_size; |