From 7466c311124bed390fcac2a37c903829617c05c5 Mon Sep 17 00:00:00 2001 From: liyuan Date: Fri, 22 Dec 2023 06:44:54 +0800 Subject: [PATCH] Fixed settings_len variable type conversion issue --- ...s_len-variable-type-conversion-issue.patch | 26 +++++++++++++++++++ mokutil.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0002-Fixed-settings_len-variable-type-conversion-issue.patch diff --git a/0002-Fixed-settings_len-variable-type-conversion-issue.patch b/0002-Fixed-settings_len-variable-type-conversion-issue.patch new file mode 100644 index 0000000..f3b8a01 --- /dev/null +++ b/0002-Fixed-settings_len-variable-type-conversion-issue.patch @@ -0,0 +1,26 @@ +From 21dec7383d2f328af3d3aa401e3c90123dfcf9b7 Mon Sep 17 00:00:00 2001 +From: liyuanyuan +Date: Fri, 29 Dec 2023 16:56:16 +0800 +Subject: [PATCH] Fixed settings_len variable type conversion issue + +--- + src/mokutil.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/mokutil.c b/src/mokutil.c +index 87f0793..88d61c8 100644 +--- a/src/mokutil.c ++++ b/src/mokutil.c +@@ -787,7 +787,8 @@ generate_hash (pw_crypt_t *pw_crypt, char *password, unsigned int pw_len) + char *next; + char *crypt_string; + const char *prefix; +- int hash_len, settings_len = sizeof (settings) - 2; ++ int hash_len = sizeof (settings) - 2; ++ size_t settings_len = sizeof (settings) - 2; + + if (!password || !pw_crypt || password[pw_len] != '\0') + return -1; +-- +2.33.0 + diff --git a/mokutil.spec b/mokutil.spec index ac6ffe2..aaacaec 100644 --- a/mokutil.spec +++ b/mokutil.spec @@ -1,6 +1,6 @@ Name: mokutil Version: 0.4.0 -Release: 2 +Release: 3 Epoch: 1 Summary: Tools for manipulating machine owner keys License: GPLv3+ @@ -8,6 +8,7 @@ URL: https://github.com/lcp/mokutil Source0: https://github.com/lcp/mokutil/archive/%{version}.tar.gz Patch0001: 0001-Fix-32-bit-build.patch +Patch0002: 0002-Fixed-settings_len-variable-type-conversion-issue.patch BuildRequires:gcc autoconf automake gnu-efi git openssl-devel openssl efivar-devel >= 31-1 git Conflicts: shim < 0.8-1 @@ -59,6 +60,9 @@ make check %{_mandir}/man1/* %changelog +* Fri Dec 29 2023 liyuanyuan - 1:0.4.0-3 +- Fixed settings_len variable type conversion issue + * Fri Dec 29 2023 liyuanyuan - 1:0.4.0-2 - Fix 32 bit build -- Gitee