summaryrefslogtreecommitdiff
path: root/app-crypt/p11-kit/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-06 17:00:43 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-06 17:00:43 +0000
commit36ab3cd1ef5a1fcf019da2ad4d598d4a8b90d506 (patch)
tree8648eb9b08e9d94bd0939f1367d4738ae3b77193 /app-crypt/p11-kit/files
parent334d7d1830a3556a4c5d62a0f8547e5eb40bc83e (diff)
gentoo auto-resync : 06:12:2023 - 17:00:43
Diffstat (limited to 'app-crypt/p11-kit/files')
-rw-r--r--app-crypt/p11-kit/files/p11-kit-0.25.3-pointer.patch28
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.
-