diff options
author | Nikos <nmav@crystal.(none)> | 2007-12-15 16:41:12 +0200 |
---|---|---|
committer | Nikos <nmav@crystal.(none)> | 2007-12-15 16:41:12 +0200 |
commit | 07233885bdb09113f62673e62968b5e492f61c74 (patch) | |
tree | 05a5c59188e46fbd09c6ff3d465c68861c74197b /lib | |
parent | 3a88ae123536f7e39f831a47884ae070ce162688 (diff) | |
download | gnutls-07233885bdb09113f62673e62968b5e492f61c74.tar.gz |
Fix for certificate selection in servers with certificate callbacks.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gnutls_state.c | 31 |
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) |