X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Fasn1_par.c;h=574e8de86704630c68441c171d2665b8571dc6e0;hb=b6eb9827a6866981c08cc9613ca8b4a648894fb1;hp=b12edf9c4a360b12f75cb11df0c5cc4be9082399;hpb=0b142f022e2c5072295e00ebc11c5b707a726d74;p=oweals%2Fopenssl.git diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c index b12edf9c4a..574e8de867 100644 --- a/crypto/asn1/asn1_par.c +++ b/crypto/asn1/asn1_par.c @@ -215,15 +215,11 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, goto end; } } else if (tag == V_ASN1_BOOLEAN) { - int ii; - - opp = op; - ii = d2i_ASN1_BOOLEAN(NULL, &opp, len + hl); - if (ii < 0) { + if (len != 1) { if (BIO_write(bp, "Bad boolean\n", 12) <= 0) goto end; } - BIO_printf(bp, ":%d", ii); + BIO_printf(bp, ":%u", p[0]); } else if (tag == V_ASN1_BMPSTRING) { /* do the BMP thang */ } else if (tag == V_ASN1_OCTET_STRING) { @@ -280,10 +276,8 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, nl = 1; } } - if (os != NULL) { - M_ASN1_OCTET_STRING_free(os); - os = NULL; - } + ASN1_OCTET_STRING_free(os); + os = NULL; } else if (tag == V_ASN1_INTEGER) { ASN1_INTEGER *bs; int i; @@ -308,7 +302,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, if (BIO_write(bp, "BAD INTEGER", 11) <= 0) goto end; } - M_ASN1_INTEGER_free(bs); + ASN1_INTEGER_free(bs); } else if (tag == V_ASN1_ENUMERATED) { ASN1_ENUMERATED *bs; int i; @@ -333,7 +327,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, if (BIO_write(bp, "BAD ENUMERATED", 14) <= 0) goto end; } - M_ASN1_ENUMERATED_free(bs); + ASN1_ENUMERATED_free(bs); } else if (len > 0 && dump) { if (!nl) { if (BIO_write(bp, "\n", 1) <= 0) @@ -360,10 +354,8 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, } ret = 1; end: - if (o != NULL) - ASN1_OBJECT_free(o); - if (os != NULL) - M_ASN1_OCTET_STRING_free(os); + ASN1_OBJECT_free(o); + ASN1_OCTET_STRING_free(os); *pp = p; return (ret); }