summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl.h')
-rw-r--r--ext/openssl/ossl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 1db7c08279..f31179110f 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -138,6 +138,13 @@ do{\
int ossl_pem_passwd_cb(char *, int, int, void *);
/*
+ * Clear BIO* with this in PEM/DER fallback scenarios to avoid decoding
+ * errors piling up in OpenSSL::Errors
+ */
+#define OSSL_BIO_reset(bio) (void)BIO_reset((bio)); \
+ ERR_clear_error();
+
+/*
* ERRor messages
*/
#define OSSL_ErrMsg() ERR_reason_error_string(ERR_get_error())