summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSimone Weiß <simone.p.weiss@posteo.com>2024-07-20 20:59:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-21 11:08:11 +0100
commitc64e1b0dc542be730ef3c9e61f686bf33f8a83e3 (patch)
tree50e871de5a57aa007cc22f26901efee8a0dfa085 /meta
parent83e68a5f47dbcf88e2e3c92411079b97e7099621 (diff)
downloadpoky-c64e1b0dc542be730ef3c9e61f686bf33f8a83e3.tar.gz
gnutls: upgrade 3.8.5 -> 3.8.6
Changelog: ** libgnutls: PBMAC1 is now supported as a MAC mechanism for PKCS#12 To be compliant with FIPS 140-3, PKCS#12 files with MAC based on PBKDF2 (PBMAC1) is now supported, according to the specification proposed in draft-ietf-lamps-pkcs12-pbmac1. ** libgnutls: SHA3 extendable output functions (XOF) are now supported SHA3 XOF, SHAKE128 and SHAKE256, are now usable through a new public API gnutls_hash_squeeze. ** API and ABI modifications: gnutls_pkcs12_generate_mac3: New function gnutls_pkcs12_flags_t: New enum gnutls_hash_squeeze: New function (From OE-Core rev: 61e7888c8e31ac2adee9eb75ee2393125ef9b433) Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch2
-rw-r--r--meta/recipes-support/gnutls/gnutls/0001-Fix-RSAES-PKCS1-v1_5-system-wide-configuration.patch269
-rw-r--r--meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch10
-rw-r--r--meta/recipes-support/gnutls/gnutls/arm_eabi.patch2
-rw-r--r--meta/recipes-support/gnutls/gnutls_3.8.6.bb (renamed from meta/recipes-support/gnutls/gnutls_3.8.5.bb)3
5 files changed, 8 insertions, 278 deletions
diff --git a/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch b/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch
index d13bfee8ef..59824d35f1 100644
--- a/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch
+++ b/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch
@@ -1,4 +1,4 @@
1From 7be8ec59a53e93c2bd453b3ba2d63d1b300ef11f Mon Sep 17 00:00:00 2001 1From c4f6cb380471b5e5478ae6f7f8c5604a6a64ec1c Mon Sep 17 00:00:00 2001
2From: Lei Maohui <leimaohui@fujitsu.com> 2From: Lei Maohui <leimaohui@fujitsu.com>
3Date: Mon, 23 May 2022 10:44:43 +0900 3Date: Mon, 23 May 2022 10:44:43 +0900
4Subject: [PATCH] Creating .hmac file should be excuted in target environment, 4Subject: [PATCH] Creating .hmac file should be excuted in target environment,
diff --git a/meta/recipes-support/gnutls/gnutls/0001-Fix-RSAES-PKCS1-v1_5-system-wide-configuration.patch b/meta/recipes-support/gnutls/gnutls/0001-Fix-RSAES-PKCS1-v1_5-system-wide-configuration.patch
deleted file mode 100644
index cc39f5c9a5..0000000000
--- a/meta/recipes-support/gnutls/gnutls/0001-Fix-RSAES-PKCS1-v1_5-system-wide-configuration.patch
+++ /dev/null
@@ -1,269 +0,0 @@
1From 2d73d945c4b1dfcf8d2328c4d23187d62ffaab2d Mon Sep 17 00:00:00 2001
2From: Zoltan Fridrich <zfridric@redhat.com>
3Date: Wed, 10 Apr 2024 12:51:33 +0200
4Subject: [PATCH] Fix RSAES-PKCS1-v1_5 system-wide configuration
5
6Upstream-Status: Backport [expected for 3.8.6 https://gitlab.com/gnutls/gnutls/-/merge_requests/1830?commit_id=2d73d945c4b1dfcf8d2328c4d23187d62ffaab2d]
7
8Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
9Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
10---
11 lib/priority.c | 125 +++++++++++-------
12 ...system-override-allow-rsa-pkcs1-encrypt.sh | 27 +++-
13 2 files changed, 96 insertions(+), 56 deletions(-)
14
15diff --git a/lib/priority.c b/lib/priority.c
16index 8abe00d1ff..3434619aad 100644
17--- a/lib/priority.c
18+++ b/lib/priority.c
19@@ -1018,6 +1018,12 @@ struct cfg {
20 bool force_ext_master_secret_set;
21 };
22
23+static inline void cfg_init(struct cfg *cfg)
24+{
25+ memset(cfg, 0, sizeof(*cfg));
26+ cfg->allow_rsa_pkcs1_encrypt = true;
27+}
28+
29 static inline void cfg_deinit(struct cfg *cfg)
30 {
31 if (cfg->priority_strings) {
32@@ -1095,6 +1101,12 @@ struct ini_ctx {
33 size_t curves_size;
34 };
35
36+static inline void ini_ctx_init(struct ini_ctx *ctx)
37+{
38+ memset(ctx, 0, sizeof(*ctx));
39+ cfg_init(&ctx->cfg);
40+}
41+
42 static inline void ini_ctx_deinit(struct ini_ctx *ctx)
43 {
44 cfg_deinit(&ctx->cfg);
45@@ -1423,9 +1435,6 @@ static inline int cfg_apply(struct cfg *cfg, struct ini_ctx *ctx)
46 _gnutls_default_priority_string = cfg->default_priority_string;
47 }
48
49- /* enable RSA-PKCS1-V1_5 by default */
50- cfg->allow_rsa_pkcs1_encrypt = true;
51-
52 if (cfg->allowlisting) {
53 /* also updates `flags` of global `hash_algorithms[]` */
54 ret = cfg_hashes_set_array(cfg, ctx->hashes, ctx->hashes_size);
55@@ -2217,22 +2226,73 @@ update_system_wide_priority_string(void)
56 return 0;
57 }
58
59+/* Returns false on parse error, otherwise true.
60+ * The system_wide_config must be locked for writing.
61+ */
62+static inline bool load_system_priority_file(void)
63+{
64+ int err;
65+ FILE *fp;
66+ struct ini_ctx ctx;
67+
68+ cfg_init(&system_wide_config);
69+
70+ fp = fopen(system_priority_file, "re");
71+ if (fp == NULL) {
72+ _gnutls_debug_log("cfg: unable to open: %s: %d\n",
73+ system_priority_file, errno);
74+ return true;
75+ }
76+
77+ /* Parsing the configuration file needs to be done in 2 phases:
78+ * first parsing the [global] section
79+ * and then the other sections,
80+ * because the [global] section modifies the parsing behavior.
81+ */
82+ ini_ctx_init(&ctx);
83+ err = ini_parse_file(fp, global_ini_handler, &ctx);
84+ if (!err) {
85+ if (fseek(fp, 0L, SEEK_SET) < 0) {
86+ _gnutls_debug_log("cfg: unable to rewind: %s\n",
87+ system_priority_file);
88+ if (fail_on_invalid_config)
89+ exit(1);
90+ }
91+ err = ini_parse_file(fp, cfg_ini_handler, &ctx);
92+ }
93+ fclose(fp);
94+ if (err) {
95+ ini_ctx_deinit(&ctx);
96+ _gnutls_debug_log("cfg: unable to parse: %s: %d\n",
97+ system_priority_file, err);
98+ return false;
99+ }
100+ cfg_apply(&system_wide_config, &ctx);
101+ ini_ctx_deinit(&ctx);
102+ return true;
103+}
104+
105 static int _gnutls_update_system_priorities(bool defer_system_wide)
106 {
107- int ret, err = 0;
108+ int ret;
109+ bool config_parse_error = false;
110 struct stat sb;
111- FILE *fp;
112 gnutls_buffer_st buf;
113- struct ini_ctx ctx;
114
115 ret = gnutls_rwlock_rdlock(&system_wide_config_rwlock);
116- if (ret < 0) {
117+ if (ret < 0)
118 return gnutls_assert_val(ret);
119- }
120
121 if (stat(system_priority_file, &sb) < 0) {
122 _gnutls_debug_log("cfg: unable to access: %s: %d\n",
123 system_priority_file, errno);
124+
125+ (void)gnutls_rwlock_unlock(&system_wide_config_rwlock);
126+ ret = gnutls_rwlock_wrlock(&system_wide_config_rwlock);
127+ if (ret < 0)
128+ goto out;
129+ /* If system-wide config is unavailable, apply the defaults */
130+ cfg_init(&system_wide_config);
131 goto out;
132 }
133
134@@ -2240,63 +2300,27 @@ static int _gnutls_update_system_priorities(bool defer_system_wide)
135 system_priority_last_mod == sb.st_mtime) {
136 _gnutls_debug_log("cfg: system priority %s has not changed\n",
137 system_priority_file);
138- if (system_wide_config.priority_string) {
139+ if (system_wide_config.priority_string)
140 goto out; /* nothing to do */
141- }
142 }
143
144 (void)gnutls_rwlock_unlock(&system_wide_config_rwlock);
145
146 ret = gnutls_rwlock_wrlock(&system_wide_config_rwlock);
147- if (ret < 0) {
148+ if (ret < 0)
149 return gnutls_assert_val(ret);
150- }
151
152 /* Another thread could have successfully re-read system-wide config,
153 * skip re-reading if the mtime it has used is exactly the same.
154 */
155- if (system_priority_file_loaded) {
156+ if (system_priority_file_loaded)
157 system_priority_file_loaded =
158 (system_priority_last_mod == sb.st_mtime);
159- }
160
161 if (!system_priority_file_loaded) {
162- _name_val_array_clear(&system_wide_config.priority_strings);
163-
164- gnutls_free(system_wide_config.priority_string);
165- system_wide_config.priority_string = NULL;
166-
167- fp = fopen(system_priority_file, "re");
168- if (fp == NULL) {
169- _gnutls_debug_log("cfg: unable to open: %s: %d\n",
170- system_priority_file, errno);
171+ config_parse_error = !load_system_priority_file();
172+ if (config_parse_error)
173 goto out;
174- }
175- /* Parsing the configuration file needs to be done in 2 phases:
176- * first parsing the [global] section
177- * and then the other sections,
178- * because the [global] section modifies the parsing behavior.
179- */
180- memset(&ctx, 0, sizeof(ctx));
181- err = ini_parse_file(fp, global_ini_handler, &ctx);
182- if (!err) {
183- if (fseek(fp, 0L, SEEK_SET) < 0) {
184- _gnutls_debug_log("cfg: unable to rewind: %s\n",
185- system_priority_file);
186- if (fail_on_invalid_config)
187- exit(1);
188- }
189- err = ini_parse_file(fp, cfg_ini_handler, &ctx);
190- }
191- fclose(fp);
192- if (err) {
193- ini_ctx_deinit(&ctx);
194- _gnutls_debug_log("cfg: unable to parse: %s: %d\n",
195- system_priority_file, err);
196- goto out;
197- }
198- cfg_apply(&system_wide_config, &ctx);
199- ini_ctx_deinit(&ctx);
200 _gnutls_debug_log("cfg: loaded system config %s mtime %lld\n",
201 system_priority_file,
202 (unsigned long long)sb.st_mtime);
203@@ -2332,9 +2356,8 @@ static int _gnutls_update_system_priorities(bool defer_system_wide)
204 out:
205 (void)gnutls_rwlock_unlock(&system_wide_config_rwlock);
206
207- if (err && fail_on_invalid_config) {
208+ if (config_parse_error && fail_on_invalid_config)
209 exit(1);
210- }
211
212 return ret;
213 }
214diff --git a/tests/system-override-allow-rsa-pkcs1-encrypt.sh b/tests/system-override-allow-rsa-pkcs1-encrypt.sh
215index b7d477c96e..714d0af946 100755
216--- a/tests/system-override-allow-rsa-pkcs1-encrypt.sh
217+++ b/tests/system-override-allow-rsa-pkcs1-encrypt.sh
218@@ -19,9 +19,8 @@
219 # You should have received a copy of the GNU Lesser General Public License
220 # along with this program. If not, see <https://www.gnu.org/licenses/>
221
222-: ${srcdir=.}
223-TEST=${srcdir}/rsaes-pkcs1-v1_5
224-CONF=${srcdir}/config.$$.tmp
225+TEST=${builddir}/rsaes-pkcs1-v1_5
226+CONF=config.$$.tmp
227 export GNUTLS_SYSTEM_PRIORITY_FILE=${CONF}
228 export GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID=1
229
230@@ -38,15 +37,33 @@ cat <<_EOF_ > ${CONF}
231 allow-rsa-pkcs1-encrypt = true
232 _EOF_
233
234-${TEST} && fail "RSAES-PKCS1-v1_5 expected to succeed"
235+${TEST}
236+if [ $? != 0 ]; then
237+ echo "${TEST} expected to succeed"
238+ exit 1
239+fi
240+echo "RSAES-PKCS1-v1_5 successfully enabled"
241
242 cat <<_EOF_ > ${CONF}
243 [overrides]
244 allow-rsa-pkcs1-encrypt = false
245 _EOF_
246
247-${TEST} || fail "RSAES-PKCS1-v1_5 expected to fail"
248+${TEST}
249+if [ $? = 0 ]; then
250+ echo "${TEST} expected to fail"
251+ exit 1
252+fi
253+echo "RSAES-PKCS1-v1_5 successfully disabled"
254
255 unset GNUTLS_SYSTEM_PRIORITY_FILE
256 unset GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID
257+
258+${TEST}
259+if [ $? != 0 ]; then
260+ echo "${TEST} expected to succeed by default"
261+ exit 1
262+fi
263+echo "RSAES-PKCS1-v1_5 successfully enabled by default"
264+
265 exit 0
266--
267GitLab
268
269
diff --git a/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch b/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch
index 8edd31d6b9..8e4df7b37e 100644
--- a/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch
+++ b/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch
@@ -1,4 +1,4 @@
1From bfa70adcbda4e505cf2e597907852e78e0439ee2 Mon Sep 17 00:00:00 2001 1From 6abc86acecff5a30173eb78a971ec5b65f77e1de Mon Sep 17 00:00:00 2001
2From: Ravineet Singh <ravineet.a.singh@est.tech> 2From: Ravineet Singh <ravineet.a.singh@est.tech>
3Date: Tue, 10 Jan 2023 16:11:10 +0100 3Date: Tue, 10 Jan 2023 16:11:10 +0100
4Subject: [PATCH] gnutls: add ptest support 4Subject: [PATCH] gnutls: add ptest support
@@ -26,10 +26,10 @@ index 843193f..816b09f 100644
26 26
27 include $(top_srcdir)/cligen/cligen.mk 27 include $(top_srcdir)/cligen/cligen.mk
28diff --git a/configure.ac b/configure.ac 28diff --git a/configure.ac b/configure.ac
29index 934377e..4406eae 100644 29index 1744813..efb9e34 100644
30--- a/configure.ac 30--- a/configure.ac
31+++ b/configure.ac 31+++ b/configure.ac
32@@ -1213,6 +1213,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) 32@@ -1226,6 +1226,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS)
33 33
34 AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes") 34 AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
35 35
@@ -39,10 +39,10 @@ index 934377e..4406eae 100644
39 39
40 hw_features= 40 hw_features=
41diff --git a/tests/Makefile.am b/tests/Makefile.am 41diff --git a/tests/Makefile.am b/tests/Makefile.am
42index e39a3b3..861dd63 100644 42index 189d068..8430b05 100644
43--- a/tests/Makefile.am 43--- a/tests/Makefile.am
44+++ b/tests/Makefile.am 44+++ b/tests/Makefile.am
45@@ -663,6 +663,12 @@ SH_LOG_COMPILER = $(SHELL) 45@@ -668,6 +668,12 @@ SH_LOG_COMPILER = $(SHELL)
46 AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind 46 AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind
47 LOG_COMPILER = $(LOG_VALGRIND) 47 LOG_COMPILER = $(LOG_VALGRIND)
48 48
diff --git a/meta/recipes-support/gnutls/gnutls/arm_eabi.patch b/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
index 883d0123db..d493448aab 100644
--- a/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
+++ b/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
@@ -1,4 +1,4 @@
1From d17ae0ef31c3c186766a338e8c40c87d1b98820e Mon Sep 17 00:00:00 2001 1From 46b3079095c5ceb0dc742785853bbaf288f325c6 Mon Sep 17 00:00:00 2001
2From: Joe Slater <jslater@windriver.com> 2From: Joe Slater <jslater@windriver.com>
3Date: Wed, 25 Jan 2017 13:52:59 -0800 3Date: Wed, 25 Jan 2017 13:52:59 -0800
4Subject: [PATCH] gnutls: account for ARM_EABI 4Subject: [PATCH] gnutls: account for ARM_EABI
diff --git a/meta/recipes-support/gnutls/gnutls_3.8.5.bb b/meta/recipes-support/gnutls/gnutls_3.8.6.bb
index 52a1c00c4a..37d12fb5ea 100644
--- a/meta/recipes-support/gnutls/gnutls_3.8.5.bb
+++ b/meta/recipes-support/gnutls/gnutls_3.8.6.bb
@@ -21,12 +21,11 @@ SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
21SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \ 21SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \
22 file://arm_eabi.patch \ 22 file://arm_eabi.patch \
23 file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \ 23 file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \
24 file://0001-Fix-RSAES-PKCS1-v1_5-system-wide-configuration.patch \
25 file://run-ptest \ 24 file://run-ptest \
26 file://Add-ptest-support.patch \ 25 file://Add-ptest-support.patch \
27 " 26 "
28 27
29SRC_URI[sha256sum] = "66269a2cfe0e1c2dabec87bdbbd8ab656f396edd9a40dd006978e003cfa52bfc" 28SRC_URI[sha256sum] = "2e1588aae53cb32d43937f1f4eca28febd9c0c7aa1734fc5dd61a7e81e0ebcdd"
30 29
31inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest 30inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest
32 31