kill redundant free_certs argument to GnuTLS assign_privkey() function
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 7 May 2021 10:33:31 +0000 (11:33 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 7 May 2021 10:53:06 +0000 (11:53 +0100)
This was added in commit 04ccc265c ("Simplify extra_certs handling
w.r.t. assign_privkey()") because GnuTLS 2 didn't take a copy of the
certs which were assigned to the creds, and we needed to keep track of
which extra certs were used and which weren't.

The GnuTLS 3 variant of assign_privkey() didn't use it, since GnuTLS 3
takes a copy of the certs and we can just free them normally.

Now that we've dropped GnuTLS 2 support, we can drop this argument too
and simplify assign_privkey() a little bit.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
gnutls.c

index 0efd10912b0fbdc47f179bf13a3c5f2356a8288c..13e2c3c77bd12f4c54909161a05a461248afd385 100644 (file)
--- a/gnutls.c
+++ b/gnutls.c
@@ -610,8 +610,7 @@ static int get_cert_name(gnutls_x509_crt_t cert, char *name, size_t namelen)
 static int assign_privkey(struct openconnect_info *vpninfo,
                          gnutls_privkey_t pkey,
                          gnutls_x509_crt_t *certs,
-                         unsigned int nr_certs,
-                         uint8_t *free_certs)
+                         unsigned int nr_certs)
 {
        gnutls_pcert_st *pcerts = gnutls_calloc(nr_certs, sizeof(*pcerts));
        unsigned int i;
@@ -1776,8 +1775,7 @@ static int load_certificate(struct openconnect_info *vpninfo)
 #endif
                err = assign_privkey(vpninfo, pkey,
                                     supporting_certs,
-                                    nr_supporting_certs,
-                                    free_supporting_certs);
+                                    nr_supporting_certs);
                if (!err) {
                        pkey = NULL; /* we gave it away, and potentially also some
                                        of extra_certs[] may have been zeroed. */