From: Nikos Mavrogiannopoulos Date: Sat, 1 Aug 2015 12:21:59 +0000 (+0200) Subject: copy_ciphersuites: use definition for reserved ciphersuites X-Git-Tag: gnutls_3_5_0~766 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c71cda433187f0a3f4d63d943d4e775c2e32b3e;p=thirdparty%2Fgnutls.git copy_ciphersuites: use definition for reserved ciphersuites --- 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);