aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libssh/libssh/0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch
blob: d2d1fb5955d46838d7f00f43351486e842784638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 49a8ae4d6f77434ed9f7a601b9df488b921e4a22 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 20 Mar 2023 21:59:19 -0700
Subject: [PATCH] libgcrypt.c: Fix prototype of des3_encrypt/des3_decrypt

This is to match the prototype for callback functions which are now emitted as
errors by clang16

Fixes

TOPDIR/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]
    .encrypt     = des3_encrypt,
                   ^~~~~~~~~~~~
TOPDIR/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]
    .decrypt     = des3_decrypt
                   ^~~~~~~~~~~~

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 src/libgcrypt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libgcrypt.c b/src/libgcrypt.c
index f410d997..e3f66781 100644
--- a/src/libgcrypt.c
+++ b/src/libgcrypt.c
@@ -416,12 +416,12 @@ static int des3_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) {
 }
 
 static void des3_encrypt(struct ssh_cipher_struct *cipher, void *in,
-    void *out, unsigned long len) {
+    void *out, size_t len) {
   gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
 }
 
 static void des3_decrypt(struct ssh_cipher_struct *cipher, void *in,
-    void *out, unsigned long len) {
+    void *out, size_t len) {
   gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
 }