diff options
Diffstat (limited to 'lib/state.c')
-rw-r--r-- | lib/state.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/lib/state.c b/lib/state.c index c9e8d20085..27c4adb3b8 100644 --- a/lib/state.c +++ b/lib/state.c @@ -59,16 +59,6 @@ _gnutls_rsa_pms_set_version(gnutls_session_t session, unsigned char major, unsigned char minor); void -_gnutls_session_cert_type_set(gnutls_session_t session, - gnutls_certificate_type_t ct) -{ - _gnutls_handshake_log - ("HSK[%p]: Selected certificate type %s (%d)\n", session, - gnutls_certificate_type_get_name(ct), ct); - session->security_parameters.cert_type = ct; -} - -void _gnutls_session_ecc_curve_set(gnutls_session_t session, gnutls_ecc_curve_t c) { @@ -179,57 +169,6 @@ gnutls_compression_get(gnutls_session_t session) return record_params->compression_algorithm; } -/* Check if the given certificate type is supported. - * This means that it is enabled by the priority functions, - * and a matching certificate exists. - */ -int -_gnutls_session_cert_type_supported(gnutls_session_t session, - gnutls_certificate_type_t cert_type) -{ - unsigned i; - unsigned cert_found = 0; - gnutls_certificate_credentials_t cred; - - if (session->security_parameters.entity == GNUTLS_SERVER) { - cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); - - if (cred == NULL) - return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE; - - if (cred->get_cert_callback == NULL && cred->get_cert_callback2 == NULL) { - for (i = 0; i < cred->ncerts; i++) { - if (cred->certs[i].cert_list[0].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) - return 0; - - for (i = 0; i < session->internals.priorities.cert_type.algorithms; - i++) { - if (session->internals.priorities.cert_type.priority[i] == - cert_type) { - return 0; /* ok */ - } - } - - return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE; -} - static void deinit_keys(gnutls_session_t session) { gnutls_pk_params_release(&session->key.ecdh_params); |