summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos <nmav@crystal.(none)>2007-12-15 16:41:12 +0200
committerNikos <nmav@crystal.(none)>2007-12-15 16:41:12 +0200
commit07233885bdb09113f62673e62968b5e492f61c74 (patch)
tree05a5c59188e46fbd09c6ff3d465c68861c74197b /lib
parent3a88ae123536f7e39f831a47884ae070ce162688 (diff)
downloadgnutls-07233885bdb09113f62673e62968b5e492f61c74.tar.gz
Fix for certificate selection in servers with certificate callbacks.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_state.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index c95f723d7a..4058dbcf9d 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -135,20 +135,23 @@ _gnutls_session_cert_type_supported (gnutls_session_t session,
if (cred == NULL)
return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE;
- for (i = 0; i < cred->ncerts; i++)
- {
- if (cred->cert_list[i][0].cert_type == cert_type)
- {
- cert_found = 1;
- break;
- }
- }
- if (cert_found == 0)
- /* no certificate is of that type.
- */
- return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE;
- }
-
+ if( cred->server_get_cert_callback == NULL)
+ {
+ for (i = 0; i < cred->ncerts; i++)
+ {
+ if (cred->cert_list[i][0].cert_type == cert_type)
+ {
+ cert_found = 1;
+ break;
+ }
+ }
+
+ if (cert_found == 0)
+ /* no certificate is of that type.
+ */
+ return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE;
+ }
+ }
if (session->internals.priorities.cert_type.algorithms == 0
&& cert_type == DEFAULT_CERT_TYPE)