FelipeMdeO commented on code in PR #3532:
URL: https://github.com/apache/nuttx-apps/pull/3532#discussion_r3453698853
##########
netutils/dropbear/patch/0007-use-nuttx-unused-macro.patch:
##########
@@ -0,0 +1,267 @@
+--- a/src/chachapoly.c
++++ b/src/chachapoly.c
+@@ -43,11 +43,15 @@
+ const struct dropbear_cipher dropbear_chachapoly =
+ {&dummy, CHACHA20_KEY_LEN*2, CHACHA20_BLOCKSIZE};
+
+-static int dropbear_chachapoly_start(int UNUSED(cipher), const unsigned char*
UNUSED(IV),
++static int dropbear_chachapoly_start(int cipher, const unsigned char *IV,
+ const unsigned char *key, int keylen,
+- int UNUSED(num_rounds), dropbear_chachapoly_state
*state) {
++ int num_rounds, dropbear_chachapoly_state *state) {
+ int err;
+
++ UNUSED(cipher);
++ UNUSED(IV);
++ UNUSED(num_rounds);
++
+ TRACE2(("enter dropbear_chachapoly_start"))
+
+ if (keylen != CHACHA20_KEY_LEN*2) {
+--- a/src/common-algo.c
++++ b/src/common-algo.c
+@@ -40,16 +40,25 @@
+ * decide which ciphers/hashes/compression/signing to use during key
exchange*/
+
+ static int void_cipher(const unsigned char* in, unsigned char* out,
+- unsigned long len, void* UNUSED(cipher_state)) {
++ unsigned long len, void *cipher_state) {
++ UNUSED(cipher_state);
++
+ if (in != out) {
+ memmove(out, in, len);
+ }
+ return CRYPT_OK;
+ }
+
+-static int void_start(int UNUSED(cipher), const unsigned char* UNUSED(IV),
+- const unsigned char* UNUSED(key),
+- int UNUSED(keylen), int UNUSED(num_rounds), void*
UNUSED(cipher_state)) {
++static int void_start(int cipher, const unsigned char *IV,
++ const unsigned char *key,
++ int keylen, int num_rounds, void *cipher_state) {
++ UNUSED(cipher);
++ UNUSED(IV);
++ UNUSED(key);
++ UNUSED(keylen);
++ UNUSED(num_rounds);
++ UNUSED(cipher_state);
++
Review Comment:
Hello.
The void_start is implemented dropbear/src/common-algo.c:43. This is part of
dropbear source code.
In netutils/dropbear/Makefile:96 this file is added in the compilation.
If I try compile without change this function I am facing the following
build issue:
```
dropbear/src/common-algo.c:43:42: error: expected declaration specifiers or
'...' before numeric constant
43 | unsigned long len, void* UNUSED(cipher_state)) {
| ^~~~~~
dropbear/src/common-algo.c:50:27: error: expected declaration specifiers or
'...' before numeric constant
CC: dropbear/libtomcrypt/src/pk/dsa/dsa_make_key.c tatic int void_start(int
UNUSED(cipher), const unsigned char* UNUSED(IV),
| ^~~~~~
dropbear/src/common-algo.c:50:43: error: expected ';', ',' or ')' before
'const'
50 | static int void_start(int UNUSED(cipher), const unsigned char*
UNUSED(IV),
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]