From: James Hilliard <james.hilliard1@gmail.com>
To: buildroot@buildroot.org
Cc: Pierre-Jean Texier <texier.pj2@gmail.com>,
James Hilliard <james.hilliard1@gmail.com>
Subject: [Buildroot] [PATCH 1/1] package/libarchive: fix mbedtls 3 compatibility
Date: Sat, 17 May 2025 16:24:12 -0600 [thread overview]
Message-ID: <20250517222412.4177167-1-james.hilliard1@gmail.com> (raw)
Backport a patch fixing mbedtls 3 compatibility.
This broke in buildroot when mbedtls was bumped to 3.6.3.1 in
3481a9643fc7223e400ed877f08ade34d44e6b78.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
...mbedtls-version-3-compatibility-2602.patch | 238 ++++++++++++++++++
1 file changed, 238 insertions(+)
create mode 100644 package/libarchive/0003-Fix-mbedtls-version-3-compatibility-2602.patch
diff --git a/package/libarchive/0003-Fix-mbedtls-version-3-compatibility-2602.patch b/package/libarchive/0003-Fix-mbedtls-version-3-compatibility-2602.patch
new file mode 100644
index 0000000000..67fb3ff738
--- /dev/null
+++ b/package/libarchive/0003-Fix-mbedtls-version-3-compatibility-2602.patch
@@ -0,0 +1,238 @@
+From 26ba5ee5d560d62ad05aa6819608fd21cbb962f9 Mon Sep 17 00:00:00 2001
+From: James Hilliard <james.hilliard1@gmail.com>
+Date: Thu, 15 May 2025 04:56:59 -0600
+Subject: [PATCH] Fix mbedtls version 3 compatibility (#2602)
+
+We need to use the new API for mbedtls 3 compatibility
+
+Fixes #2025
+
+Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
+Upstream: https://github.com/libarchive/libarchive/commit/63d7c24eeaa108ecc2ef258c0505eefdadaaaf35
+---
+ libarchive/archive_digest.c | 72 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+
+diff --git a/libarchive/archive_digest.c b/libarchive/archive_digest.c
+index 33518740..03f0edd6 100644
+--- a/libarchive/archive_digest.c
++++ b/libarchive/archive_digest.c
+@@ -235,7 +235,11 @@ static int
+ __archive_md5init(archive_md5_ctx *ctx)
+ {
+ mbedtls_md5_init(ctx);
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_md5_starts(ctx) == 0)
++#else
+ if (mbedtls_md5_starts_ret(ctx) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -245,7 +249,11 @@ static int
+ __archive_md5update(archive_md5_ctx *ctx, const void *indata,
+ size_t insize)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_md5_update(ctx, indata, insize) == 0)
++#else
+ if (mbedtls_md5_update_ret(ctx, indata, insize) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -254,7 +262,11 @@ __archive_md5update(archive_md5_ctx *ctx, const void *indata,
+ static int
+ __archive_md5final(archive_md5_ctx *ctx, void *md)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_md5_finish(ctx, md) == 0) {
++#else
+ if (mbedtls_md5_finish_ret(ctx, md) == 0) {
++#endif
+ mbedtls_md5_free(ctx);
+ return (ARCHIVE_OK);
+ } else {
+@@ -431,7 +443,11 @@ static int
+ __archive_ripemd160init(archive_rmd160_ctx *ctx)
+ {
+ mbedtls_ripemd160_init(ctx);
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_ripemd160_starts(ctx) == 0)
++#else
+ if (mbedtls_ripemd160_starts_ret(ctx) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -441,7 +457,11 @@ static int
+ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
+ size_t insize)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_ripemd160_update(ctx, indata, insize) == 0)
++#else
+ if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -450,7 +470,11 @@ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
+ static int
+ __archive_ripemd160final(archive_rmd160_ctx *ctx, void *md)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_ripemd160_finish(ctx, md) == 0) {
++#else
+ if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) {
++#endif
+ mbedtls_ripemd160_free(ctx);
+ return (ARCHIVE_OK);
+ } else {
+@@ -622,7 +646,11 @@ static int
+ __archive_sha1init(archive_sha1_ctx *ctx)
+ {
+ mbedtls_sha1_init(ctx);
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha1_starts(ctx) == 0)
++#else
+ if (mbedtls_sha1_starts_ret(ctx) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -632,7 +660,11 @@ static int
+ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata,
+ size_t insize)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha1_update(ctx, indata, insize) == 0)
++#else
+ if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -641,7 +673,11 @@ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata,
+ static int
+ __archive_sha1final(archive_sha1_ctx *ctx, void *md)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha1_finish(ctx, md) == 0) {
++#else
+ if (mbedtls_sha1_finish_ret(ctx, md) == 0) {
++#endif
+ mbedtls_sha1_free(ctx);
+ return (ARCHIVE_OK);
+ } else {
+@@ -890,7 +926,11 @@ static int
+ __archive_sha256init(archive_sha256_ctx *ctx)
+ {
+ mbedtls_sha256_init(ctx);
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha256_starts(ctx, 0) == 0)
++#else
+ if (mbedtls_sha256_starts_ret(ctx, 0) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -900,7 +940,11 @@ static int
+ __archive_sha256update(archive_sha256_ctx *ctx, const void *indata,
+ size_t insize)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha256_update(ctx, indata, insize) == 0)
++#else
+ if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -909,7 +953,11 @@ __archive_sha256update(archive_sha256_ctx *ctx, const void *indata,
+ static int
+ __archive_sha256final(archive_sha256_ctx *ctx, void *md)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha256_finish(ctx, md) == 0) {
++#else
+ if (mbedtls_sha256_finish_ret(ctx, md) == 0) {
++#endif
+ mbedtls_sha256_free(ctx);
+ return (ARCHIVE_OK);
+ } else {
+@@ -1130,7 +1178,11 @@ static int
+ __archive_sha384init(archive_sha384_ctx *ctx)
+ {
+ mbedtls_sha512_init(ctx);
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha512_starts(ctx, 1) == 0)
++#else
+ if (mbedtls_sha512_starts_ret(ctx, 1) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -1140,7 +1192,11 @@ static int
+ __archive_sha384update(archive_sha384_ctx *ctx, const void *indata,
+ size_t insize)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha512_update(ctx, indata, insize) == 0)
++#else
+ if (mbedtls_sha512_update_ret(ctx, indata, insize) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -1149,7 +1205,11 @@ __archive_sha384update(archive_sha384_ctx *ctx, const void *indata,
+ static int
+ __archive_sha384final(archive_sha384_ctx *ctx, void *md)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha512_finish(ctx, md) == 0) {
++#else
+ if (mbedtls_sha512_finish_ret(ctx, md) == 0) {
++#endif
+ mbedtls_sha512_free(ctx);
+ return (ARCHIVE_OK);
+ } else {
+@@ -1394,7 +1454,11 @@ static int
+ __archive_sha512init(archive_sha512_ctx *ctx)
+ {
+ mbedtls_sha512_init(ctx);
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha512_starts(ctx, 0) == 0)
++#else
+ if (mbedtls_sha512_starts_ret(ctx, 0) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -1404,7 +1468,11 @@ static int
+ __archive_sha512update(archive_sha512_ctx *ctx, const void *indata,
+ size_t insize)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha512_update(ctx, indata, insize) == 0)
++#else
+ if (mbedtls_sha512_update_ret(ctx, indata, insize) == 0)
++#endif
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+@@ -1413,7 +1481,11 @@ __archive_sha512update(archive_sha512_ctx *ctx, const void *indata,
+ static int
+ __archive_sha512final(archive_sha512_ctx *ctx, void *md)
+ {
++#if MBEDTLS_VERSION_NUMBER > 0x03000000
++ if (mbedtls_sha512_finish(ctx, md) == 0) {
++#else
+ if (mbedtls_sha512_finish_ret(ctx, md) == 0) {
++#endif
+ mbedtls_sha512_free(ctx);
+ return (ARCHIVE_OK);
+ } else {
+--
+2.34.1
+
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2025-05-17 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-17 22:24 James Hilliard [this message]
2025-05-18 6:45 ` [Buildroot] [PATCH 1/1] package/libarchive: fix mbedtls 3 compatibility Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250517222412.4177167-1-james.hilliard1@gmail.com \
--to=james.hilliard1@gmail.com \
--cc=buildroot@buildroot.org \
--cc=texier.pj2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.