summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-04-23 06:24:00 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-04-23 06:24:00 +0000
commitc33e6256c1a29feaa677b84d4b534d3e874846e8 (patch)
tree0d224dc9ff6ec30f6e348910226f2148e489cc32 /lib
parent64b09d9513c8b6d208b09aaa68eae1e4afa131d1 (diff)
downloadgnutls-c33e6256c1a29feaa677b84d4b534d3e874846e8.tar.gz
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r--lib/auth_cert.c5
-rw-r--r--lib/gnutls_cert.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/auth_cert.c b/lib/auth_cert.c
index c31eea5b82..8d00996651 100644
--- a/lib/auth_cert.c
+++ b/lib/auth_cert.c
@@ -399,6 +399,9 @@ const gnutls_certificate_credentials cred;
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (st.ncerts == 0)
+ return 0; /* no certificate was selected */
+
if (type != st.type) {
gnutls_assert();
ret = GNUTLS_E_INVALID_REQUEST;
@@ -411,7 +414,7 @@ const gnutls_certificate_credentials cred;
local_key = alloc_and_load_x509_key(st.key.x509);
} else { /* PGP */
- if (st.ncerts != 1) {
+ if (st.ncerts > 1) {
gnutls_assert();
ret = GNUTLS_E_INVALID_REQUEST;
goto cleanup;
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index 3c78a21056..45d9081c66 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -329,7 +329,8 @@ void gnutls_certificate_server_set_request(gnutls_session session,
* handshake, after the certificate request message has been received.
*
* The callback function should set the certificate list to be sent, and
- * return 0 on success. The value (-1) indicates error and the handshake
+ * return 0 on success. If no certificate was select then the number of certificates
+ * should be set to zero. The value (-1) indicates error and the handshake
* will be terminated.
**/
void gnutls_certificate_client_set_retrieve_function(gnutls_certificate_credentials cred,