diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-06-12 11:25:07 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-06-15 14:23:21 +0200 |
commit | 4439a6483e1579359a75f061373b377995516032 (patch) | |
tree | 56de8c156fd7e0943f541411e440e7eb09a99d86 /crypto/asn1 | |
parent | a5d250e57e88650986e8cf2dff6c698c50eb3255 (diff) | |
download | openssl-4439a6483e1579359a75f061373b377995516032.zip openssl-4439a6483e1579359a75f061373b377995516032.tar.gz openssl-4439a6483e1579359a75f061373b377995516032.tar.bz2 |
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)
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/asn1_parse.c (renamed from crypto/asn1/asn1_par.c) | 13 | ||||
-rw-r--r-- | crypto/asn1/build.info | 2 |
2 files changed, 4 insertions, 11 deletions
diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_parse.c index 3a493de..83ac535 100644 --- a/crypto/asn1/asn1_par.c +++ b/crypto/asn1/asn1_parse.c @@ -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; } } diff --git a/crypto/asn1/build.info b/crypto/asn1/build.info index e10d631..33b86fd 100644 --- a/crypto/asn1/build.info +++ b/crypto/asn1/build.info @@ -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 |