diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-09-01 10:55:52 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-09-01 10:55:52 +0000 |
commit | 2f0a0bc9f3146caea3483f34e356bfcffb381de4 (patch) | |
tree | a49cc53cd436930b5f1babfca6f3f2c29fb62266 /lib | |
parent | e8aed91e7d5eedc1b7da0664e0809f8360df1b2e (diff) | |
download | gnutls-2f0a0bc9f3146caea3483f34e356bfcffb381de4.tar.gz |
several clean ups
Diffstat (limited to 'lib')
-rw-r--r-- | lib/auth_anon.c | 4 | ||||
-rw-r--r-- | lib/auth_cert.c | 18 | ||||
-rw-r--r-- | lib/auth_dhe.c | 4 | ||||
-rw-r--r-- | lib/auth_rsa.c | 4 | ||||
-rw-r--r-- | lib/auth_rsa_export.c | 2 | ||||
-rw-r--r-- | lib/gnutls_cert.c | 2 | ||||
-rw-r--r-- | lib/gnutls_errors.c | 2 | ||||
-rw-r--r-- | lib/gnutls_errors_int.h | 8 | ||||
-rw-r--r-- | lib/gnutls_handshake.c | 8 | ||||
-rw-r--r-- | lib/gnutls_state.c | 6 | ||||
-rw-r--r-- | lib/gnutls_v2_compat.c | 2 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 2 |
12 files changed, 34 insertions, 28 deletions
diff --git a/lib/auth_anon.c b/lib/auth_anon.c index 0a32d20145..c66395261c 100644 --- a/lib/auth_anon.c +++ b/lib/auth_anon.c @@ -75,7 +75,7 @@ int gen_anon_server_kx( gnutls_session session, opaque** data) { cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_ANON, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } bits = _gnutls_dh_get_prime_bits( session); @@ -290,7 +290,7 @@ int proc_anon_client_kx( gnutls_session session, opaque* data, int data_size) { cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_ANON, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } bits = _gnutls_dh_get_prime_bits( session); diff --git a/lib/auth_cert.c b/lib/auth_cert.c index 2ab3f2e243..080708626f 100644 --- a/lib/auth_cert.c +++ b/lib/auth_cert.c @@ -290,7 +290,7 @@ static int _gnutls_find_acceptable_client_cert(gnutls_session session, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if (session->internals.client_cert_callback != NULL) { @@ -678,7 +678,7 @@ int _gnutls_proc_x509_server_certificate(gnutls_session session, opaque * data, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } @@ -812,7 +812,7 @@ int _gnutls_proc_openpgp_server_certificate(gnutls_session session, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if ((ret = @@ -1015,7 +1015,7 @@ int _gnutls_proc_cert_cert_req(gnutls_session session, opaque * data, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if ((ret = @@ -1211,7 +1211,7 @@ int _gnutls_gen_cert_server_cert_req(gnutls_session session, opaque ** data) NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } size = CERTTYPE_SIZE + 2; /* 2 for gnutls_certificate_type + 2 for size of rdn_seq @@ -1262,7 +1262,7 @@ int _gnutls_find_apr_cert(gnutls_session session, gnutls_cert ** apr_cert_list, *apr_cert_list = NULL; *apr_pkey = NULL; *apr_cert_list_length = 0; - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if (session->security_parameters.entity == GNUTLS_SERVER) { @@ -1272,7 +1272,7 @@ int _gnutls_find_apr_cert(gnutls_session session, gnutls_cert ** apr_cert_list, *apr_cert_list_length = 0; *apr_pkey = NULL; gnutls_assert(); /* this is not allowed */ - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } else { /* find_cert_list_index() has been called before. */ @@ -1283,7 +1283,7 @@ int _gnutls_find_apr_cert(gnutls_session session, gnutls_cert ** apr_cert_list, *apr_cert_list_length = 0; *apr_pkey = NULL; gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } else { *apr_cert_list = cred->cert_list[ind]; *apr_cert_list_length = @@ -1370,7 +1370,7 @@ int _gnutls_server_find_cert_list_index(gnutls_session session, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } index = -1; /* default is use no certificate */ diff --git a/lib/auth_dhe.c b/lib/auth_dhe.c index 8ae04509fd..26925b200b 100644 --- a/lib/auth_dhe.c +++ b/lib/auth_dhe.c @@ -102,7 +102,7 @@ static int gen_dhe_server_kx(gnutls_session session, opaque ** data) cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } bits = _gnutls_dh_get_prime_bits( session); @@ -444,7 +444,7 @@ static int proc_dhe_client_kx(gnutls_session session, opaque * data, cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } bits = _gnutls_dh_get_prime_bits( session); diff --git a/lib/auth_rsa.c b/lib/auth_rsa.c index e0677d1626..57c838c865 100644 --- a/lib/auth_rsa.c +++ b/lib/auth_rsa.c @@ -166,7 +166,7 @@ const GNUTLS_CERTIFICATE_CREDENTIALS cred; cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if ( (index=session->internals.selected_cert_index) < 0) { @@ -288,7 +288,7 @@ int _gnutls_gen_rsa_client_kx(gnutls_session session, opaque ** data) * function should have detected that. */ gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } RANDOMIZE_KEY(session->gnutls_key->key, gnutls_secure_malloc, GNUTLS_STRONG_RANDOM); diff --git a/lib/auth_rsa_export.c b/lib/auth_rsa_export.c index 67ab714652..f6cfbd134a 100644 --- a/lib/auth_rsa_export.c +++ b/lib/auth_rsa_export.c @@ -88,7 +88,7 @@ static int gen_rsa_export_server_kx(gnutls_session session, opaque ** data) cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } /* find the appropriate certificate */ diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c index 01cf5cdbbf..dcf730ff9c 100644 --- a/lib/gnutls_cert.c +++ b/lib/gnutls_cert.c @@ -335,7 +335,7 @@ int _gnutls_openpgp_cert_verify_peers(gnutls_session session) cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if (info->raw_certificate_list == NULL || info->ncerts == 0) { diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c index 01a49978f2..24151005e8 100644 --- a/lib/gnutls_errors.c +++ b/lib/gnutls_errors.c @@ -79,7 +79,7 @@ static gnutls_error_entry error_algorithms[] = { GNUTLS_ERROR_ENTRY( GNUTLS_E_COMPRESSION_FAILED, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_MEMORY_ERROR, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_UNIMPLEMENTED_FEATURE, 1), - GNUTLS_ERROR_ENTRY( GNUTLS_E_INSUFICIENT_CRED, 1), + GNUTLS_ERROR_ENTRY( GNUTLS_E_INSUFICIENT_CREDENTIALS, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_PWD_ERROR, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_PKCS1_WRONG_PAD, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_EXPIRED, 1), diff --git a/lib/gnutls_errors_int.h b/lib/gnutls_errors_int.h index f47bb4914f..c108669412 100644 --- a/lib/gnutls_errors_int.h +++ b/lib/gnutls_errors_int.h @@ -32,7 +32,9 @@ #define GNUTLS_E_EXPIRED -29 #define GNUTLS_E_DB_ERROR -30 #define GNUTLS_E_PWD_ERROR -31 -#define GNUTLS_E_INSUFICIENT_CRED -32 +#define GNUTLS_E_INSUFICIENT_CREDENTIALS -32 +#define GNUTLS_E_INSUFICIENT_CRED GNUTLS_E_INSUFICIENT_CREDENTIALS + #define GNUTLS_E_HASH_FAILED -33 #define GNUTLS_E_PARSING_ERROR -34 #define GNUTLS_E_MPI_PRINT_FAILED -35 @@ -85,6 +87,10 @@ #define GNUTLS_E_INIT_LIBEXTRA -82 #define GNUTLS_E_LIBRARY_VERSION_MISMATCH -82 #define GNUTLS_E_EXPORT_CIPHER_SUITE -83 + +/* returned if you need to generate temporary RSA + * parameters. These are needed for export cipher suites. + */ #define GNUTLS_E_NO_TEMPORARY_RSA_PARAMS -84 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -250 diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 122479546f..8c25b5da5e 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -552,7 +552,7 @@ int _gnutls_server_select_suite(gnutls_session session, opaque *data, int datale if (x<=0) { gnutls_assert(); if (x<0) return x; - else return GNUTLS_E_INSUFICIENT_CRED; + else return GNUTLS_E_INSUFICIENT_CREDENTIALS; } #ifdef HANDSHAKE_DEBUG @@ -601,7 +601,7 @@ int _gnutls_server_select_suite(gnutls_session session, opaque *data, int datale current_cipher_suite), &err) == NULL && err != 0) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } @@ -1109,7 +1109,7 @@ static int _gnutls_client_set_ciphersuite(gnutls_session session, current_cipher_suite), &err) == NULL && err != 0) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } @@ -1337,7 +1337,7 @@ static int _gnutls_copy_ciphersuites(gnutls_session session, */ if (ret == 0) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } cipher_num = ret; diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index 1c66e17a44..53950b4b1f 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -151,7 +151,7 @@ void _gnutls_handshake_internal_state_clear( gnutls_session session) { * This function initializes the current session to null. Every session * must be initialized before use, so internal structures can be allocated. * This function allocates structures which can only be free'd - * by calling gnutls_deinit(). Returns zero on success. + * by calling gnutls_session_deinit(). Returns zero on success. **/ int gnutls_session_init(gnutls_session * session, gnutls_connection_end con_end) { @@ -227,7 +227,7 @@ int _gnutls_session_is_resumable( gnutls_session session) * @session: is a &gnutls_session structure. * * This function clears all buffers associated with the &session. - * The difference with gnutls_deinit() is that this function will not + * The difference with gnutls_session_deinit() is that this function will not * interfere with the session database. * **/ @@ -319,7 +319,7 @@ void gnutls_session_deinit(gnutls_session session) gnutls_db_remove_session( session); } - _gnutls_deinit( session); + _gnutls_session_deinit( session); } diff --git a/lib/gnutls_v2_compat.c b/lib/gnutls_v2_compat.c index ac4576b1f4..c4fee27f9c 100644 --- a/lib/gnutls_v2_compat.c +++ b/lib/gnutls_v2_compat.c @@ -158,7 +158,7 @@ int _gnutls_read_client_hello_v2(gnutls_session session, opaque * data, */ if (_gnutls_get_kx_cred( session->gnutls_key, _gnutls_cipher_suite_get_kx_algo(session->security_parameters.current_cipher_suite), &err) == NULL && err != 0) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } /* set the MOD_AUTH_STRUCT to the appropriate struct diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 7484957899..137c893ed6 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -841,7 +841,7 @@ int _gnutls_x509_cert_verify_peers(gnutls_session session) cred = _gnutls_get_cred(session->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); - return GNUTLS_E_INSUFICIENT_CRED; + return GNUTLS_E_INSUFICIENT_CREDENTIALS; } if (info->raw_certificate_list == NULL || info->ncerts == 0) |