summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-02-21 11:46:13 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-02-21 11:47:53 +0100
commit0043938de4c9f595291837816031a6fb339690ba (patch)
treee90b36a98831e4ff7150f11dfbd6e03ce82b650f
parentf07983498ecb3aab1acdd79bc913454cc7390706 (diff)
downloadgnutls-0043938de4c9f595291837816031a6fb339690ba.tar.gz
corrected check which prevented client to sent an unacceptable for the version ciphersuite
-rw-r--r--lib/algorithms/ciphersuites.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/algorithms/ciphersuites.c b/lib/algorithms/ciphersuites.c
index 75608e9925..2463c3c1a1 100644
--- a/lib/algorithms/ciphersuites.c
+++ b/lib/algorithms/ciphersuites.c
@@ -1282,17 +1282,18 @@ _gnutls_supported_ciphersuites(gnutls_session_t session,
if (ce == NULL)
continue;
- if (is_dtls == 0
- && !(version->id >= ce->min_version))
- continue;
- else if (is_dtls != 0
- && !(version->id >=
- ce->min_dtls_version))
-
- if (k + 2 > max_cipher_suite_size)
- return
- gnutls_assert_val
- (GNUTLS_E_INTERNAL_ERROR);
+ if (is_dtls) {
+ if (version->id < ce->min_dtls_version)
+ continue;
+ } else {
+ if (version->id < ce->min_version)
+ continue;
+ }
+
+ if (k + 2 > max_cipher_suite_size)
+ return
+ gnutls_assert_val
+ (GNUTLS_E_INTERNAL_ERROR);
memcpy(&cipher_suites[k], ce->id, 2);
k += 2;