summaryrefslogtreecommitdiff
path: root/crypto/err/err_prn.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-05-26 12:44:36 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-05-26 12:44:36 +1000
commitf32af93c924dca25728d8e7b85b8e4b660154e12 (patch)
treecd3011c4dfe565e6fd4950d47db7d30bfadd7953 /crypto/err/err_prn.c
parent1bdd86fb1ca40dd3536abf16b6273230c15537b6 (diff)
downloadopenssl-new-f32af93c924dca25728d8e7b85b8e4b660154e12.tar.gz
Fix ERR_print_errors so that it matches the documented format in doc/man3/ERR_error_string.pod
Fixes #11743 The ouput format had 2 issues that caused it not to match the expected documented format: (1) At some point the thread id printing was changed to use the OPENSSL_hex2str method which puts ':' between hex bytes. An internal function that skips the seperator has been added. (2) The error code no longer exists. So this was completely removed from the string. It is now replaced by :: As an example: 00:77:6E:52:14:7F:00:00:error:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1135: Is now: 00776E52147F0000:error::asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1135: Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11789)
Diffstat (limited to 'crypto/err/err_prn.c')
-rw-r--r--crypto/err/err_prn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c
index 5c4ebcbddd..80cc0ecf1a 100644
--- a/crypto/err/err_prn.c
+++ b/crypto/err/err_prn.c
@@ -35,8 +35,9 @@ void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
func = "unknown function";
if ((flags & ERR_TXT_STRING) == 0)
data = "";
- hex = OPENSSL_buf2hexstr((const unsigned char *)&tid, sizeof(tid));
- BIO_snprintf(buf, sizeof(buf), "%s:error:%s:%s:%s:%s:%d:%s\n",
+ hex = openssl_buf2hexstr_sep((const unsigned char *)&tid, sizeof(tid),
+ '\0');
+ BIO_snprintf(buf, sizeof(buf), "%s:error::%s:%s:%s:%s:%d:%s\n",
hex == NULL ? "<null>" : hex, lib, func, reason, file,
line, data);
OPENSSL_free(hex);