diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-04 16:14:00 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-13 09:35:31 +0100 |
commit | a150f8e1fcc38752fef4d7c75d765d8efc7d46d6 (patch) | |
tree | f7f62c9a5d8407d8b17820fbef67378aa7b9ddbb /crypto/asn1/asn_mime.c | |
parent | 9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2 (diff) |
CRYPTO: refactor ERR_raise()+ERR_add_error_data() to ERR_raise_data()
This is not done absolutely everywhere, as there are places where
the use of ERR_add_error_data() is quite complex, but at least the
simple cases are done.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13318)
Diffstat (limited to 'crypto/asn1/asn_mime.c')
-rw-r--r-- | crypto/asn1/asn_mime.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index 1e952734d0..8ee0970dc6 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -453,8 +453,8 @@ ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, BIO **bcont, const ASN1_ITEM *it, if (strcmp(hdr->value, "application/x-pkcs7-signature") && strcmp(hdr->value, "application/pkcs7-signature")) { - ERR_raise(ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE); - ERR_add_error_data(2, "type: ", hdr->value); + ERR_raise_data(ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE, + "type: %s", hdr->value); sk_MIME_HEADER_pop_free(headers, mime_hdr_free); sk_BIO_pop_free(parts, BIO_vfree); return NULL; @@ -480,8 +480,8 @@ ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, BIO **bcont, const ASN1_ITEM *it, if (strcmp(hdr->value, "application/x-pkcs7-mime") && strcmp(hdr->value, "application/pkcs7-mime")) { - ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE); - ERR_add_error_data(2, "type: ", hdr->value); + ERR_raise_data(ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE, + "type: %s", hdr->value); sk_MIME_HEADER_pop_free(headers, mime_hdr_free); return NULL; } @@ -566,8 +566,8 @@ int SMIME_text(BIO *in, BIO *out) return 0; } if (strcmp(hdr->value, "text/plain")) { - ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE); - ERR_add_error_data(2, "type: ", hdr->value); + ERR_raise_data(ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE, + "type: %s", hdr->value); sk_MIME_HEADER_pop_free(headers, mime_hdr_free); return 0; } |