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