All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluetooth: fix set_ecdh_privkey() prototype
@ 2021-03-22 16:46 Arnd Bergmann
  2021-03-22 17:12 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-03-22 16:46 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	David S. Miller, Jakub Kicinski
  Cc: Arnd Bergmann, linux-bluetooth, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

gcc-11 points out that the declaration does not match the definition:

net/bluetooth/ecdh_helper.c:122:55: error: argument 2 of type ‘const u8[32]’ {aka ‘const unsigned char[32]’} with mismatched bound [-Werror=array-parameter=]
  122 | int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32])
      |                                              ~~~~~~~~~^~~~~~~~~~~~~~~
In file included from net/bluetooth/ecdh_helper.c:23:
net/bluetooth/ecdh_helper.h:28:56: note: previously declared as ‘const u8 *’ {aka ‘const unsigned char *’}
   28 | int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key);
      |                                              ~~~~~~~~~~^~~~~~~~~~~

Change the declaration to contain the size of the array, rather than
just a pointer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/bluetooth/ecdh_helper.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/ecdh_helper.h b/net/bluetooth/ecdh_helper.h
index a6f8d03d4aaf..830723971cf8 100644
--- a/net/bluetooth/ecdh_helper.h
+++ b/net/bluetooth/ecdh_helper.h
@@ -25,6 +25,6 @@
 
 int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64],
 			u8 secret[32]);
-int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key);
+int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]);
 int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]);
 int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bluetooth: fix set_ecdh_privkey() prototype
  2021-03-22 16:46 [PATCH] bluetooth: fix set_ecdh_privkey() prototype Arnd Bergmann
@ 2021-03-22 17:12 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2021-03-22 17:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Johan Hedberg, Luiz Augusto von Dentz, David S. Miller,
	Jakub Kicinski, Arnd Bergmann, linux-bluetooth, netdev,
	linux-kernel

Hi Arnd,

> gcc-11 points out that the declaration does not match the definition:
> 
> net/bluetooth/ecdh_helper.c:122:55: error: argument 2 of type ‘const u8[32]’ {aka ‘const unsigned char[32]’} with mismatched bound [-Werror=array-parameter=]
>  122 | int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32])
>      |                                              ~~~~~~~~~^~~~~~~~~~~~~~~
> In file included from net/bluetooth/ecdh_helper.c:23:
> net/bluetooth/ecdh_helper.h:28:56: note: previously declared as ‘const u8 *’ {aka ‘const unsigned char *’}
>   28 | int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key);
>      |                                              ~~~~~~~~~~^~~~~~~~~~~
> 
> Change the declaration to contain the size of the array, rather than
> just a pointer.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> net/bluetooth/ecdh_helper.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-22 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 16:46 [PATCH] bluetooth: fix set_ecdh_privkey() prototype Arnd Bergmann
2021-03-22 17:12 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.