Clear error stack on successful OSSL_STORE_open()
authorRichard Levitte <levitte@openssl.org>
Sat, 5 Aug 2017 12:56:13 +0000 (14:56 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 15 Aug 2017 12:28:23 +0000 (14:28 +0200)
commit140dab3d3a099feb38d5987adb471c61a8eabb4b
treebcd209168fc2ef52dbe4be349e81971346b24e19
parente1a4ff7678ef8fd2d67416f84a7408e826c7dccc
Clear error stack on successful OSSL_STORE_open()

Since OSSL_STORE_open() tries with the 'file' scheme loader first, and
then on the loader implied by the URI if the former fails, the former
leaves an error on the error stack.  This is confusing, so let's clear
the error stack on success.  The implementation uses ERR_set_mark,
ERR_pop_to_mark and ERR_clear_last_mark to make sure caller errors are
preserved as much as possible.

Fixes #4089

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4094)
crypto/store/store_lib.c