remaining changes from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744214
- remove unused variable in assign_privkey() to prevent compiler warning with
-Wall
- amend some failure messages which could otherwise be misleading
- initial bug was already fixed in commit
#43e514b4f53c147936a7379e8e6fc67f78cae2fb
Signed-off-by: Thomas Uhle <thomas.u...@mailbox.tu-dresden.de>
---
David, if you like, you are free to merge these changes upstream.
Regards,
Thomas Uhle
--- openconnect-5.03/gnutls.c~ 2014-02-03 14:11:19 +0100
+++ openconnect-5.03/gnutls.c 2014-04-12 18:14:56 +0200
@@ -501,8 +501,6 @@ static int assign_privkey(struct opencon
unsigned int nr_certs,
uint8_t *free_certs)
{
- int i;
-
vpninfo->my_certs = gnutls_calloc(nr_certs, sizeof(*certs));
if (!vpninfo->my_certs)
return GNUTLS_E_MEMORY_ERROR;
@@ -1004,6 +1002,8 @@ static int load_certificate(struct openc
cert = supporting_certs[0];
free_supporting_certs = gnutls_malloc(nr_supporting_certs);
if (!free_supporting_certs) {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Failed to allocate memory for supporting certificates\n"));
ret = -ENOMEM;
goto out;
}
@@ -1437,7 +1437,7 @@ static int load_certificate(struct openc
supporting_certs = gnutls_malloc(sizeof(*supporting_certs));
if (!supporting_certs) {
vpn_progress(vpninfo, PRG_ERR,
- _("Failed to allocate memory for certificate\n"));
+ _("Failed to allocate memory for supporting certificates\n"));
ret = -ENOMEM;
goto out;
}
@@ -1447,7 +1447,7 @@ static int load_certificate(struct openc
free_supporting_certs = gnutls_malloc(1);
if (!free_supporting_certs) {
vpn_progress(vpninfo, PRG_ERR,
- _("Failed to allocate memory for certificate\n"));
+ _("Failed to allocate memory for supporting certificates\n"));
ret = -ENOMEM;
goto out;
}
@@ -1514,9 +1514,9 @@ static int load_certificate(struct openc
gnutls_free(t.data);
}
#endif
+
if (err)
break;
-
}
if (gnutls_x509_crt_check_issuer(issuer, issuer)) {