pkcs11-provider/0001-utils-Do-not-repeat-GetAttribute-calls-when-the-size.patch
Simo Sorce 6a4694191f Backport upstream fixes
Resolves: RHEL-82708

Signed-off-by: Simo Sorce <simo@redhat.com>
2025-03-11 14:16:10 -04:00

29 lines
962 B
Diff

From cf6bcbb4edbe983691996f8fb126c6b143dc796d Mon Sep 17 00:00:00 2001
From: Jakub Jelen <jjelen@redhat.com>
Date: Mon, 3 Mar 2025 17:11:03 +0100
Subject: [PATCH] utils: Do not repeat GetAttribute calls when the size query
already failed
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
---
src/util.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util.c b/src/util.c
index bb1a389..3c72e8c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -83,6 +83,9 @@ CK_RV p11prov_fetch_attributes(P11PROV_CTX *ctx, P11PROV_SESSION *session,
if (attrs[i].required) {
return ret;
}
+ /* Invalid attribute: No need to call the function again for
+ * this attribute */
+ continue;
} else {
CK_ULONG len = attrs[i].attr.ulValueLen;
if (len == CK_UNAVAILABLE_INFORMATION) {
--
2.48.1