commit:     b6ffe6cfad6a3a5db4067d8f3d6a6ba293002a44
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  6 11:41:52 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec  6 11:41:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6ffe6cf

app-crypt/p11-kit: update c99 patch to upstream variant

Bug: https://bugs.gentoo.org/918982
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../p11-kit/files/p11-kit-0.25.3-pointer.patch     | 28 ++++++++++------------
 ...t-0.25.3-r1.ebuild => p11-kit-0.25.3-r2.ebuild} |  0
 2 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 <[email protected]>
 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 <[email protected]>
 ---
- 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.
-

diff --git a/app-crypt/p11-kit/p11-kit-0.25.3-r1.ebuild 
b/app-crypt/p11-kit/p11-kit-0.25.3-r2.ebuild
similarity index 100%
rename from app-crypt/p11-kit/p11-kit-0.25.3-r1.ebuild
rename to app-crypt/p11-kit/p11-kit-0.25.3-r2.ebuild

Reply via email to