summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/asn1_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/asn1/asn1_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/asn1/asn1_lib.c')
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index 444a34c072..a90873d54a 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.37 2016/03/06 18:05:00 beck Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.38 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 *
@@ -140,7 +140,7 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
140 goto err; 140 goto err;
141 141
142 if (*plength > (omax - (p - *pp))) { 142 if (*plength > (omax - (p - *pp))) {
143 ASN1err(ASN1_F_ASN1_GET_OBJECT, ASN1_R_TOO_LONG); 143 ASN1error(ASN1_R_TOO_LONG);
144 /* Set this so that even if things are not long enough 144 /* Set this so that even if things are not long enough
145 * the values are set correctly */ 145 * the values are set correctly */
146 ret |= 0x80; 146 ret |= 0x80;
@@ -149,7 +149,7 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
149 return (ret | inf); 149 return (ret | inf);
150 150
151err: 151err:
152 ASN1err(ASN1_F_ASN1_GET_OBJECT, ASN1_R_HEADER_TOO_LONG); 152 ASN1error(ASN1_R_HEADER_TOO_LONG);
153 return (0x80); 153 return (0x80);
154} 154}
155 155
@@ -385,7 +385,7 @@ ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
385 unsigned char *tmp; 385 unsigned char *tmp;
386 tmp = realloc(str->data, len + 1); 386 tmp = realloc(str->data, len + 1);
387 if (tmp == NULL) { 387 if (tmp == NULL) {
388 ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE); 388 ASN1error(ERR_R_MALLOC_FAILURE);
389 return (0); 389 return (0);
390 } 390 }
391 str->data = tmp; 391 str->data = tmp;
@@ -421,7 +421,7 @@ ASN1_STRING_type_new(int type)
421 421
422 ret = malloc(sizeof(ASN1_STRING)); 422 ret = malloc(sizeof(ASN1_STRING));
423 if (ret == NULL) { 423 if (ret == NULL) {
424 ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE); 424 ASN1error(ERR_R_MALLOC_FAILURE);
425 return (NULL); 425 return (NULL);
426 } 426 }
427 ret->length = 0; 427 ret->length = 0;