* [Buildroot] [PATCH 1/1] package/libssh2: fix build with mbedtls
@ 2023-07-04 17:09 Bernd Kuhls
2023-07-06 8:31 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2023-07-04 17:09 UTC (permalink / raw)
To: buildroot
Fixes:
http://autobuild.buildroot.net/results/3f2/3f295deaee31266f394035924ec0192edcca4b1e/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
...more-size_t-to-sync-up-with-crypto-h.patch | 106 ++++++++++++++++++
1 file changed, 106 insertions(+)
create mode 100644 package/libssh2/0001-mbedtls-use-more-size_t-to-sync-up-with-crypto-h.patch
diff --git a/package/libssh2/0001-mbedtls-use-more-size_t-to-sync-up-with-crypto-h.patch b/package/libssh2/0001-mbedtls-use-more-size_t-to-sync-up-with-crypto-h.patch
new file mode 100644
index 0000000000..3cac133864
--- /dev/null
+++ b/package/libssh2/0001-mbedtls-use-more-size_t-to-sync-up-with-crypto-h.patch
@@ -0,0 +1,106 @@
+From 1153ebdeba563ac657b525edd6bf6da68b1fe5e2 Mon Sep 17 00:00:00 2001
+From: Viktor Szakats <commit@vsz.me>
+Date: Tue, 30 May 2023 17:28:03 +0000
+Subject: [PATCH] mbedtls: use more `size_t` to sync up with `crypto.h`
+
+Ref: 5a96f494ee0b00282afb2db2e091246fc5e1774a #846 #879
+
+Fixes #1053
+Closes #1054
+
+Upstream: https://github.com/libssh2/libssh2/commit/1153ebdeba563ac657b525edd6bf6da68b1fe5e2
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/mbedtls.c | 14 ++++++++------
+ src/mbedtls.h | 13 ++++++-------
+ 2 files changed, 14 insertions(+), 13 deletions(-)
+
+diff --git a/src/mbedtls.c b/src/mbedtls.c
+index e387cdb19..cd14a4bd8 100644
+--- a/src/mbedtls.c
++++ b/src/mbedtls.c
+@@ -186,7 +186,7 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx)
+ int
+ _libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
+ mbedtls_md_type_t mdtype,
+- const unsigned char *key, unsigned long keylen)
++ const unsigned char *key, size_t keylen)
+ {
+ const mbedtls_md_info_t *md_info;
+ int ret, hmac;
+@@ -221,7 +221,7 @@ _libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash)
+ }
+
+ int
+-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
++_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
+ mbedtls_md_type_t mdtype, unsigned char *hash)
+ {
+ const mbedtls_md_info_t *md_info;
+@@ -497,8 +497,9 @@ int
+ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
+ size_t hash_len,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m, unsigned long m_len)
++ size_t sig_len,
++ const unsigned char *m,
++ size_t m_len)
+ {
+ int ret;
+ int md_type;
+@@ -548,8 +549,9 @@ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
+ int
+ _libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx * rsactx,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m, unsigned long m_len)
++ size_t sig_len,
++ const unsigned char *m,
++ size_t m_len)
+ {
+ return _libssh2_mbedtls_rsa_sha2_verify(rsactx, SHA_DIGEST_LENGTH,
+ sig, sig_len, m, m_len);
+diff --git a/src/mbedtls.h b/src/mbedtls.h
+index d9592f721..03484da17 100644
+--- a/src/mbedtls.h
++++ b/src/mbedtls.h
+@@ -478,12 +478,12 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx);
+ int
+ _libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
+ mbedtls_md_type_t mdtype,
+- const unsigned char *key, unsigned long keylen);
++ const unsigned char *key, size_t keylen);
+
+ int
+ _libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash);
+ int
+-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
++_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
+ mbedtls_md_type_t mdtype, unsigned char *hash);
+
+ _libssh2_bn *
+@@ -526,9 +526,8 @@ _libssh2_mbedtls_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa,
+ int
+ _libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m,
+- unsigned long m_len);
++ size_t sig_len,
++ const unsigned char *m, size_t m_len);
+ int
+ _libssh2_mbedtls_rsa_sha1_sign(LIBSSH2_SESSION *session,
+ libssh2_rsa_ctx *rsa,
+@@ -540,8 +539,8 @@ int
+ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
+ size_t hash_len,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m, unsigned long m_len);
++ size_t sig_len,
++ const unsigned char *m, size_t m_len);
+ int
+ _libssh2_mbedtls_rsa_sha2_sign(LIBSSH2_SESSION *session,
+ libssh2_rsa_ctx *rsa,
--
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/libssh2: fix build with mbedtls
2023-07-04 17:09 [Buildroot] [PATCH 1/1] package/libssh2: fix build with mbedtls Bernd Kuhls
@ 2023-07-06 8:31 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2023-07-06 8:31 UTC (permalink / raw)
To: Bernd Kuhls; +Cc: buildroot
>>>>> "Bernd" == Bernd Kuhls <bernd@kuhls.net> writes:
> Fixes:
> http://autobuild.buildroot.net/results/3f2/3f295deaee31266f394035924ec0192edcca4b1e/
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Committed, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-06 8:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-04 17:09 [Buildroot] [PATCH 1/1] package/libssh2: fix build with mbedtls Bernd Kuhls
2023-07-06 8:31 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox