openwrt/package/system/apk/patches/010-libressl4.patch
Rosen Penev 8e5db148e9
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
apk: update to 3.0.0-rc8
Added compatibility patch for LibreSSL 4.0.

Refreshed other patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20851
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-21 23:35:33 +01:00

32 lines
922 B
Diff

From aa71510f843d5cce5f75b6abfa3a70caeacbe36d Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Thu, 20 Nov 2025 18:26:52 -0800
Subject: [PATCH] fix usage under LibreSSL > 3
crypto needs to be initialized as the context relies on it.
Fixes crash in EVP_DigestInit_ex being called with a NULL digest.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
src/apk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/apk.c
+++ b/src/apk.c
@@ -571,6 +571,7 @@ int main(int argc, char **argv)
apk_argv[argc] = NULL;
apk_argv[argc+1] = NULL;
+ apk_crypto_init();
apk_ctx_init(&ctx);
umask(0);
setup_terminal();
@@ -583,7 +584,6 @@ int main(int argc, char **argv)
if (applet->parse) applet->parse(applet_ctx, &ctx, APK_OPTIONS_INIT, NULL);
}
- apk_crypto_init();
apk_io_url_init(&ctx.out);
apk_io_url_set_timeout(60);
apk_io_url_set_redirect_callback(redirect_callback);