diff options
| author | beck <> | 2017-01-29 17:49:23 +0000 |
|---|---|---|
| committer | beck <> | 2017-01-29 17:49:23 +0000 |
| commit | d1f47bd292f36094480caa49ada36b99a69c59b0 (patch) | |
| tree | 1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/evp/evp_lib.c | |
| parent | f8c627888330b75c2eea8a3c27d0efe947a4f9da (diff) | |
| download | openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.tar.gz openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.tar.bz2 openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.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.c | 10 |
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 | |||
| 291 | EVP_MD_size(const EVP_MD *md) | 289 | EVP_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; |
