summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_lib.c
diff options
context:
space:
mode:
authorbeck <>2017-01-29 17:49:23 +0000
committerbeck <>2017-01-29 17:49:23 +0000
commit957b11334a7afb14537322f0e4795b2e368b3f59 (patch)
tree1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/evp/evp_lib.c
parentdf96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff)
downloadopenbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.gz
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.bz2
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.zip
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
Diffstat (limited to 'src/lib/libcrypto/evp/evp_lib.c')
-rw-r--r--src/lib/libcrypto/evp/evp_lib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c
index 491c8d6f67..ad97a3b7b9 100644
--- a/src/lib/libcrypto/evp/evp_lib.c
+++ b/src/lib/libcrypto/evp/evp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_lib.c,v 1.14 2015/02/10 09:52:35 miod Exp $ */ 1/* $OpenBSD: evp_lib.c,v 1.15 2017/01/29 17:49:23 beck 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 *
@@ -100,8 +100,7 @@ EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
100 if (type != NULL) { 100 if (type != NULL) {
101 l = EVP_CIPHER_CTX_iv_length(c); 101 l = EVP_CIPHER_CTX_iv_length(c);
102 if (l > sizeof(c->iv)) { 102 if (l > sizeof(c->iv)) {
103 EVPerr(EVP_F_EVP_CIPHER_GET_ASN1_IV, 103 EVPerror(EVP_R_IV_TOO_LARGE);
104 EVP_R_IV_TOO_LARGE);
105 return 0; 104 return 0;
106 } 105 }
107 i = ASN1_TYPE_get_octetstring(type, c->oiv, l); 106 i = ASN1_TYPE_get_octetstring(type, c->oiv, l);
@@ -122,8 +121,7 @@ EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
122 if (type != NULL) { 121 if (type != NULL) {
123 j = EVP_CIPHER_CTX_iv_length(c); 122 j = EVP_CIPHER_CTX_iv_length(c);
124 if (j > sizeof(c->iv)) { 123 if (j > sizeof(c->iv)) {
125 EVPerr(EVP_F_EVP_CIPHER_SET_ASN1_IV, 124 EVPerror(EVP_R_IV_TOO_LARGE);
126 EVP_R_IV_TOO_LARGE);
127 return 0; 125 return 0;
128 } 126 }
129 i = ASN1_TYPE_set_octetstring(type, c->oiv, j); 127 i = ASN1_TYPE_set_octetstring(type, c->oiv, j);
@@ -291,7 +289,7 @@ int
291EVP_MD_size(const EVP_MD *md) 289EVP_MD_size(const EVP_MD *md)
292{ 290{
293 if (!md) { 291 if (!md) {
294 EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL); 292 EVPerror(EVP_R_MESSAGE_DIGEST_IS_NULL);
295 return -1; 293 return -1;
296 } 294 }
297 return md->md_size; 295 return md->md_size;