summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_enum.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/asn1/a_enum.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/asn1/a_enum.c')
-rw-r--r--src/lib/libcrypto/asn1/a_enum.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/a_enum.c b/src/lib/libcrypto/asn1/a_enum.c
index 142f6ed575..23875958bf 100644
--- a/src/lib/libcrypto/asn1/a_enum.c
+++ b/src/lib/libcrypto/asn1/a_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_enum.c,v 1.17 2015/09/30 18:45:56 jsing Exp $ */ 1/* $OpenBSD: a_enum.c,v 1.18 2017/01/29 17:49:22 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 *
@@ -81,7 +81,7 @@ ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
81 a->data = calloc(1, sizeof(long) + 1); 81 a->data = calloc(1, sizeof(long) + 1);
82 } 82 }
83 if (a->data == NULL) { 83 if (a->data == NULL) {
84 ASN1err(ASN1_F_ASN1_ENUMERATED_SET, ERR_R_MALLOC_FAILURE); 84 ASN1error(ERR_R_MALLOC_FAILURE);
85 return (0); 85 return (0);
86 } 86 }
87 d = v; 87 d = v;
@@ -144,7 +144,7 @@ BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
144 else 144 else
145 ret = ai; 145 ret = ai;
146 if (ret == NULL) { 146 if (ret == NULL) {
147 ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED, ERR_R_NESTED_ASN1_ERROR); 147 ASN1error(ERR_R_NESTED_ASN1_ERROR);
148 goto err; 148 goto err;
149 } 149 }
150 if (BN_is_negative(bn)) 150 if (BN_is_negative(bn))
@@ -156,7 +156,7 @@ BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
156 if (ret->length < len + 4) { 156 if (ret->length < len + 4) {
157 unsigned char *new_data = realloc(ret->data, len + 4); 157 unsigned char *new_data = realloc(ret->data, len + 4);
158 if (!new_data) { 158 if (!new_data) {
159 ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); 159 ASN1error(ERR_R_MALLOC_FAILURE);
160 goto err; 160 goto err;
161 } 161 }
162 ret->data = new_data; 162 ret->data = new_data;
@@ -182,7 +182,7 @@ ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)
182 BIGNUM *ret; 182 BIGNUM *ret;
183 183
184 if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) 184 if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL)
185 ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN, ASN1_R_BN_LIB); 185 ASN1error(ASN1_R_BN_LIB);
186 else if (ai->type == V_ASN1_NEG_ENUMERATED) 186 else if (ai->type == V_ASN1_NEG_ENUMERATED)
187 BN_set_negative(ret, 1); 187 BN_set_negative(ret, 1);
188 return (ret); 188 return (ret);