diff options
author | 2015-02-10 09:52:35 +0000 | |
---|---|---|
committer | 2015-02-10 09:52:35 +0000 | |
commit | 8ad85bf285ce705d205f8dba3343f60dcaff0145 (patch) | |
tree | fe6aaa1f00bc3bcf6aaaa3ec7a456319db838b5a /lib/libssl/src/crypto/evp/digest.c | |
parent | Remove default value initialisers for ASN1_ITEM. Minor changes to generated (diff) | |
download | wireguard-openbsd-8ad85bf285ce705d205f8dba3343f60dcaff0145.tar.xz wireguard-openbsd-8ad85bf285ce705d205f8dba3343f60dcaff0145.zip |
Replace assert() and OPENSSL_assert() calls with proper error return paths.
Careful review, feedback & ok doug@ jsing@
Diffstat (limited to 'lib/libssl/src/crypto/evp/digest.c')
-rw-r--r-- | lib/libssl/src/crypto/evp/digest.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/evp/digest.c b/lib/libssl/src/crypto/evp/digest.c index 4a18aff6578..c9fb60d49b5 100644 --- a/lib/libssl/src/crypto/evp/digest.c +++ b/lib/libssl/src/crypto/evp/digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: digest.c,v 1.24 2014/11/09 19:12:18 miod Exp $ */ +/* $OpenBSD: digest.c,v 1.25 2015/02/10 09:52:35 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -249,7 +249,10 @@ EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) { int ret; - OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); + if ((size_t)ctx->digest->md_size > EVP_MAX_MD_SIZE) { + EVPerr(EVP_F_EVP_DIGESTFINAL_EX, EVP_R_TOO_LARGE); + return 0; + } ret = ctx->digest->final(ctx, md); if (size != NULL) *size = ctx->digest->md_size; |