summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509
diff options
context:
space:
mode:
authortb <>2025-10-24 11:33:38 +0000
committertb <>2025-10-24 11:33:38 +0000
commitf77c42a93e09c937696f65c6aefd2b3120a20cff (patch)
tree8caa19f0bf9d3c53e5002a0ce6f375a37d971e7c /src/lib/libcrypto/x509
parent8cbd4e746f40c750809e34d04c0298e0a5ff6f42 (diff)
downloadopenbsd-f77c42a93e09c937696f65c6aefd2b3120a20cff.tar.gz
openbsd-f77c42a93e09c937696f65c6aefd2b3120a20cff.tar.bz2
openbsd-f77c42a93e09c937696f65c6aefd2b3120a20cff.zip
Expose X509_VERIFY_PARAM_get_hostflags()
This is needed by Python 3.14, extending the urllib3 nonsense further. This is a trivial getter and it is exercised by the libssl unit test I added for urllib3 (which can now use dynamic linking for libcrypto). Fixes https://github.com/libressl/portable/issues/1202 Thanks to @orbea for the report. ok kenjiro PS: X509_VERIFY_PARAM_get_flags() and X509_VERIFY_PARAM_get_peername() aren't const correct. Fixing this will require some doing...
Diffstat (limited to 'src/lib/libcrypto/x509')
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h3
-rw-r--r--src/lib/libcrypto/x509/x509_vpm.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index 7058bbc5b0..04e555149a 100644
--- a/src/lib/libcrypto/x509/x509_vfy.h
+++ b/src/lib/libcrypto/x509/x509_vfy.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.h,v 1.70 2025/03/09 15:20:20 tb Exp $ */ 1/* $OpenBSD: x509_vfy.h,v 1.71 2025/10/24 11:33:38 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 *
@@ -441,6 +441,7 @@ int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name,
441 size_t namelen); 441 size_t namelen);
442int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, 442int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name,
443 size_t namelen); 443 size_t namelen);
444unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
444void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, 445void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
445 unsigned int flags); 446 unsigned int flags);
446char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param); 447char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param);
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c
index 0789a51c13..7b4ce3b7a6 100644
--- a/src/lib/libcrypto/x509/x509_vpm.c
+++ b/src/lib/libcrypto/x509/x509_vpm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vpm.c,v 1.57 2025/10/10 23:07:40 tb Exp $ */ 1/* $OpenBSD: x509_vpm.c,v 1.58 2025/10/24 11:33:38 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2004. 3 * project 2004.
4 */ 4 */
@@ -543,12 +543,12 @@ X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
543} 543}
544LCRYPTO_ALIAS(X509_VERIFY_PARAM_add1_host); 544LCRYPTO_ALIAS(X509_VERIFY_PARAM_add1_host);
545 545
546/* Public API in OpenSSL - nothing seems to use this. */
547unsigned int 546unsigned int
548X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param) 547X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param)
549{ 548{
550 return param->hostflags; 549 return param->hostflags;
551} 550}
551LCRYPTO_ALIAS(X509_VERIFY_PARAM_get_hostflags);
552 552
553void 553void
554X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags) 554X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags)