diff options
-rw-r--r-- | lib/auth_cert.c | 10 | ||||
-rw-r--r-- | lib/auth_dhe.c | 4 | ||||
-rw-r--r-- | lib/auth_rsa.c | 4 | ||||
-rw-r--r-- | lib/auth_rsa_export.c | 4 | ||||
-rw-r--r-- | lib/gnutls_buffers.c | 8 | ||||
-rw-r--r-- | lib/gnutls_cert.c | 2 | ||||
-rw-r--r-- | lib/gnutls_cipher_int.c | 4 | ||||
-rw-r--r-- | lib/gnutls_constate.c | 4 | ||||
-rw-r--r-- | lib/gnutls_errors.c | 1 | ||||
-rw-r--r-- | lib/gnutls_errors_int.h | 1 | ||||
-rw-r--r-- | lib/gnutls_handshake.c | 10 | ||||
-rw-r--r-- | lib/gnutls_pk.c | 14 | ||||
-rw-r--r-- | lib/gnutls_record.c | 4 | ||||
-rw-r--r-- | lib/gnutls_rsa_export.c | 12 | ||||
-rw-r--r-- | lib/gnutls_state.c | 20 | ||||
-rw-r--r-- | lib/gnutls_ui.c | 16 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 4 | ||||
-rw-r--r-- | lib/x509_verify.c | 4 | ||||
-rw-r--r-- | lib/x509_xml.c | 2 | ||||
-rw-r--r-- | libextra/auth_srp_passwd.c | 4 | ||||
-rw-r--r-- | libextra/gnutls_openpgp.c | 40 |
21 files changed, 85 insertions, 87 deletions
diff --git a/lib/auth_cert.c b/lib/auth_cert.c index 035399dca2..9b479c13af 100644 --- a/lib/auth_cert.c +++ b/lib/auth_cert.c @@ -641,7 +641,7 @@ int _gnutls_gen_cert_client_certificate(gnutls_session session, opaque ** data) default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } } @@ -654,7 +654,7 @@ int _gnutls_gen_cert_server_certificate(gnutls_session session, opaque ** data) return _gnutls_gen_x509_certificate(session, data); default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } } @@ -975,7 +975,7 @@ int _gnutls_proc_cert_server_certificate(gnutls_session session, opaque * data, data_size); default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } } @@ -1143,7 +1143,7 @@ int _gnutls_proc_cert_client_cert_vrfy(gnutls_session session, opaque * data, if (info == NULL || info->ncerts == 0) { gnutls_assert(); /* we need this in order to get peer's certificate */ - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } DECR_LEN(dsize, 2); @@ -1175,7 +1175,7 @@ int _gnutls_proc_cert_client_cert_vrfy(gnutls_session session, opaque * data, break; default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } if (ret < 0) { diff --git a/lib/auth_dhe.c b/lib/auth_dhe.c index 01a81275c3..795fdc04c7 100644 --- a/lib/auth_dhe.c +++ b/lib/auth_dhe.c @@ -193,7 +193,7 @@ static int proc_dhe_server_kx(gnutls_session session, opaque * data, if (info == NULL || info->ncerts==0) { gnutls_assert(); /* we need this in order to get peer's certificate */ - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } ret = _gnutls_proc_dh_common_server_kx( session, data, _data_size); @@ -239,7 +239,7 @@ static int proc_dhe_server_kx(gnutls_session session, opaque * data, default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } ret = diff --git a/lib/auth_rsa.c b/lib/auth_rsa.c index 86f3c8006d..703e25b83f 100644 --- a/lib/auth_rsa.c +++ b/lib/auth_rsa.c @@ -83,7 +83,7 @@ int i; if (info==NULL || info->ncerts==0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } switch( session->security_parameters.cert_type) { @@ -171,7 +171,7 @@ const gnutls_certificate_credentials cred; if ( (index=session->internals.selected_cert_index) < 0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } if ( _gnutls_cipher_suite_get_kx_algo(session->security_parameters.current_cipher_suite) diff --git a/lib/auth_rsa_export.c b/lib/auth_rsa_export.c index 64c551ba96..8604fce433 100644 --- a/lib/auth_rsa_export.c +++ b/lib/auth_rsa_export.c @@ -256,7 +256,7 @@ static int proc_rsa_export_server_kx(gnutls_session session, opaque * data, if (info == NULL || info->ncerts==0) { gnutls_assert(); /* we need this in order to get peer's certificate */ - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } @@ -343,7 +343,7 @@ static int proc_rsa_export_server_kx(gnutls_session session, opaque * data, default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } ret = diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c index d54321d8f9..3e9ad574fd 100644 --- a/lib/gnutls_buffers.c +++ b/lib/gnutls_buffers.c @@ -469,7 +469,7 @@ static int _gnutls_buffer_insert( gnutls_buffer * buffer, const opaque* _data, s if (data_size > buffer->length) { gnutls_assert(); /* this shouldn't have happened */ - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } if (_data==buffer->data) { /* then don't even memmove */ @@ -711,7 +711,7 @@ ssize_t _gnutls_handshake_io_send_int( gnutls_session session, ContentType type, } else if (session->internals.handshake_send_buffer.length > 0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } else { #ifdef WRITE_DEBUG size_t sum=0, x, j; @@ -740,7 +740,7 @@ ssize_t _gnutls_handshake_io_send_int( gnutls_session session, ContentType type, return 0; } else if (ptr==NULL) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } @@ -751,7 +751,7 @@ ssize_t _gnutls_handshake_io_send_int( gnutls_session session, ContentType type, if (ret <= 0) { if (ret==0) { gnutls_assert(); - ret = GNUTLS_E_UNKNOWN_ERROR; + ret = GNUTLS_E_INTERNAL_ERROR; } if ( left > 0 && (ret==GNUTLS_E_INTERRUPTED || ret==GNUTLS_E_AGAIN)) { diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c index b2ed6aff0f..9a46c61bee 100644 --- a/lib/gnutls_cert.c +++ b/lib/gnutls_cert.c @@ -356,7 +356,7 @@ int _gnutls_openpgp_cert_verify_peers(gnutls_session session) if (peer_certificate_list_size != 1) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } /* Verify certificate diff --git a/lib/gnutls_cipher_int.c b/lib/gnutls_cipher_int.c index 9ed8eeda4e..0620cabce2 100644 --- a/lib/gnutls_cipher_int.c +++ b/lib/gnutls_cipher_int.c @@ -93,7 +93,7 @@ int _gnutls_cipher_encrypt(GNUTLS_CIPHER_HANDLE handle, void* text, int textlen) #else if (gcry_cipher_encrypt( handle, text, textlen, NULL, textlen)!=0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } #endif } @@ -107,7 +107,7 @@ int _gnutls_cipher_decrypt(GNUTLS_CIPHER_HANDLE handle, void* ciphertext, int ci #else if (gcry_cipher_decrypt( handle, ciphertext, ciphertextlen, NULL, ciphertextlen)!=0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } #endif } diff --git a/lib/gnutls_constate.c b/lib/gnutls_constate.c index f55adbf5f6..c09def2b72 100644 --- a/lib/gnutls_constate.c +++ b/lib/gnutls_constate.c @@ -600,7 +600,7 @@ int _gnutls_read_connection_state_init(gnutls_session session) default: /* this check is useless */ gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } session->connection_state.read_compression_state = @@ -779,7 +779,7 @@ int _gnutls_write_connection_state_init(gnutls_session session) default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c index 72a0df0e92..c2e6078e6f 100644 --- a/lib/gnutls_errors.c +++ b/lib/gnutls_errors.c @@ -45,7 +45,6 @@ static gnutls_error_entry error_algorithms[] = { ERROR_ENTRY("The certificate and the given key do not match.", GNUTLS_E_CERTIFICATE_KEY_MISMATCH, 1 ), ERROR_ENTRY("Could not negotiate a supported compression method.", GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM, 1 ), ERROR_ENTRY("An unknown public key algorithm was encountered.", GNUTLS_E_UNKNOWN_PK_ALGORITHM, 1 ), - ERROR_ENTRY("Unspecified error.", GNUTLS_E_UNKNOWN_ERROR, 1 ), ERROR_ENTRY("An algorithm that is not enabled was negotiated.", GNUTLS_E_UNWANTED_ALGORITHM, 1 ), ERROR_ENTRY("A large TLS record packet was received.", GNUTLS_E_LARGE_PACKET, 1 ), diff --git a/lib/gnutls_errors_int.h b/lib/gnutls_errors_int.h index fd5ff86a44..dc65cddc16 100644 --- a/lib/gnutls_errors_int.h +++ b/lib/gnutls_errors_int.h @@ -4,7 +4,6 @@ #define GNUTLS_E_SUCCESS 0 #define GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM -3 -#define GNUTLS_E_UNKNOWN_ERROR -5 #define GNUTLS_E_UNKNOWN_CIPHER_TYPE -6 #define GNUTLS_E_LARGE_PACKET -7 #define GNUTLS_E_UNSUPPORTED_VERSION_PACKET -8 /* GNUTLS_A_PROTOCOL_VERSION */ diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index a560200f00..06bfb421b3 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -1012,7 +1012,7 @@ int _gnutls_recv_handshake(gnutls_session session, uint8 ** data, } - ret = GNUTLS_E_UNKNOWN_ERROR; + ret = GNUTLS_E_INTERNAL_ERROR; if (data != NULL && length32 > 0) *data = dataptr; @@ -1467,7 +1467,7 @@ static int _gnutls_send_client_hello(gnutls_session session, int again) if (hver <= 0) { if (hver == 0) - hver = GNUTLS_E_UNKNOWN_ERROR; + hver = GNUTLS_E_INTERNAL_ERROR; gnutls_assert(); return hver; } @@ -1533,7 +1533,7 @@ static int _gnutls_send_client_hello(gnutls_session session, int again) } else { if (extdatalen == 0) - extdatalen = GNUTLS_E_UNKNOWN_ERROR; + extdatalen = GNUTLS_E_INTERNAL_ERROR; gnutls_free(data); gnutls_assert(); return extdatalen; @@ -1558,7 +1558,7 @@ static int _gnutls_send_client_hello(gnutls_session session, int again) } else { if (extdatalen == 0) - extdatalen = GNUTLS_E_UNKNOWN_ERROR; + extdatalen = GNUTLS_E_INTERNAL_ERROR; gnutls_free(data); gnutls_assert(); return extdatalen; @@ -1783,7 +1783,7 @@ static int _gnutls_abort_handshake( gnutls_session session, int ret) { return 0; /* this doesn't matter */ - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c index 0df1b64a9d..4c0110a0cd 100644 --- a/lib/gnutls_pk.c +++ b/lib/gnutls_pk.c @@ -257,7 +257,7 @@ int _gnutls_pkcs1_rsa_decrypt(gnutls_sdatum * plaintext, break; default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } i++; @@ -532,7 +532,7 @@ static int _gnutls_pk_encrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN if (gcry_sexp_build(&s_data, NULL, "%m", data)) { gnutls_assert(); gcry_sexp_release(s_pkey); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } /* pass it to libgcrypt */ @@ -549,7 +549,7 @@ static int _gnutls_pk_encrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN if (list == NULL) { gnutls_assert(); gcry_sexp_release(s_ciph); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[0] = gcry_sexp_nth_mpi(list, 1, 0); @@ -588,14 +588,14 @@ static int _gnutls_pk_decrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN if (rc != 0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } /* put the data into a simple list */ if (gcry_sexp_build(&s_data, NULL, "(enc-val(rsa(a%m)))", data)) { gnutls_assert(); gcry_sexp_release(s_pkey); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } /* pass it to libgcrypt */ @@ -663,7 +663,7 @@ int _gnutls_pk_sign(int algo, GNUTLS_MPI* data, GNUTLS_MPI hash, GNUTLS_MPI * pk /* put the data into a simple list */ if (gcry_sexp_build(&s_hash, NULL, "%m", hash)) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } /* pass it to libgcrypt */ @@ -750,7 +750,7 @@ static int _gnutls_pk_verify(int algo, GNUTLS_MPI hash, GNUTLS_MPI* data, GNUTLS if (gcry_sexp_build(&s_hash, NULL, "%m", hash)) { gnutls_assert(); gcry_sexp_release(s_pkey); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } switch (algo) { diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index aa2d627573..cefcb0d896 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -417,7 +417,7 @@ ssize_t gnutls_send_int( gnutls_session session, ContentType type, HandshakeType if (ret > 0) { gnutls_assert(); - ret = GNUTLS_E_UNKNOWN_ERROR; + ret = GNUTLS_E_INTERNAL_ERROR; } _gnutls_session_unresumable( session); @@ -652,7 +652,7 @@ static int _gnutls_record_check_type( gnutls_session session, ContentType recv_t _gnutls_record_log( "REC: Received Unknown packet %d expecting %d\n", recv_type, type); gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } } diff --git a/lib/gnutls_rsa_export.c b/lib/gnutls_rsa_export.c index 0676181b99..5150c37465 100644 --- a/lib/gnutls_rsa_export.c +++ b/lib/gnutls_rsa_export.c @@ -86,7 +86,7 @@ int _gnutls_rsa_generate_params(GNUTLS_MPI* resarr, int bits) if (list == NULL) { gnutls_assert(); gcry_sexp_release( key); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[0] = gcry_sexp_nth_mpi(list, 1, 0); @@ -96,7 +96,7 @@ int _gnutls_rsa_generate_params(GNUTLS_MPI* resarr, int bits) if (list == NULL) { gnutls_assert(); gcry_sexp_release( key); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[1] = gcry_sexp_nth_mpi(list, 1, 0); @@ -106,7 +106,7 @@ int _gnutls_rsa_generate_params(GNUTLS_MPI* resarr, int bits) if (list == NULL) { gnutls_assert(); gcry_sexp_release( key); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[2] = gcry_sexp_nth_mpi(list, 1, 0); @@ -116,7 +116,7 @@ int _gnutls_rsa_generate_params(GNUTLS_MPI* resarr, int bits) if (list == NULL) { gnutls_assert(); gcry_sexp_release( key); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[3] = gcry_sexp_nth_mpi(list, 1, 0); @@ -127,7 +127,7 @@ int _gnutls_rsa_generate_params(GNUTLS_MPI* resarr, int bits) if (list == NULL) { gnutls_assert(); gcry_sexp_release( key); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[4] = gcry_sexp_nth_mpi(list, 1, 0); @@ -138,7 +138,7 @@ int _gnutls_rsa_generate_params(GNUTLS_MPI* resarr, int bits) if (list == NULL) { gnutls_assert(); gcry_sexp_release( key); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } resarr[5] = gcry_sexp_nth_mpi(list, 1, 0); diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index 628ec4ce52..e97b5af3eb 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -343,7 +343,7 @@ int _gnutls_dh_set_peer_public_bits( gnutls_session session, int bits) { ANON_SERVER_AUTH_INFO info; info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->dh_peer_public_bits = bits; break; } @@ -352,14 +352,14 @@ int _gnutls_dh_set_peer_public_bits( gnutls_session session, int bits) { info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->dh_peer_public_bits = bits; break; } default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } return 0; @@ -371,7 +371,7 @@ int _gnutls_dh_set_secret_bits( gnutls_session session, int bits) { ANON_SERVER_AUTH_INFO info; info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->dh_secret_bits = bits; break; } @@ -380,13 +380,13 @@ int _gnutls_dh_set_secret_bits( gnutls_session session, int bits) { info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->dh_secret_bits = bits; break; default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } } @@ -398,7 +398,7 @@ int _gnutls_rsa_export_set_modulus_bits( gnutls_session session, int bits) { info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->rsa_export_modulus_bits = bits; @@ -412,7 +412,7 @@ int _gnutls_dh_set_prime_bits( gnutls_session session, int bits) { ANON_SERVER_AUTH_INFO info; info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->dh_prime_bits = bits; break; } @@ -421,14 +421,14 @@ int _gnutls_dh_set_prime_bits( gnutls_session session, int bits) { info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; info->dh_prime_bits = bits; break; } default: gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } diff --git a/lib/gnutls_ui.c b/lib/gnutls_ui.c index b3437c5347..4d6d284111 100644 --- a/lib/gnutls_ui.c +++ b/lib/gnutls_ui.c @@ -66,7 +66,7 @@ int gnutls_dh_get_prime_bits(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->dh_prime_bits; } case GNUTLS_CRD_CERTIFICATE: { @@ -74,7 +74,7 @@ int gnutls_dh_get_prime_bits(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->dh_prime_bits; } @@ -101,7 +101,7 @@ int gnutls_dh_get_secret_bits(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->dh_secret_bits; } case GNUTLS_CRD_CERTIFICATE: { @@ -109,7 +109,7 @@ int gnutls_dh_get_secret_bits(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->dh_secret_bits; } @@ -135,7 +135,7 @@ CERTIFICATE_AUTH_INFO info; info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->rsa_export_modulus_bits; } @@ -157,7 +157,7 @@ int gnutls_dh_get_peers_public_bits(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->dh_peer_public_bits; } case GNUTLS_CRD_CERTIFICATE: { @@ -165,7 +165,7 @@ int gnutls_dh_get_peers_public_bits(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->dh_peer_public_bits; } @@ -255,7 +255,7 @@ int gnutls_certificate_client_get_request_status(gnutls_session session) info = _gnutls_get_auth_info(session); if (info == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; return info->certificate_requested; } diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 34dab84c1e..58c80fd4b0 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -137,7 +137,7 @@ ASN1_TYPE tmpasn; if ( _gnutls_x509_oid_data_printable( OID) == 0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } ANAME = _gnutls_x509_oid2string( OID); @@ -145,7 +145,7 @@ ASN1_TYPE tmpasn; if (ANAME==NULL) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } _gnutls_str_cpy(str, sizeof(str), "PKIX1."); diff --git a/lib/x509_verify.c b/lib/x509_verify.c index 6f7b688550..71f0772646 100644 --- a/lib/x509_verify.c +++ b/lib/x509_verify.c @@ -156,12 +156,12 @@ int compare_dn(gnutls_cert * cert, gnutls_cert * issuer_cert) */ if (len1 != len2) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } if (memcmp(&issuer_cert->raw.data[start2], &cert->raw.data[start1], len1) != 0) { gnutls_assert(); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } /* they match */ diff --git a/lib/x509_xml.c b/lib/x509_xml.c index 572e3e2580..e7e5343bfe 100644 --- a/lib/x509_xml.c +++ b/lib/x509_xml.c @@ -202,7 +202,7 @@ _gnutls_asn1_get_structure_xml(ASN1_TYPE structure, const char *name, root = _asn1_find_node(structure, name); if (root == NULL) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; ret = asn1_expand_any_defined_by( _gnutls_get_pkix(), &structure); diff --git a/libextra/auth_srp_passwd.c b/libextra/auth_srp_passwd.c index 98915a1b94..5b14e95b91 100644 --- a/libextra/auth_srp_passwd.c +++ b/libextra/auth_srp_passwd.c @@ -393,7 +393,7 @@ int _gnutls_srp_generate_prime(opaque ** ret_g, opaque ** ret_n, int bits) if (_gnutls_sbase64_encode(tmp, siz, ret_g) < 0) { gnutls_free(tmp); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } gnutls_free(tmp); } @@ -407,7 +407,7 @@ int _gnutls_srp_generate_prime(opaque ** ret_g, opaque ** ret_n, int bits) _gnutls_mpi_print( tmp, &siz, prime); if (_gnutls_sbase64_encode(tmp, siz, ret_n) < 0) { gnutls_free(tmp); - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; } gnutls_free(tmp); diff --git a/libextra/gnutls_openpgp.c b/libextra/gnutls_openpgp.c index b4004c8dec..39aa932b76 100644 --- a/libextra/gnutls_openpgp.c +++ b/libextra/gnutls_openpgp.c @@ -238,7 +238,7 @@ kbnode_to_datum( CDK_KBNODE kb_pk, gnutls_datum *raw ) pkt.pkt.public_key = p->pkt->pkt.public_key; rc = cdk_pkt_build( a, &pkt ); if ( rc ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto fail; } dat = cdk_iobuf_read_mem( a, 0 ); @@ -274,7 +274,7 @@ datum_to_kbnode( const gnutls_datum *raw, CDK_KBNODE *r_pkt ) cdk_iobuf_write( buf, raw->data, raw->size ); rc = cdk_keydb_get_keyblock( buf, &pkt, &dummy ); if ( rc && rc != CDKERR_EOF ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto fail; } else @@ -305,7 +305,7 @@ iobuf_to_datum( CDK_IOBUF buf, gnutls_datum *raw ) } } else - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; fail: cdk_free( a ); @@ -389,7 +389,7 @@ openpgp_sig_to_gnutls_cert( gnutls_cert *cert, cdkPKT_signature *sig ) } } else - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; fail: cdk_free( a ); @@ -426,12 +426,12 @@ _gnutls_openpgp_key2gnutls_key( gnutls_private_key *pkey, rc = cdk_keydb_get_keyblock( buf, &kb_sk, &eof ); if ( !kb_sk || rc ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } p = cdk_kbnode_find( kb_sk, PKT_SECRET_KEY ); if ( !p ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } sk = p->pkt->pkt.secret_key; @@ -501,7 +501,7 @@ _gnutls_openpgp_cert2gnutls_cert(gnutls_cert *cert, gnutls_datum raw) return rc; p = cdk_kbnode_find( kb_pk, PKT_PUBLIC_KEY ); if ( !p ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto fail; } pk = p->pkt->pkt.public_key; @@ -566,12 +566,12 @@ gnutls_openpgp_get_key(gnutls_datum *key, const gnutls_datum *keyring, rc = cdk_keydb_search( khd, &ks, &pk ); if ( rc ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } if ( !cdk_kbnode_find( pk, PKT_PUBLIC_KEY ) ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } @@ -757,7 +757,7 @@ gnutls_certificate_set_openpgp_key_file(gnutls_certificate_credentials res, if ( rc ) { cdk_kbnode_release( kb_pk ); gnutls_assert(); - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } cdk_kbnode_release( kb_pk ); @@ -841,7 +841,7 @@ gnutls_openpgp_extract_key_name( const gnutls_datum *cert, return GNUTLS_E_INVALID_PARAMETERS; if ( idx < 0 || idx > gnutls_openpgp_count_key_names( cert ) ) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; memset(dn, 0, sizeof *dn); rc = datum_to_kbnode( cert, &kb_pk ); @@ -858,7 +858,7 @@ gnutls_openpgp_extract_key_name( const gnutls_datum *cert, if ( pkt ) uid = pkt->pkt->pkt.user_id; if ( !uid ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } size = uid->len < OPENPGP_NAME_SIZE? uid->len : OPENPGP_NAME_SIZE-1; @@ -1027,13 +1027,13 @@ _gnutls_openpgp_get_key_trust(const char *trustdb, *r_success = 0; rc = datum_to_kbnode( key, &kb_pk ); if ( rc ) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; pkt = cdk_kbnode_find( kb_pk, PKT_PUBLIC_KEY ); if ( pkt ) pk = pkt->pkt->pkt.public_key; if ( !pk ) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; rc = cdk_iobuf_open( &buf, trustdb, IOBUF_MODE_RD ); if ( rc ) { @@ -1176,7 +1176,7 @@ gnutls_openpgp_fingerprint(const gnutls_datum *cert, char *fpr, size_t *fprlen) int rc = 0; if (!cert || !fpr || !fprlen) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; *fprlen = 0; rc = datum_to_kbnode( cert, &kb_pk ); @@ -1186,7 +1186,7 @@ gnutls_openpgp_fingerprint(const gnutls_datum *cert, char *fpr, size_t *fprlen) if ( pkt ) pk = pkt->pkt->pkt.public_key; if ( !pk ) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; *fprlen = 20; if ( is_RSA(pk->pubkey_algo) && pk->version < 4 ) @@ -1212,7 +1212,7 @@ gnutls_openpgp_extract_key_id( const gnutls_datum *cert, unsigned char keyid[8] int rc = 0; if (!cert || !keyid) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; rc = datum_to_kbnode( cert, &kb_pk ); if ( rc ) @@ -1222,7 +1222,7 @@ gnutls_openpgp_extract_key_id( const gnutls_datum *cert, unsigned char keyid[8] if ( pkt ) pk = pkt->pkt->pkt.public_key; if ( !pk ) - return GNUTLS_E_UNKNOWN_ERROR; + return GNUTLS_E_INTERNAL_ERROR; cdk_pk_get_keyid( pk, kid ); keyid[0] = kid[0] >> 24; keyid[1] = kid[0] >> 16; keyid[2] = kid[0] >> 8; keyid[3] = kid[0]; @@ -1364,7 +1364,7 @@ gnutls_certificate_set_openpgp_keyring_mem( gnutls_certificate_credentials c, cdk_free( a ); } else - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; cdk_iobuf_close( out ); return rc; @@ -1449,7 +1449,7 @@ gnutls_openpgp_recv_key(const char *host, short port, uint32 keyid, } if ( state != 2 ) { - rc = GNUTLS_E_UNKNOWN_ERROR; + rc = GNUTLS_E_INTERNAL_ERROR; goto leave; } memset( &afx, 0, sizeof afx ); |