Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/fetch/dist/libfetch Shut down SSL when closing ...



details:   https://anonhg.NetBSD.org/src/rev/8b3299e5a1f9
branches:  trunk
changeset: 373215:8b3299e5a1f9
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Tue Jan 24 08:02:57 2023 +0000

description:
Shut down SSL when closing connection.

diffstat:

 external/bsd/fetch/dist/libfetch/common.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 083426d14dae -r 8b3299e5a1f9 external/bsd/fetch/dist/libfetch/common.c
--- a/external/bsd/fetch/dist/libfetch/common.c Tue Jan 24 08:01:25 2023 +0000
+++ b/external/bsd/fetch/dist/libfetch/common.c Tue Jan 24 08:02:57 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.3 2023/01/24 08:01:25 mlelstv Exp $       */
+/*     $NetBSD: common.c,v 1.4 2023/01/24 08:02:57 mlelstv Exp $       */
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -713,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