diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-05-07 21:49:16 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-05-07 21:50:03 +0200 |
commit | f03c7a038c0f44cf51c3464c6f50df7b44638928 (patch) | |
tree | 89b3a2abb6bdc5d55a459db7d9c7e5817b43b135 /lib | |
parent | f92ef316d3529ac3c38e697b1e41b572e1d922f3 (diff) | |
download | gnutls-f03c7a038c0f44cf51c3464c6f50df7b44638928.tar.gz |
handshake: use GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER consistently
Also treat GNUTLS_E_ILLEGAL_PARAMETER as a synonym if returned during
a connection.
Relates #442
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/alert.c | 1 | ||||
-rw-r--r-- | lib/dh.c | 4 | ||||
-rw-r--r-- | lib/handshake.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/alert.c b/lib/alert.c index 182e97f21b..0aedf3d26e 100644 --- a/lib/alert.c +++ b/lib/alert.c @@ -216,6 +216,7 @@ int gnutls_error_to_alert(int err, int *level) ret = GNUTLS_A_DECOMPRESSION_FAILURE; _level = GNUTLS_AL_FATAL; break; + case GNUTLS_E_ILLEGAL_PARAMETER: case GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER: case GNUTLS_E_ILLEGAL_SRP_USERNAME: case GNUTLS_E_PK_INVALID_PUBKEY: @@ -501,7 +501,7 @@ gnutls_dh_params_import_pkcs3(gnutls_dh_params_t params, if (_gnutls_mpi_cmp_ui(params->params[0], 0) == 0) { asn1_delete_structure(&c2); - return gnutls_assert_val(GNUTLS_E_ILLEGAL_PARAMETER); + return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER); } /* read the generator @@ -517,7 +517,7 @@ gnutls_dh_params_import_pkcs3(gnutls_dh_params_t params, if (_gnutls_mpi_cmp_ui(params->params[1], 0) == 0) { asn1_delete_structure(&c2); _gnutls_mpi_release(¶ms->params[0]); - return gnutls_assert_val(GNUTLS_E_ILLEGAL_PARAMETER); + return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER); } asn1_delete_structure(&c2); diff --git a/lib/handshake.c b/lib/handshake.c index 18c0974ca4..e756574277 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -1717,7 +1717,7 @@ read_server_hello(gnutls_session_t session, if (len < session_id_len || session_id_len > GNUTLS_MAX_SESSION_ID_SIZE) { gnutls_assert(); - return GNUTLS_E_ILLEGAL_PARAMETER; + return GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER; } DECR_LEN(len, session_id_len); session_id = &data[pos]; |