From 180cfd079906d2e995fccaac5d6a1a57d65b42aa Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 10 May 2021 13:16:48 +0200 Subject: [PATCH] ed25519: Harmonize arguments to make new gcc happy This started failing CI on Fedora with new GCC /builds/jjelen/libssh-mirror/src/external/ed25519.c:80:48: error: argument 1 of type 'unsigned char *' declared as a pointer [-Werror=array-parameter=] 80 | int crypto_sign_ed25519_keypair(unsigned char *pk, | ~~~~~~~~~~~~~~~^~ In file included from /builds/jjelen/libssh-mirror/src/external/ed25519.c:15: /builds/jjelen/libssh-mirror/include/libssh/ed25519.h:46:48: note: previously declared as an array 'uint8_t[32]' {aka 'unsigned char[32]'} 46 | int crypto_sign_ed25519_keypair(ed25519_pubkey pk, ed25519_privkey sk); | ~~~~~~~~~~~~~~~^~ /builds/jjelen/libssh-mirror/src/external/ed25519.c:81:48: error: argument 2 of type 'unsigned char *' declared as a pointer [-Werror=array-parameter=] 81 | unsigned char *sk) | ~~~~~~~~~~~~~~~^~ In file included from /builds/jjelen/libssh-mirror/src/external/ed25519.c:15: /builds/jjelen/libssh-mirror/include/libssh/ed25519.h:46:68: note: previously declared as an array 'uint8_t[64]' {aka 'unsigned char[64]'} 46 | int crypto_sign_ed25519_keypair(ed25519_pubkey pk, ed25519_privkey sk); | ~~~~~~~~~~~~~~~~^~ /builds/jjelen/libssh-mirror/src/external/ed25519.c:117:46: error: argument 5 of type 'const unsigned char *' declared as a pointer [-Werror=array-parameter=] 117 | const unsigned char *sk) | ~~~~~~~~~~~~~~~~~~~~~^~ In file included from /builds/jjelen/libssh-mirror/src/external/ed25519.c:15: /builds/jjelen/libssh-mirror/include/libssh/ed25519.h:61:27: note: previously declared as an array 'const uint8_t[64]' {aka 'const unsigned char[64]'} 61 | const ed25519_privkey sk); | ~~~~~~~~~~~~~~~~~~~~~~^~ /builds/jjelen/libssh-mirror/src/external/ed25519.c:180:51: error: argument 5 of type 'const unsigned char *' declared as a pointer [-Werror=array-parameter=] 180 | const unsigned char *pk) | ~~~~~~~~~~~~~~~~~~~~~^~ In file included from /builds/jjelen/libssh-mirror/src/external/ed25519.c:15: /builds/jjelen/libssh-mirror/include/libssh/ed25519.h:76:26: note: previously declared as an array 'const uint8_t[32]' {aka 'const unsigned char[32]'} 76 | const ed25519_pubkey pk); | ~~~~~~~~~~~~~~~~~~~~~^~ Signed-off-by: Jakub Jelen Reviewed-by: Sahana Prasad (cherry picked from commit 9e0d76fb67baa3811808ae54bc9bc4ee58a8ed31) --- src/external/ed25519.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/external/ed25519.c b/src/external/ed25519.c index 8cd58591..41b5f289 100644 --- a/src/external/ed25519.c +++ b/src/external/ed25519.c @@ -77,8 +77,8 @@ static void get_hram(unsigned char *hram, } -int crypto_sign_ed25519_keypair(unsigned char *pk, - unsigned char *sk) +int crypto_sign_ed25519_keypair(ed25519_pubkey pk, + ed25519_privkey sk) { sc25519 scsk; ge25519 gepk; @@ -114,7 +114,7 @@ int crypto_sign_ed25519(unsigned char *sm, uint64_t *smlen, const unsigned char *m, uint64_t mlen, - const unsigned char *sk) + const ed25519_privkey sk) { sc25519 sck, scs, scsk; ge25519 ger; @@ -177,7 +177,7 @@ int crypto_sign_ed25519_open(unsigned char *m, uint64_t *mlen, const unsigned char *sm, uint64_t smlen, - const unsigned char *pk) + const ed25519_pubkey pk) { unsigned int i; int ret;