openssl/providers
Daniel Bevenius 8be513ae46 Mark pop/clear error stack in der2key_decode_p8
This commit sets the error mark before calling d2i_X509_SIG
and clear it if that function call is successful.

The motivation for this is that if d2i_X509_SIG returns NULL then the
else clause will be entered and d2i_PKCS8_PRIV_KEY_INFO will be
called. If d2i_X509_SIG raised any errors those error will be on the
error stack when d2i_PKCS8_PRIV_KEY_INFO gets called, and even if it
returns successfully those errors will still be on the error stack.

We ran into this issue when upgrading Node.js to 3.0.0-alpha15.
More details can be found in the ref links below.

Refs: https://github.com/nodejs/node/issues/38373
Refs: https://github.com/danbev/learning-libcrypto/blob/master/notes/wrong-tag-issue2.md

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/15067)
2021-05-09 11:31:52 -07:00
..
common Drop libimplementations.a 2021-05-07 10:17:23 +02:00
fips Clarify two comments (typos) in fipsprov.c 2021-05-06 22:59:21 +10:00
implementations Mark pop/clear error stack in der2key_decode_p8 2021-05-09 11:31:52 -07:00
baseprov.c Update copyright year 2021-04-08 13:04:41 +01:00
build.info Drop libimplementations.a 2021-05-07 10:17:23 +02:00
decoders.inc
defltprov.c PROV: Add OIDs we know to all provider applicable algorithms 2021-04-18 10:10:23 +02:00
encoders.inc
fips-sources.checksums FIPS checksums update 2021-05-09 14:57:52 +03:00
fips.checksum FIPS checksums update 2021-05-09 14:57:52 +03:00
fips.module.sources Remove unused code from the fips module 2021-05-08 20:44:41 +10:00
legacyprov.c Update copyright year 2021-04-22 14:38:44 +01:00
nullprov.c
prov_running.c
stores.inc