summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-04-18 12:20:42 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-04-18 12:20:42 +0000
commite8fe22652741e726835d05d7088a1b4a9c8b4daf (patch)
treee2db26461fc5fcbb48eab8cb173f109eb62570a4
parente74dd04ae73bf3f61873aea3856d24b318149aa8 (diff)
downloadgnutls-e8fe22652741e726835d05d7088a1b4a9c8b4daf.tar.gz
Corrected bug in OpenPGP key loading using a callback.
-rw-r--r--NEWS3
-rw-r--r--configure.in2
-rw-r--r--includes/gnutls/openpgp.h1
-rw-r--r--lib/auth_cert.c15
4 files changed, 15 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index d5a4368242..61d5ae7a38 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Version 1.0.12
+- Corrected bug in OpenPGP key loading using a callback.
+
Version 1.0.11 (17/04/2004)
- Added gnutls_sign_algorithm_get_name() and gnutls_pk_algorithm_get_name()
- Corrected bug in TLS renegotiation.
diff --git a/configure.in b/configure.in
index e64e04ebfa..45425b440b 100644
--- a/configure.in
+++ b/configure.in
@@ -12,7 +12,7 @@ AC_DEFINE_UNQUOTED(T_OS, "$target_os", [OS name])
dnl Gnutls Version
GNUTLS_MAJOR_VERSION=1
GNUTLS_MINOR_VERSION=0
-GNUTLS_MICRO_VERSION=11
+GNUTLS_MICRO_VERSION=12
GNUTLS_VERSION=$GNUTLS_MAJOR_VERSION.$GNUTLS_MINOR_VERSION.$GNUTLS_MICRO_VERSION
AC_DEFINE_UNQUOTED(GNUTLS_VERSION, "$GNUTLS_VERSION", [version of gnutls])
diff --git a/includes/gnutls/openpgp.h b/includes/gnutls/openpgp.h
index 85d741841f..6960e1d957 100644
--- a/includes/gnutls/openpgp.h
+++ b/includes/gnutls/openpgp.h
@@ -31,6 +31,7 @@ extern "C" {
#endif
#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
/* gnutls_openpgp_key should be defined in gnutls.h
*/
diff --git a/lib/auth_cert.c b/lib/auth_cert.c
index 8b6392d125..fdaf59ff8c 100644
--- a/lib/auth_cert.c
+++ b/lib/auth_cert.c
@@ -1460,6 +1460,8 @@ static gnutls_cert *alloc_and_load_x509_certs(gnutls_x509_crt * certs,
gnutls_cert *local_certs;
int ret = 0;
uint i, j;
+
+ if (certs==NULL) return NULL;
local_certs = gnutls_malloc(sizeof(gnutls_cert) * ncerts);
if (local_certs == NULL) {
@@ -1494,6 +1496,8 @@ static gnutls_privkey *alloc_and_load_x509_key(gnutls_x509_privkey key)
gnutls_privkey *local_key;
int ret = 0;
+ if (key==NULL) return NULL;
+
local_key = gnutls_malloc(sizeof(gnutls_privkey));
if (local_key == NULL) {
gnutls_assert();
@@ -1521,7 +1525,8 @@ static gnutls_cert *alloc_and_load_pgp_certs(gnutls_openpgp_key cert)
{
gnutls_cert *local_certs;
int ret = 0;
- uint i, j;
+
+ if (cert==NULL) return NULL;
local_certs = gnutls_malloc(sizeof(gnutls_cert));
if (local_certs == NULL) {
@@ -1534,7 +1539,7 @@ static gnutls_cert *alloc_and_load_pgp_certs(gnutls_openpgp_key cert)
return NULL;
}
- ret = _E_gnutls_openpgp_key_to_gcert(&local_certs[i], cert);
+ ret = _E_gnutls_openpgp_key_to_gcert(local_certs, cert);
if (ret < 0) {
gnutls_assert();
return NULL;
@@ -1542,9 +1547,7 @@ static gnutls_cert *alloc_and_load_pgp_certs(gnutls_openpgp_key cert)
if (ret < 0) {
gnutls_assert();
- for (j = 0; j < i; j++) {
- _gnutls_gcert_deinit(&local_certs[j]);
- }
+ _gnutls_gcert_deinit(local_certs);
gnutls_free(local_certs);
return NULL;
}
@@ -1560,6 +1563,8 @@ static gnutls_privkey *alloc_and_load_pgp_key(const gnutls_openpgp_privkey key)
gnutls_privkey *local_key;
int ret = 0;
+ if (key==NULL) return NULL;
+
local_key = gnutls_malloc(sizeof(gnutls_privkey));
if (local_key == NULL) {
gnutls_assert();