Blame SOURCES/opencryptoki-3.15.1-f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch

78c4d4
From f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43 Mon Sep 17 00:00:00 2001
78c4d4
From: Patrick Steuer <patrick.steuer@de.ibm.com>
78c4d4
Date: Tue, 19 Jan 2021 14:29:57 +0100
78c4d4
Subject: [PATCH] A slot ID has nothing to do with the number of slots
78c4d4
78c4d4
Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
78c4d4
---
78c4d4
 usr/sbin/pkcscca/pkcscca.c | 14 --------------
78c4d4
 1 file changed, 14 deletions(-)
78c4d4
78c4d4
diff --git a/usr/sbin/pkcscca/pkcscca.c b/usr/sbin/pkcscca/pkcscca.c
78c4d4
index f268f1be..d0bb3160 100644
78c4d4
--- a/usr/sbin/pkcscca/pkcscca.c
78c4d4
+++ b/usr/sbin/pkcscca/pkcscca.c
78c4d4
@@ -1980,7 +1980,6 @@ int migrate_wrapped_keys(CK_SLOT_ID slot_id, char *userpin, int masterkey)
78c4d4
 {
78c4d4
     CK_FUNCTION_LIST *funcs;
78c4d4
     CK_KEY_TYPE key_type = 0;
78c4d4
-    CK_ULONG slot_count;
78c4d4
     CK_SESSION_HANDLE sess;
78c4d4
     CK_RV rv;
78c4d4
     struct key_count count = { 0, 0, 0, 0, 0, 0, 0 };
78c4d4
@@ -1992,19 +1991,6 @@ int migrate_wrapped_keys(CK_SLOT_ID slot_id, char *userpin, int masterkey)
78c4d4
         return 2;
78c4d4
     }
78c4d4
 
78c4d4
-    rv = funcs->C_GetSlotList(TRUE, NULL_PTR, &slot_count);
78c4d4
-    if (rv != CKR_OK) {
78c4d4
-        p11_error("C_GetSlotList", rv);
78c4d4
-        exit_code = 3;
78c4d4
-        goto finalize;
78c4d4
-    }
78c4d4
-
78c4d4
-    if (slot_id >= slot_count) {
78c4d4
-        print_error("%lu is not a valid slot ID.", slot_id);
78c4d4
-        exit_code = 4;
78c4d4
-        goto finalize;
78c4d4
-    }
78c4d4
-
78c4d4
     rv = funcs->C_OpenSession(slot_id, CKF_RW_SESSION |
78c4d4
                               CKF_SERIAL_SESSION, NULL_PTR, NULL_PTR, &sess;;
78c4d4
     if (rv != CKR_OK) {