]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
_tls13_{derive,expand}_secret2: fix array parameter mismatch
authorDaiki Ueno <ueno@gnu.org>
Tue, 11 May 2021 09:08:59 +0000 (11:08 +0200)
committerDaiki Ueno <ueno@gnu.org>
Tue, 11 May 2021 12:05:57 +0000 (14:05 +0200)
This suppresses the warning with -Warray-parameter
  secrets.c:85:40: warning: argument 6 of type 'const uint8_t[64]' {aka 'const unsigned char[64]'} with mismatched bound [-Warray-parameter=]
     85 |                          const uint8_t secret[MAX_HASH_SIZE],
        |                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
  In file included from secrets.c:28:
  secrets.h:43:41: note: previously declared as 'const uint8_t[32]' {aka 'const unsigned char[32]'}
     43 |                           const uint8_t secret[MAX_CIPHER_KEY_SIZE],
        |                           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/secrets.c
lib/secrets.h

index 7bd69bc7ef89b8c1a872da85f787d0ffa4e12e11..8ae6b552a1ba5478aa85e797568918004df7bb5a 100644 (file)
@@ -187,7 +187,7 @@ int _tls13_expand_secret2(const mac_entry_st *prf,
 int _tls13_expand_secret(gnutls_session_t session,
                const char *label, unsigned label_size,
                const uint8_t *msg, size_t msg_size,
-               const uint8_t secret[MAX_CIPHER_KEY_SIZE],
+               const uint8_t secret[MAX_HASH_SIZE],
                unsigned out_size,
                void *out)
 {
index 13220264a37353ae5b36d7c3801487dad620c4bd..181b53bed2f60fbbbb2d720b3923afa549691228 100644 (file)
@@ -40,7 +40,7 @@ int _tls13_derive_secret(gnutls_session_t session,
 int _tls13_derive_secret2(const mac_entry_st *prf,
                          const char *label, unsigned label_size,
                          const uint8_t *tbh, size_t tbh_size,
-                         const uint8_t secret[MAX_CIPHER_KEY_SIZE],
+                         const uint8_t secret[MAX_HASH_SIZE],
                          void *out);
 
 int _tls13_expand_secret(gnutls_session_t session,
@@ -52,7 +52,7 @@ int _tls13_expand_secret(gnutls_session_t session,
 int _tls13_expand_secret2(const mac_entry_st *prf,
                          const char *label, unsigned label_size,
                          const uint8_t *msg, size_t msg_size,
-                         const uint8_t secret[MAX_CIPHER_KEY_SIZE],
+                         const uint8_t secret[MAX_HASH_SIZE],
                          unsigned out_size, void *out);
 
 #endif /* GNUTLS_LIB_SECRETS_H */