diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-04 12:23:19 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-13 09:35:02 +0100 |
commit | 9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2 (patch) | |
tree | e82c26569e5a952980e65a746af920beed602aab /crypto/ts/ts_asn1.c | |
parent | EVP: Adapt EVP_PKEY2PKCS8() to better handle provider-native keys (diff) | |
download | openssl-9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2.tar.xz openssl-9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2.zip |
Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call
This includes error reporting for libcrypto sub-libraries in surprising
places.
This was done using util/err-to-raise
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13318)
Diffstat (limited to 'crypto/ts/ts_asn1.c')
-rw-r--r-- | crypto/ts/ts_asn1.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/ts/ts_asn1.c b/crypto/ts/ts_asn1.c index 49f92b22ff..b916aa3dbb 100644 --- a/crypto/ts/ts_asn1.c +++ b/crypto/ts/ts_asn1.c @@ -138,18 +138,17 @@ static int ts_resp_set_tst_info(TS_RESP *a) if (a->token) { if (status != 0 && status != 1) { - TSerr(TS_F_TS_RESP_SET_TST_INFO, TS_R_TOKEN_PRESENT); + ERR_raise(ERR_LIB_TS, TS_R_TOKEN_PRESENT); return 0; } TS_TST_INFO_free(a->tst_info); a->tst_info = PKCS7_to_TS_TST_INFO(a->token); if (!a->tst_info) { - TSerr(TS_F_TS_RESP_SET_TST_INFO, - TS_R_PKCS7_TO_TS_TST_INFO_FAILED); + ERR_raise(ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED); return 0; } } else if (status == 0 || status == 1) { - TSerr(TS_F_TS_RESP_SET_TST_INFO, TS_R_TOKEN_NOT_PRESENT); + ERR_raise(ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT); return 0; } @@ -211,22 +210,22 @@ TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token) const unsigned char *p; if (!PKCS7_type_is_signed(token)) { - TSerr(TS_F_PKCS7_TO_TS_TST_INFO, TS_R_BAD_PKCS7_TYPE); + ERR_raise(ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE); return NULL; } if (PKCS7_get_detached(token)) { - TSerr(TS_F_PKCS7_TO_TS_TST_INFO, TS_R_DETACHED_CONTENT); + ERR_raise(ERR_LIB_TS, TS_R_DETACHED_CONTENT); return NULL; } pkcs7_signed = token->d.sign; enveloped = pkcs7_signed->contents; if (OBJ_obj2nid(enveloped->type) != NID_id_smime_ct_TSTInfo) { - TSerr(TS_F_PKCS7_TO_TS_TST_INFO, TS_R_BAD_PKCS7_TYPE); + ERR_raise(ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE); return NULL; } tst_info_wrapper = enveloped->d.other; if (tst_info_wrapper->type != V_ASN1_OCTET_STRING) { - TSerr(TS_F_PKCS7_TO_TS_TST_INFO, TS_R_BAD_TYPE); + ERR_raise(ERR_LIB_TS, TS_R_BAD_TYPE); return NULL; } tst_info_der = tst_info_wrapper->value.octet_string; |