From 9350aaa41db8fcb0b55dadbd5fbe807ef5288557 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Fri, 19 Nov 2021 11:58:40 +0100 Subject: [PATCH] ERR: exempt flags from fallback decimal reason code printing Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/17072) --- crypto/err/err.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/err/err.c b/crypto/err/err.c index 60a9b02d19a..0f584fdf80c 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -527,7 +527,8 @@ void ossl_err_string_int(unsigned long e, const char *func, } #endif if (rs == NULL) { - BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r); + BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", + r & ~(ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET)); rs = rsbuf; } -- 2.47.3