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

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