From: David Woodhouse Date: Fri, 7 May 2021 10:33:31 +0000 (+0100) Subject: kill redundant free_certs argument to GnuTLS assign_privkey() function X-Git-Tag: v8.20~216 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=36166b09bd361d1929edcf972c22eb690dad1ebb;p=users%2Fdwmw2%2Fopenconnect.git kill redundant free_certs argument to GnuTLS assign_privkey() function 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 --- diff --git a/gnutls.c b/gnutls.c index 0efd1091..13e2c3c7 100644 --- 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. */