openssl/crypto/asn1
Daniel Bevenius d00bd4e452 Set mark and pop error in d2i_PrivateKey_ex
This commit sets the error mark before calling old_priv_decode and if
old_priv_decode returns false, and if EVP_PKCS82PKEY is successful, the
errors are popped to the previously set mark.

The motivation for this is an issue we found when linking Node.js
against OpenSSL 3.0. Details can be found in the link below and the
test case provided in this commit attempts cover this.

Refs: https://github.com/danbev/learning-libcrypto#asn1-wrong-tag-issue
Refs: https://github.com/nodejs/node/issues/29817

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13073)
2020-10-08 17:53:21 +02:00
..
a_bitstr.c Reorganize local header files 2019-09-28 20:26:35 +02:00
a_d2i_fp.c STORE: Move the built-in 'file:' loader to become an engine module 2020-09-03 17:48:32 +02:00
a_digest.c Run the withlibctx.pl script 2020-10-01 09:25:20 +01:00
a_dup.c constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 2019-03-06 16:10:09 +00:00
a_gentm.c Update copyright year 2020-04-23 13:55:52 +01:00
a_i2d_fp.c constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 2019-03-06 16:10:09 +00:00
a_int.c Reorganize local header files 2019-09-28 20:26:35 +02:00
a_mbstr.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
a_object.c Reorganize local header files 2019-09-28 20:26:35 +02:00
a_octet.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
a_print.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
a_sign.c Run the withlibctx.pl script 2020-10-01 09:25:20 +01:00
a_strex.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
a_strnid.c Fix safestack issues in asn1.h 2020-09-13 11:10:40 +01:00
a_time.c Update copyright year 2020-04-23 13:55:52 +01:00
a_type.c Reorganize local header files 2019-09-28 20:26:35 +02:00
a_utctm.c Update copyright year 2020-04-23 13:55:52 +01:00
a_utf8.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
a_verify.c Run the withlibctx.pl script 2020-10-01 09:25:20 +01:00
ameth_lib.c Add libctx and propq param to ASN.1 sign/verify/HMAC/decrypt 2020-08-21 09:04:10 +02:00
asn1_err.c Add libctx and propq param to ASN.1 sign/verify/HMAC/decrypt 2020-08-21 09:04:10 +02:00
asn1_gen.c Fix safestack issues in conf.h 2020-09-13 11:11:20 +01:00
asn1_item_list.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
asn1_item_list.h Issuer Sign Tool extention support 2020-03-25 15:33:53 +03:00
asn1_lib.c Deprecate ASN1_STRING_length_set in OpenSSL 3.0. 2020-09-20 14:20:27 +02:00
asn1_local.h Reorganize local header files 2019-09-28 20:26:35 +02:00
asn1_par.c Update copyright year 2020-04-23 13:55:52 +01:00
asn_mime.c Run the withlibctx.pl script 2020-10-01 09:25:20 +01:00
asn_moid.c Fix safestack issues in conf.h 2020-09-13 11:11:20 +01:00
asn_mstbl.c Fix safestack issues in conf.h 2020-09-13 11:11:20 +01:00
asn_pack.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
bio_asn1.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
bio_ndef.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
build.info Use build.info, not ifdef for crypto modules 2020-04-16 13:52:22 +02:00
charmap.h Run make update 2020-01-02 14:39:34 +00:00
charmap.pl Update copyright year 2020-04-23 13:55:52 +01:00
d2i_param.c STORE: Move the built-in 'file:' loader to become an engine module 2020-09-03 17:48:32 +02:00
d2i_pr.c Set mark and pop error in d2i_PrivateKey_ex 2020-10-08 17:53:21 +02:00
d2i_pu.c Update copyright year 2020-04-23 13:55:52 +01:00
evp_asn1.c Add CMS AuthEnvelopedData with AES-GCM support 2020-09-08 15:43:11 +02:00
f_int.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
f_string.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
i2d_param.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
i2d_pr.c ENCODER: Adapt calls to the changed OSSL_ENCODER_CTX_new_by_EVP_PKEY() 2020-09-20 17:31:22 +02:00
i2d_pu.c Update copyright year 2020-04-23 13:55:52 +01:00
n_pkey.c Update copyright year 2020-04-23 13:55:52 +01:00
nsseq.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
p5_pbe.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
p5_pbev2.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
p5_scrypt.c Coverity CID 1444959: Integer handling issues 2019-05-08 09:52:58 +10:00
p8_pkey.c Update copyright year 2020-04-23 13:55:52 +01:00
standard_methods.h Delete unused PKEY MAC files 2020-08-29 17:40:11 +10:00
t_bitst.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
t_pkey.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
t_spki.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
tasn_dec.c Fix safestack issues in asn1t.h 2020-09-13 11:10:41 +01:00
tasn_enc.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
tasn_fre.c Fix safestack issues in asn1t.h 2020-09-13 11:10:41 +01:00
tasn_new.c Fix safestack issues in asn1t.h 2020-09-13 11:10:41 +01:00
tasn_prn.c Reorganize local header files 2019-09-28 20:26:35 +02:00
tasn_scn.c Reorganize local header files 2019-09-28 20:26:35 +02:00
tasn_typ.c constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 2019-03-06 16:10:09 +00:00
tasn_utl.c Reorganize local header files 2019-09-28 20:26:35 +02:00
tbl_standard.h Add NID_id_on_SmtpUTF8Mailbox to table of X.509 attributes 2020-08-26 14:04:17 +03:00
x_algor.c Coverity Fixes for issue #12531 2020-08-04 12:34:22 +10:00
x_bignum.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
x_info.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
x_int64.c Reorganize local header files 2019-09-28 20:26:35 +02:00
x_long.c Update copyright year 2020-04-23 13:55:52 +01:00
x_pkey.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
x_sig.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
x_spki.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00
x_val.c Following the license change, modify the boilerplates in crypto/asn1/ 2018-12-06 14:24:40 +01:00