1From 0cade4573334571055127a2d4fe3641e2397948d Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Mon, 20 Mar 2023 21:59:19 -0700 4Subject: [PATCH] libgcrypt.c: Fix prototype of des3_encrypt/des3_decrypt 5 6This is to match the prototype for callback functions which are now emitted as 7errors by clang16 8 9Fixes 10 11TOPDIR/build/tmp/work/cortexa15t2hf-neon-yoe-linux-gnueabi/libssh/0.10.4-r0/git/src/libgcrypt.c:903:20: error: incompatible function pointer types initializing 'void (*)(struct ssh_cipher_struct *, void *, void *, size_t)' (aka 'void (*)(struct ssh_cipher_struct *, void *, void *, unsigned int)') with an expression of type 'void (struct ssh_cipher_struct *, void *, void *, unsigned long)' [-Wincompatible-function-pointer-types] 12 .encrypt = des3_encrypt, 13 ^~~~~~~~~~~~ 14TOPDIR/build/tmp/work/cortexa15t2hf-neon-yoe-linux-gnueabi/libssh/0.10.4-r0/git/src/libgcrypt.c:904:20: error: incompatible function pointer types initializing 'void (*)(struct ssh_cipher_struct *, void *, void *, size_t)' (aka 'void (*)(struct ssh_cipher_struct *, void *, void *, unsigned int)') with an expression of type 'void (struct ssh_cipher_struct *, void *, void *, unsigned long)' [-Wincompatible-function-pointer-types] 15 .decrypt = des3_decrypt 16 ^~~~~~~~~~~~ 17 18Upstream-Status: Pending 19 20Signed-off-by: Khem Raj <raj.khem@gmail.com> 21--- 22 src/libgcrypt.c | 4 ++-- 23 1 file changed, 2 insertions(+), 2 deletions(-) 24 25diff --git a/src/libgcrypt.c b/src/libgcrypt.c 26index da5588ad..e482b654 100644 27--- a/src/libgcrypt.c 28+++ b/src/libgcrypt.c 29@@ -469,12 +469,12 @@ static int des3_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) { 30 } 31 32 static void des3_encrypt(struct ssh_cipher_struct *cipher, void *in, 33- void *out, unsigned long len) { 34+ void *out, size_t len) { 35 gcry_cipher_encrypt(cipher->key[0], out, len, in, len); 36 } 37 38 static void des3_decrypt(struct ssh_cipher_struct *cipher, void *in, 39- void *out, unsigned long len) { 40+ void *out, size_t len) { 41 gcry_cipher_decrypt(cipher->key[0], out, len, in, len); 42 } 43 44-- 452.40.0 46 47