diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-05-10 11:25:32 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-05-10 11:25:32 +0200 |
commit | 101d1c013d5affe34c5b51e1459f6fb695eaa8d8 (patch) | |
tree | f85a69a2ad6f998b9da98657fa5b02cc76d11afd | |
parent | 10aacc9b66b807e94e2cd1589fb3d443b1c9ff16 (diff) | |
download | gnutls-101d1c013d5affe34c5b51e1459f6fb695eaa8d8.tar.gz |
removed legacy code.
-rw-r--r-- | lib/auth/anon.c | 4 | ||||
-rw-r--r-- | lib/auth/anon_ecdh.c | 4 | ||||
-rw-r--r-- | lib/auth/cert.c | 17 | ||||
-rw-r--r-- | lib/auth/dhe.c | 4 | ||||
-rw-r--r-- | lib/auth/dhe_psk.c | 10 | ||||
-rw-r--r-- | lib/auth/ecdhe.c | 4 | ||||
-rw-r--r-- | lib/auth/psk.c | 8 | ||||
-rw-r--r-- | lib/auth/psk_passwd.c | 2 | ||||
-rw-r--r-- | lib/auth/rsa_psk.c | 4 | ||||
-rw-r--r-- | lib/auth/srp.c | 4 | ||||
-rw-r--r-- | lib/auth/srp_passwd.c | 2 | ||||
-rw-r--r-- | lib/auth/srp_rsa.c | 2 | ||||
-rw-r--r-- | lib/ext/srp.c | 2 | ||||
-rw-r--r-- | lib/ext/status_request.c | 2 | ||||
-rw-r--r-- | lib/gnutls_auth.c | 21 | ||||
-rw-r--r-- | lib/gnutls_auth.h | 4 | ||||
-rw-r--r-- | lib/gnutls_cert.c | 2 | ||||
-rw-r--r-- | lib/gnutls_handshake.c | 29 | ||||
-rw-r--r-- | lib/gnutls_state.c | 3 | ||||
-rw-r--r-- | lib/gnutls_ui.c | 2 | ||||
-rw-r--r-- | lib/gnutls_v2_compat.c | 4 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 2 |
22 files changed, 58 insertions, 78 deletions
diff --git a/lib/auth/anon.c b/lib/auth/anon.c index f8b9f0ecb5..f72c712e3c 100644 --- a/lib/auth/anon.c +++ b/lib/auth/anon.c @@ -69,7 +69,7 @@ gen_anon_server_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_anon_server_credentials_t cred; cred = (gnutls_anon_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_ANON, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_ANON); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -121,7 +121,7 @@ proc_anon_client_kx(gnutls_session_t session, uint8_t * data, const bigint_t *mpis; cred = (gnutls_anon_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_ANON, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_ANON); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/anon_ecdh.c b/lib/auth/anon_ecdh.c index 7fc99e59b6..e171da84b5 100644 --- a/lib/auth/anon_ecdh.c +++ b/lib/auth/anon_ecdh.c @@ -67,7 +67,7 @@ gen_anon_ecdh_server_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_anon_server_credentials_t cred; cred = (gnutls_anon_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_ANON, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_ANON); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -99,7 +99,7 @@ proc_anon_ecdh_client_kx(gnutls_session_t session, uint8_t * data, gnutls_anon_server_credentials_t cred; cred = (gnutls_anon_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_ANON, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_ANON); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/cert.c b/lib/auth/cert.c index 38debd052d..28d640a58c 100644 --- a/lib/auth/cert.c +++ b/lib/auth/cert.c @@ -449,7 +449,7 @@ call_get_cert_callback(gnutls_session_t session, unsigned int pcert_length = 0; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -649,7 +649,7 @@ select_client_cert(gnutls_session_t session, gnutls_datum_t *issuers_dn = NULL; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -1028,7 +1028,7 @@ _gnutls_proc_x509_server_crt(gnutls_session_t session, gnutls_datum_t tmp; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -1169,7 +1169,7 @@ _gnutls_proc_openpgp_server_crt(gnutls_session_t session, uint8_t subkey_id[GNUTLS_OPENPGP_KEYID_SIZE]; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -1359,8 +1359,7 @@ int _gnutls_proc_crt(gnutls_session_t session, uint8_t * data, size_t data_size) cred = (gnutls_certificate_credentials_t) _gnutls_get_cred(session, - GNUTLS_CRD_CERTIFICATE, - NULL); + GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -1418,7 +1417,7 @@ _gnutls_proc_cert_cert_req(gnutls_session_t session, uint8_t * data, return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR); cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -1657,7 +1656,7 @@ _gnutls_gen_cert_server_cert_req(gnutls_session_t session, */ cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -2002,7 +2001,7 @@ _gnutls_server_select_cert(gnutls_session_t session, char server_name[MAX_CN]; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/dhe.c b/lib/auth/dhe.c index 6b96f5cad5..d68817d6ee 100644 --- a/lib/auth/dhe.c +++ b/lib/auth/dhe.c @@ -91,7 +91,7 @@ gen_dhe_server_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_dh_params_t dh_params; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -165,7 +165,7 @@ proc_dhe_client_kx(gnutls_session_t session, uint8_t * data, gnutls_dh_params_t dh_params; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/dhe_psk.c b/lib/auth/dhe_psk.c index 839c22419a..3755a99559 100644 --- a/lib/auth/dhe_psk.c +++ b/lib/auth/dhe_psk.c @@ -101,7 +101,7 @@ gen_ecdhe_psk_client_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_datum_t username, key; cred = (gnutls_psk_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) return @@ -145,7 +145,7 @@ gen_dhe_psk_client_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_datum_t username, key; cred = (gnutls_psk_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) return @@ -191,7 +191,7 @@ gen_dhe_psk_server_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_psk_server_credentials_t cred; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -275,7 +275,7 @@ proc_dhe_psk_client_kx(gnutls_session_t session, uint8_t * data, ssize_t data_size = _data_size; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); @@ -353,7 +353,7 @@ proc_ecdhe_psk_client_kx(gnutls_session_t session, uint8_t * data, ssize_t data_size = _data_size; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); diff --git a/lib/auth/ecdhe.c b/lib/auth/ecdhe.c index ad6c6c2e99..4afd3079d3 100644 --- a/lib/auth/ecdhe.c +++ b/lib/auth/ecdhe.c @@ -178,7 +178,7 @@ proc_ecdhe_client_kx(gnutls_session_t session, gnutls_certificate_credentials_t cred; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; @@ -372,7 +372,7 @@ gen_ecdhe_server_kx(gnutls_session_t session, gnutls_buffer_st * data) gnutls_certificate_credentials_t cred; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/psk.c b/lib/auth/psk.c index 303e001607..8b223923a6 100644 --- a/lib/auth/psk.c +++ b/lib/auth/psk.c @@ -166,7 +166,7 @@ _gnutls_gen_psk_client_kx(gnutls_session_t session, gnutls_psk_client_credentials_t cred; cred = (gnutls_psk_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); @@ -213,7 +213,7 @@ _gnutls_proc_psk_client_kx(gnutls_session_t session, uint8_t * data, psk_auth_info_t info; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); @@ -290,7 +290,7 @@ _gnutls_gen_psk_server_kx(gnutls_session_t session, gnutls_datum_t hint; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); @@ -324,7 +324,7 @@ _gnutls_proc_psk_server_kx(gnutls_session_t session, uint8_t * data, psk_auth_info_t info; cred = (gnutls_psk_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); diff --git a/lib/auth/psk_passwd.c b/lib/auth/psk_passwd.c index 5c10997ba9..f378770bd7 100644 --- a/lib/auth/psk_passwd.c +++ b/lib/auth/psk_passwd.c @@ -125,7 +125,7 @@ _gnutls_psk_pwd_find_entry(gnutls_session_t session, char *username, int ret; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/rsa_psk.c b/lib/auth/rsa_psk.c index 296d719796..a1f460711c 100644 --- a/lib/auth/rsa_psk.c +++ b/lib/auth/rsa_psk.c @@ -194,7 +194,7 @@ _gnutls_gen_rsa_psk_client_kx(gnutls_session_t session, gnutls_pk_params_release(¶ms); cred = (gnutls_psk_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); @@ -271,7 +271,7 @@ _gnutls_proc_rsa_psk_client_kx(gnutls_session_t session, uint8_t * data, gnutls_datum_t premaster_secret = { NULL, 0 }; cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_PSK, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_PSK); if (cred == NULL) { gnutls_assert(); diff --git a/lib/auth/srp.c b/lib/auth/srp.c index df1c4525e2..8b31383341 100644 --- a/lib/auth/srp.c +++ b/lib/auth/srp.c @@ -260,7 +260,7 @@ _gnutls_gen_srp_client_kx(gnutls_session_t session, priv = epriv.ptr; cred = (gnutls_srp_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_SRP, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_SRP); if (cred == NULL) { gnutls_assert(); @@ -847,7 +847,7 @@ _gnutls_proc_srp_server_kx(gnutls_session_t session, uint8_t * data, priv = epriv.ptr; cred = (gnutls_srp_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_SRP, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_SRP); if (cred == NULL) { gnutls_assert(); diff --git a/lib/auth/srp_passwd.c b/lib/auth/srp_passwd.c index cde48e63e4..980076845f 100644 --- a/lib/auth/srp_passwd.c +++ b/lib/auth/srp_passwd.c @@ -260,7 +260,7 @@ _gnutls_srp_pwd_read_entry(gnutls_session_t state, char *username, entry = *_entry; cred = (gnutls_srp_server_credentials_t) - _gnutls_get_cred(state, GNUTLS_CRD_SRP, NULL); + _gnutls_get_cred(state, GNUTLS_CRD_SRP); if (cred == NULL) { gnutls_assert(); ret = GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/auth/srp_rsa.c b/lib/auth/srp_rsa.c index b92552546d..c4a24e09de 100644 --- a/lib/auth/srp_rsa.c +++ b/lib/auth/srp_rsa.c @@ -101,7 +101,7 @@ gen_srp_cert_server_kx(gnutls_session_t session, gnutls_buffer_st * data) ddata.size = data->length; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/ext/srp.c b/lib/ext/srp.c index 45f702a613..7b09cc8e83 100644 --- a/lib/ext/srp.c +++ b/lib/ext/srp.c @@ -123,7 +123,7 @@ _gnutls_srp_send_params(gnutls_session_t session, if (session->security_parameters.entity == GNUTLS_CLIENT) { gnutls_srp_client_credentials_t cred = (gnutls_srp_client_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_SRP, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_SRP); if (cred == NULL) return 0; diff --git a/lib/ext/status_request.c b/lib/ext/status_request.c index 6e13eff73b..421997db42 100644 --- a/lib/ext/status_request.c +++ b/lib/ext/status_request.c @@ -210,7 +210,7 @@ server_send(gnutls_session_t session, gnutls_certificate_credentials_t cred; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) /* no certificate authentication */ return gnutls_assert_val(0); diff --git a/lib/gnutls_auth.c b/lib/gnutls_auth.c index 7b232a536b..7486a1e04c 100644 --- a/lib/gnutls_auth.c +++ b/lib/gnutls_auth.c @@ -168,7 +168,7 @@ gnutls_credentials_get(gnutls_session_t session, { const void *_cred; - _cred = _gnutls_get_cred(session, type, NULL); + _cred = _gnutls_get_cred(session, type); if (_cred == NULL) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); @@ -253,21 +253,18 @@ gnutls_auth_client_get_type(gnutls_session_t session) * free that!!! */ const void *_gnutls_get_kx_cred(gnutls_session_t session, - gnutls_kx_algorithm_t algo, int *err) + gnutls_kx_algorithm_t algo) { int server = session->security_parameters.entity == GNUTLS_SERVER ? 1 : 0; return _gnutls_get_cred(session, - _gnutls_map_kx_get_cred(algo, server), - err); + _gnutls_map_kx_get_cred(algo, server)); } const void *_gnutls_get_cred(gnutls_session_t session, - gnutls_credentials_type_t type, int *err) + gnutls_credentials_type_t type) { - const void *retval = NULL; - int _err = -1; auth_cred_st *ccred; gnutls_key_st *key = &session->key; @@ -279,15 +276,9 @@ const void *_gnutls_get_cred(gnutls_session_t session, ccred = ccred->next; } if (ccred == NULL) - goto out; + return NULL; - _err = 0; - retval = ccred->credentials; - - out: - if (err != NULL) - *err = _err; - return retval; + return ccred->credentials; } /*- diff --git a/lib/gnutls_auth.h b/lib/gnutls_auth.h index d25c61b4ad..6e843a82dc 100644 --- a/lib/gnutls_auth.h +++ b/lib/gnutls_auth.h @@ -54,9 +54,9 @@ typedef struct mod_auth_st_int { } mod_auth_st; const void *_gnutls_get_cred(gnutls_session_t session, - gnutls_credentials_type_t kx, int *err); + gnutls_credentials_type_t kx); const void *_gnutls_get_kx_cred(gnutls_session_t session, - gnutls_kx_algorithm_t algo, int *err); + gnutls_kx_algorithm_t algo); int _gnutls_auth_info_set(gnutls_session_t session, gnutls_credentials_type_t type, int size, int allow_change); diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c index 11817a473b..9ed0609acb 100644 --- a/lib/gnutls_cert.c +++ b/lib/gnutls_cert.c @@ -584,7 +584,7 @@ _gnutls_openpgp_crt_verify_peers(gnutls_session_t session, return GNUTLS_E_INVALID_REQUEST; cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index c94e589964..d985948548 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -889,7 +889,7 @@ _gnutls_server_select_suite(gnutls_session_t session, uint8_t * data, unsigned int i, j, cipher_suites_size; size_t pk_algos_size; uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE]; - int retval, err; + int retval; gnutls_pk_algorithm_t pk_algos[MAX_ALGOS]; /* will hold the pk algorithms * supported by the peer. */ @@ -1036,8 +1036,7 @@ _gnutls_server_select_suite(gnutls_session_t session, uint8_t * data, if (_gnutls_get_kx_cred (session, _gnutls_cipher_suite_get_kx_algo(session->security_parameters. - cipher_suite), &err) == NULL - && err != 0) { + cipher_suite)) == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; } @@ -1519,7 +1518,7 @@ _gnutls_client_set_ciphersuite(gnutls_session_t session, uint8_t suite[2]) uint8_t z; uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE]; int cipher_suite_size; - int i, err; + int i; z = 1; cipher_suite_size = @@ -1564,8 +1563,7 @@ _gnutls_client_set_ciphersuite(gnutls_session_t session, uint8_t suite[2]) _gnutls_get_kx_cred (session, _gnutls_cipher_suite_get_kx_algo - (session->security_parameters.cipher_suite), &err) == NULL - && err != 0) { + (session->security_parameters.cipher_suite)) == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; } @@ -2604,8 +2602,7 @@ static int run_verify_callback(gnutls_session_t session, unsigned int side) cred = (gnutls_certificate_credentials_t) _gnutls_get_cred(session, - GNUTLS_CRD_CERTIFICATE, - NULL); + GNUTLS_CRD_CERTIFICATE); if (side == GNUTLS_CLIENT) type = gnutls_auth_server_get_type(session); @@ -3255,8 +3252,7 @@ check_server_params(gnutls_session_t session, int delete; gnutls_certificate_credentials_t x509_cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, - cred_type, NULL); + _gnutls_get_cred(session, cred_type); if (x509_cred != NULL) { dh_params = @@ -3283,8 +3279,7 @@ check_server_params(gnutls_session_t session, } else if (cred_type == GNUTLS_CRD_ANON) { gnutls_anon_server_credentials_t anon_cred = (gnutls_anon_server_credentials_t) - _gnutls_get_cred(session, - cred_type, NULL); + _gnutls_get_cred(session, cred_type); if (anon_cred != NULL) { dh_params = @@ -3297,8 +3292,7 @@ check_server_params(gnutls_session_t session, } else if (cred_type == GNUTLS_CRD_PSK) { gnutls_psk_server_credentials_t psk_cred = (gnutls_psk_server_credentials_t) - _gnutls_get_cred(session, - cred_type, NULL); + _gnutls_get_cred(session, cred_type); if (psk_cred != NULL) { dh_params = @@ -3355,8 +3349,7 @@ _gnutls_remove_unwanted_ciphersuites(gnutls_session_t session, */ cert_cred = (gnutls_certificate_credentials_t) _gnutls_get_cred(session, - GNUTLS_CRD_CERTIFICATE, - NULL); + GNUTLS_CRD_CERTIFICATE); /* If there are certificate credentials, find an appropriate certificate * or disable them; @@ -3399,7 +3392,7 @@ _gnutls_remove_unwanted_ciphersuites(gnutls_session_t session, /* if it is defined but had no credentials */ if (!session->internals.premaster_set && - _gnutls_get_kx_cred(session, kx, NULL) == NULL) { + _gnutls_get_kx_cred(session, kx) == NULL) { delete = 1; } else { delete = 0; @@ -3426,7 +3419,7 @@ _gnutls_remove_unwanted_ciphersuites(gnutls_session_t session, SRP credential too. */ if (kx == GNUTLS_KX_SRP_RSA || kx == GNUTLS_KX_SRP_DSS) { if (!_gnutls_get_cred - (session, GNUTLS_CRD_SRP, NULL)) { + (session, GNUTLS_CRD_SRP)) { delete = 1; } } diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index 1429a0dabc..69c76e1b56 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -184,8 +184,7 @@ _gnutls_session_cert_type_supported(gnutls_session_t session, if (session->security_parameters.entity == GNUTLS_SERVER) { cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, - NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE; diff --git a/lib/gnutls_ui.c b/lib/gnutls_ui.c index 3c22d1467f..1e99c646da 100644 --- a/lib/gnutls_ui.c +++ b/lib/gnutls_ui.c @@ -457,7 +457,7 @@ const gnutls_datum_t *gnutls_certificate_get_ours(gnutls_session_t session) CHECK_AUTH(GNUTLS_CRD_CERTIFICATE, NULL); cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL || cred->certs == NULL) { gnutls_assert(); return NULL; diff --git a/lib/gnutls_v2_compat.c b/lib/gnutls_v2_compat.c index bed7d7d5a7..e68cce3d05 100644 --- a/lib/gnutls_v2_compat.c +++ b/lib/gnutls_v2_compat.c @@ -96,7 +96,6 @@ _gnutls_read_client_hello_v2(gnutls_session_t session, uint8_t * data, gnutls_protocol_t adv_version; uint8_t rnd[GNUTLS_RANDOM_SIZE]; int len = datalen; - int err; uint16_t challenge; uint8_t session_id[TLS_MAX_SESSION_ID_SIZE]; @@ -169,8 +168,7 @@ _gnutls_read_client_hello_v2(gnutls_session_t session, uint8_t * data, if (_gnutls_get_kx_cred (session, _gnutls_cipher_suite_get_kx_algo(session->security_parameters. - cipher_suite), &err) == NULL - && err != 0) { + cipher_suite)) == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; } diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index ef126ba4ac..6649a35628 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -207,7 +207,7 @@ _gnutls_x509_cert_verify_peers(gnutls_session_t session, } cred = (gnutls_certificate_credentials_t) - _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE, NULL); + _gnutls_get_cred(session, GNUTLS_CRD_CERTIFICATE); if (cred == NULL) { gnutls_assert(); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; |