Blame SOURCES/opencryptoki-3.15.1-f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch

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