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

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