Blame SOURCES/0003-EP11-Do-not-pass-empty-CKA_PUBLIC_KEY_INFO-to-EP11-h.patch

397a93
From 993274f7b968caa908bdc3bf560ece55e40c875a Mon Sep 17 00:00:00 2001
397a93
From: Ingo Franzki <ifranzki@linux.ibm.com>
397a93
Date: Fri, 21 Oct 2022 10:03:40 +0200
397a93
Subject: [PATCH 03/34] EP11: Do not pass empty CKA_PUBLIC_KEY_INFO to EP11
397a93
 host library
397a93
397a93
Newer EP11 host library versions do not like empty (zero length)
397a93
attributes of type CKA_PUBLIC_KEY_INFO. Filter them out when building
397a93
the attribute list passed to the EP11 host library
397a93
397a93
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
397a93
---
397a93
 usr/lib/ep11_stdll/ep11_specific.c | 5 +++++
397a93
 1 file changed, 5 insertions(+)
397a93
397a93
diff --git a/usr/lib/ep11_stdll/ep11_specific.c b/usr/lib/ep11_stdll/ep11_specific.c
397a93
index 737b373b..d3688c56 100644
397a93
--- a/usr/lib/ep11_stdll/ep11_specific.c
397a93
+++ b/usr/lib/ep11_stdll/ep11_specific.c
397a93
@@ -1968,6 +1968,11 @@ static CK_RV build_ep11_attrs(STDLL_TokData_t * tokdata, TEMPLATE *template,
397a93
         case CKA_NEVER_EXTRACTABLE:
397a93
         case CKA_LOCAL:
397a93
             break;
397a93
+        /* EP11 does not like empty (zero length) attributes of that types */
397a93
+        case CKA_PUBLIC_KEY_INFO:
397a93
+            if (attr->ulValueLen == 0)
397a93
+                break;
397a93
+            /* Fallthrough */
397a93
         default:
397a93
             if (attr->ulValueLen > 0 && attr->pValue == NULL)
397a93
                 return CKR_ATTRIBUTE_VALUE_INVALID;
397a93
-- 
397a93
2.16.2.windows.1
397a93