diff options
author | 2023-12-06 11:41:52 +0000 | |
---|---|---|
committer | 2023-12-06 11:41:52 +0000 | |
commit | b6ffe6cfad6a3a5db4067d8f3d6a6ba293002a44 (patch) | |
tree | 978abfe933eb06bbd3dcd993c4cbf818afd8bcc2 /app-crypt/p11-kit/files | |
parent | net-misc/curl: add 8.5.0 (diff) | |
download | gentoo-b6ffe6cfad6a3a5db4067d8f3d6a6ba293002a44.tar.gz gentoo-b6ffe6cfad6a3a5db4067d8f3d6a6ba293002a44.tar.bz2 gentoo-b6ffe6cfad6a3a5db4067d8f3d6a6ba293002a44.zip |
app-crypt/p11-kit: update c99 patch to upstream variant
Bug: https://bugs.gentoo.org/918982
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-crypt/p11-kit/files')
-rw-r--r-- | app-crypt/p11-kit/files/p11-kit-0.25.3-pointer.patch | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/app-crypt/p11-kit/files/p11-kit-0.25.3-pointer.patch b/app-crypt/p11-kit/files/p11-kit-0.25.3-pointer.patch index feac3e132fce..9b316ee2fad6 100644 --- a/app-crypt/p11-kit/files/p11-kit-0.25.3-pointer.patch +++ b/app-crypt/p11-kit/files/p11-kit-0.25.3-pointer.patch @@ -1,7 +1,7 @@ https://bugs.gentoo.org/918982 -https://github.com/p11-glue/p11-kit/pull/609 +https://github.com/p11-glue/p11-kit/commit/d49c92c8420db6ee4c88515bdb014f68f4d471d9 -From 6f05ca107d588fcedaa4ef06542760cbbda8c878 Mon Sep 17 00:00:00 2001 +From d49c92c8420db6ee4c88515bdb014f68f4d471d9 Mon Sep 17 00:00:00 2001 From: Daiki Ueno <ueno@gnu.org> Date: Sat, 2 Dec 2023 09:24:01 +0900 Subject: [PATCH] import-object: Avoid integer truncation on 32-bit platforms @@ -28,11 +28,11 @@ https://github.com/p11-glue/p11-kit/issues/608 Signed-off-by: Daiki Ueno <ueno@gnu.org> --- - p11-kit/import-object.c | 32 ++++++++++++++++++++++++++++---- - 1 file changed, 28 insertions(+), 4 deletions(-) + p11-kit/import-object.c | 30 +++++++++++++++++++++++++++--- + 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/p11-kit/import-object.c b/p11-kit/import-object.c -index feee0765..278ad932 100644 +index feee0765..fb47b964 100644 --- a/p11-kit/import-object.c +++ b/p11-kit/import-object.c @@ -55,6 +55,7 @@ @@ -47,7 +47,7 @@ index feee0765..278ad932 100644 CK_ATTRIBUTE attr_encrypt = { CKA_ENCRYPT, &tval, sizeof (tval) }; CK_ATTRIBUTE attr_modulus = { CKA_MODULUS, }; CK_ATTRIBUTE attr_exponent = { CKA_PUBLIC_EXPONENT, }; -+ size_t len; ++ size_t len = 0; pubkey = p11_asn1_read (info, "subjectPublicKey", &pubkey_len); if (pubkey == NULL) { @@ -70,17 +70,16 @@ index feee0765..278ad932 100644 + attr_modulus.ulValueLen = len; - attr_exponent.pValue = p11_asn1_read (asn, "publicExponent", &attr_exponent.ulValueLen); -- if (attr_exponent.pValue == NULL) { + attr_exponent.pValue = p11_asn1_read (asn, "publicExponent", &len); -+ if (attr_exponent.pValue == NULL || len > ULONG_MAX) { -+ p11_message (_("failed to obtain exponent")); -+ goto cleanup; -+ } -+#if ULONG_MAX < SIZE_MAX -+ if (len > ULONG_MAX) { + if (attr_exponent.pValue == NULL) { p11_message (_("failed to obtain exponent")); goto cleanup; } ++#if ULONG_MAX < SIZE_MAX ++ if (len > ULONG_MAX) { ++ p11_message (_("failed to obtain exponent")); ++ goto cleanup; ++ } +#endif + attr_exponent.ulValueLen = len; @@ -90,7 +89,7 @@ index feee0765..278ad932 100644 CK_ATTRIBUTE attr_key_type = { CKA_KEY_TYPE, &key_type, sizeof (key_type) }; CK_ATTRIBUTE attr_ec_params = { CKA_EC_PARAMS, }; CK_ATTRIBUTE attr_ec_point = { CKA_EC_POINT, }; -+ size_t len; ++ size_t len = 0; - attr_ec_params.pValue = p11_asn1_read (info, "algorithm.parameters", &attr_ec_params.ulValueLen); + attr_ec_params.pValue = p11_asn1_read (info, "algorithm.parameters", &len); @@ -108,4 +107,3 @@ index feee0765..278ad932 100644 /* subjectPublicKey is read as BIT STRING value which contains * EC point data. We need to DER encode this data as OCTET STRING. - |