diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-02-21 11:46:13 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-02-21 11:48:29 +0100 |
commit | 35c8bfa2e506781c52cdc947c3553b85ec886534 (patch) | |
tree | 4491a388ab15b88c6a03f90db08337a7fc4a1b52 | |
parent | a53a9017a2cb6662908b4b16d35abf9827798af0 (diff) | |
download | gnutls_3_2_x.tar.gz |
corrected check which prevented client to sent an unacceptable for the version ciphersuitegnutls_3_2_x
-rw-r--r-- | lib/algorithms/ciphersuites.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/algorithms/ciphersuites.c b/lib/algorithms/ciphersuites.c index 8433b97f53..583bcc56b6 100644 --- a/lib/algorithms/ciphersuites.c +++ b/lib/algorithms/ciphersuites.c @@ -1310,17 +1310,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; |