diff options
author | beck <> | 2017-01-29 17:49:23 +0000 |
---|---|---|
committer | beck <> | 2017-01-29 17:49:23 +0000 |
commit | 957b11334a7afb14537322f0e4795b2e368b3f59 (patch) | |
tree | 1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/asn1/a_int.c | |
parent | df96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff) | |
download | openbsd-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_int.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_int.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index 5c0103ba36..95d0f6dbb2 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_int.c,v 1.30 2015/09/30 17:30:15 jsing Exp $ */ | 1 | /* $OpenBSD: a_int.c,v 1.31 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 | * |
@@ -266,7 +266,7 @@ c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long len) | |||
266 | return (ret); | 266 | return (ret); |
267 | 267 | ||
268 | err: | 268 | err: |
269 | ASN1err(ASN1_F_C2I_ASN1_INTEGER, i); | 269 | ASN1error(i); |
270 | if (a == NULL || *a != ret) | 270 | if (a == NULL || *a != ret) |
271 | ASN1_INTEGER_free(ret); | 271 | ASN1_INTEGER_free(ret); |
272 | return (NULL); | 272 | return (NULL); |
@@ -332,7 +332,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length) | |||
332 | return (ret); | 332 | return (ret); |
333 | 333 | ||
334 | err: | 334 | err: |
335 | ASN1err(ASN1_F_D2I_ASN1_UINTEGER, i); | 335 | ASN1error(i); |
336 | if (a == NULL || *a != ret) | 336 | if (a == NULL || *a != ret) |
337 | ASN1_INTEGER_free(ret); | 337 | ASN1_INTEGER_free(ret); |
338 | return (NULL); | 338 | return (NULL); |
@@ -353,7 +353,7 @@ ASN1_INTEGER_set(ASN1_INTEGER *a, long v) | |||
353 | a->data = calloc(1, sizeof(long) + 1); | 353 | a->data = calloc(1, sizeof(long) + 1); |
354 | } | 354 | } |
355 | if (a->data == NULL) { | 355 | if (a->data == NULL) { |
356 | ASN1err(ASN1_F_ASN1_INTEGER_SET, ERR_R_MALLOC_FAILURE); | 356 | ASN1error(ERR_R_MALLOC_FAILURE); |
357 | return (0); | 357 | return (0); |
358 | } | 358 | } |
359 | d = v; | 359 | d = v; |
@@ -416,7 +416,7 @@ BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) | |||
416 | else | 416 | else |
417 | ret = ai; | 417 | ret = ai; |
418 | if (ret == NULL) { | 418 | if (ret == NULL) { |
419 | ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_NESTED_ASN1_ERROR); | 419 | ASN1error(ERR_R_NESTED_ASN1_ERROR); |
420 | goto err; | 420 | goto err; |
421 | } | 421 | } |
422 | if (BN_is_negative(bn)) | 422 | if (BN_is_negative(bn)) |
@@ -428,7 +428,7 @@ BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) | |||
428 | if (ret->length < len + 4) { | 428 | if (ret->length < len + 4) { |
429 | unsigned char *new_data = realloc(ret->data, len + 4); | 429 | unsigned char *new_data = realloc(ret->data, len + 4); |
430 | if (!new_data) { | 430 | if (!new_data) { |
431 | ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); | 431 | ASN1error(ERR_R_MALLOC_FAILURE); |
432 | goto err; | 432 | goto err; |
433 | } | 433 | } |
434 | ret->data = new_data; | 434 | ret->data = new_data; |
@@ -454,7 +454,7 @@ ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) | |||
454 | BIGNUM *ret; | 454 | BIGNUM *ret; |
455 | 455 | ||
456 | if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) | 456 | if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) |
457 | ASN1err(ASN1_F_ASN1_INTEGER_TO_BN, ASN1_R_BN_LIB); | 457 | ASN1error(ASN1_R_BN_LIB); |
458 | else if (ai->type == V_ASN1_NEG_INTEGER) | 458 | else if (ai->type == V_ASN1_NEG_INTEGER) |
459 | BN_set_negative(ret, 1); | 459 | BN_set_negative(ret, 1); |
460 | return (ret); | 460 | return (ret); |