ASN1: rename asn1_par.c to asn1_parse.c for clarity; simplify asn1_parse2()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15722)
master
Dr. David von Oheimb 2 years ago committed by Dr. David von Oheimb
parent a5d250e57e
commit 4439a6483e

@ -115,9 +115,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
op = p;
j = ASN1_get_object(&p, &len, &tag, &xclass, length);
if (j & 0x80) {
if (BIO_write(bp, "Error in encoding\n", 18) <= 0)
goto end;
ret = 0;
BIO_puts(bp, "Error in encoding\n");
goto end;
}
hl = (p - op);
@ -136,7 +134,6 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
goto end;
if (len > length) {
BIO_printf(bp, "length is greater than %ld\n", length);
ret = 0;
goto end;
}
if ((j == 0x21) && (len == 0)) {
@ -144,10 +141,8 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
r = asn1_parse2(bp, &p, (long)(tot - p),
offset + (p - *pp), depth + 1,
indent, dump);
if (r == 0) {
ret = 0;
if (r == 0)
goto end;
}
if ((r == 2) || (p >= tot)) {
len = p - sp;
break;
@ -161,10 +156,8 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
r = asn1_parse2(bp, &p, tmp,
offset + (p - *pp), depth + 1,
indent, dump);
if (r == 0) {
ret = 0;
if (r == 0)
goto end;
}
tmp -= p - sp;
}
}

@ -11,7 +11,7 @@ SOURCE[../../libcrypto]=\
tasn_prn.c tasn_scn.c ameth_lib.c \
f_int.c f_string.c \
x_pkey.c bio_asn1.c bio_ndef.c asn_mime.c \
asn1_gen.c asn1_par.c asn1_lib.c asn1_err.c a_strnid.c \
asn1_gen.c asn1_parse.c asn1_lib.c asn1_err.c a_strnid.c \
evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p5_scrypt.c p8_pkey.c \
asn_moid.c asn_mstbl.c asn1_item_list.c \
d2i_param.c

Loading…
Cancel
Save