summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-08-01 14:21:59 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-08-01 14:22:40 +0200
commit86c5afc50d7a88e197070851efe3524bffcef5aa (patch)
treec9d172433254104333d0557bee391c4d691bffbc
parent21f89efad7014a5ee0debd4cd3d59e27774b29e6 (diff)
downloadgnutls-86c5afc50d7a88e197070851efe3524bffcef5aa.tar.gz
copy_ciphersuites: use definition for reserved ciphersuites
-rw-r--r--lib/gnutls_handshake.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 94fd3cbe9e..5c2c64ba24 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -1841,7 +1841,7 @@ read_server_hello(gnutls_session_t session,
return ret;
}
-
+#define RESERVED_CIPHERSUITES 4
/* This function copies the appropriate ciphersuites to a locally allocated buffer
* Needed in client hello messages. Returns the new data length. If add_scsv is
* true, add the special safe renegotiation CS.
@@ -1851,13 +1851,13 @@ copy_ciphersuites(gnutls_session_t session,
gnutls_buffer_st * cdata, int add_scsv)
{
int ret;
- uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE + 4]; /* allow space for SCSV */
+ uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE + RESERVED_CIPHERSUITES]; /* allow space for SCSV */
int cipher_suites_size;
size_t init_length = cdata->length;
ret =
_gnutls_supported_ciphersuites(session, cipher_suites,
- sizeof(cipher_suites) - 2);
+ sizeof(cipher_suites) - RESERVED_CIPHERSUITES);
if (ret < 0)
return gnutls_assert_val(ret);