Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-10]: src/external/bsd/fetch/dist/libfetch Pull up following revis...
details: https://anonhg.NetBSD.org/src/rev/88493ff69147
branches: netbsd-10
changeset: 373619:88493ff69147
user: martin <martin%NetBSD.org@localhost>
date: Wed Feb 22 13:24:05 2023 +0000
description:
Pull up following revision(s) (requested by mlelstv in ticket #95):
external/bsd/fetch/dist/libfetch/common.c: revision 1.3
external/bsd/fetch/dist/libfetch/common.c: revision 1.4
Use SNI.
Shut down SSL when closing connection.
diffstat:
external/bsd/fetch/dist/libfetch/common.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diffs (43 lines):
diff -r 3841cf5cb51e -r 88493ff69147 external/bsd/fetch/dist/libfetch/common.c
--- a/external/bsd/fetch/dist/libfetch/common.c Wed Feb 22 13:11:37 2023 +0000
+++ b/external/bsd/fetch/dist/libfetch/common.c Wed Feb 22 13:24:05 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.2 2011/06/25 20:27:01 christos Exp $ */
+/* $NetBSD: common.c,v 1.2.54.1 2023/02/22 13:24:05 martin Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -452,6 +452,10 @@
return (-1);
}
SSL_set_fd(conn->ssl, conn->sd);
+ if (!SSL_set_tlsext_host_name(conn->ssl, conn->cache_url->host)) {
+ fprintf(stderr, "SSL hostname setting failed\n");
+ return (-1);
+ }
if (SSL_connect(conn->ssl) == -1){
ERR_print_errors_fp(stderr);
return (-1);
@@ -709,6 +713,22 @@
{
int ret;
+#ifdef WITH_SSL
+ if (conn->ssl) {
+ SSL_shutdown(conn->ssl);
+ SSL_set_connect_state(conn->ssl);
+ SSL_free(conn->ssl);
+ conn->ssl = NULL;
+ }
+ if (conn->ssl_ctx) {
+ SSL_CTX_free(conn->ssl_ctx);
+ conn->ssl_ctx = NULL;
+ }
+ if (conn->ssl_cert) {
+ X509_free(conn->ssl_cert);
+ conn->ssl_cert = NULL;
+ }
+#endif
ret = close(conn->sd);
if (conn->cache_url)
fetchFreeURL(conn->cache_url);
Home |
Main Index |
Thread Index |
Old Index