summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-11-29 07:03:40 +0000
committertb <>2022-11-29 07:03:40 +0000
commitc9424e2f80aa0220687ef66e43b39fb110a65189 (patch)
treeb820a3c432e913659b5bbabe4a3afd7c12b1edf7 /src
parent7a9f1540b595b77472c95f43edef1b405b590b5b (diff)
downloadopenbsd-c9424e2f80aa0220687ef66e43b39fb110a65189.tar.gz
openbsd-c9424e2f80aa0220687ef66e43b39fb110a65189.tar.bz2
openbsd-c9424e2f80aa0220687ef66e43b39fb110a65189.zip
Make X509_verify_cert_error_string() thread safe
Stop returning a pointer to a static buffer containing the error code on unknown error. While this might be helpful, it's not going to end well. ok beck claudio jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_txt.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509_txt.c b/src/lib/libcrypto/x509/x509_txt.c
index 129757494c..8485aeb5d1 100644
--- a/src/lib/libcrypto/x509/x509_txt.c
+++ b/src/lib/libcrypto/x509/x509_txt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_txt.c,v 1.21 2022/11/14 17:48:50 beck Exp $ */ 1/* $OpenBSD: x509_txt.c,v 1.22 2022/11/29 07:03:40 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -70,8 +70,6 @@
70const char * 70const char *
71X509_verify_cert_error_string(long n) 71X509_verify_cert_error_string(long n)
72{ 72{
73 static char buf[100];
74
75 switch ((int)n) { 73 switch ((int)n) {
76 case X509_V_OK: 74 case X509_V_OK:
77 return("ok"); 75 return("ok");
@@ -199,8 +197,7 @@ X509_verify_cert_error_string(long n)
199 return("CA signature digest algorithm too weak"); 197 return("CA signature digest algorithm too weak");
200 198
201 default: 199 default:
202 (void) snprintf(buf, sizeof buf, "error number %ld", n); 200 return("Unknown certificate verification error");
203 return(buf);
204 } 201 }
205} 202}
206LCRYPTO_ALIAS(X509_verify_cert_error_string) 203LCRYPTO_ALIAS(X509_verify_cert_error_string)