From 8f3e9230f346b9e61d2614a5843fdd85d57df3ed Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Wed, 9 Sep 2015 15:54:16 +0200 Subject: [PATCH] Remove get slot description and use the reader string from pcsclite. --- ykcs11/slot_vendors.c | 2 -- ykcs11/slot_vendors.h | 2 -- ykcs11/yubico_slot.c | 11 ----------- ykcs11/yubico_slot.h | 1 - 4 files changed, 16 deletions(-) diff --git a/ykcs11/slot_vendors.c b/ykcs11/slot_vendors.c index 5ce9fed..36f05c7 100644 --- a/ykcs11/slot_vendors.c +++ b/ykcs11/slot_vendors.c @@ -7,7 +7,6 @@ slot_vendor_t get_slot_vendor(vendor_id_t vid) { switch (vid) { case YUBICO: - v.get_slot_description = YUBICO_get_slot_description; v.get_slot_manufacturer = YUBICO_get_slot_manufacturer; v.get_slot_flags = YUBICO_get_slot_flags; v.get_slot_version = YUBICO_get_slot_version; @@ -15,7 +14,6 @@ slot_vendor_t get_slot_vendor(vendor_id_t vid) { case UNKNOWN: default: - v.get_slot_description = NULL; v.get_slot_manufacturer = NULL; v.get_slot_flags = NULL; v.get_slot_version = NULL; diff --git a/ykcs11/slot_vendors.h b/ykcs11/slot_vendors.h index 2426e23..5ab475d 100644 --- a/ykcs11/slot_vendors.h +++ b/ykcs11/slot_vendors.h @@ -4,14 +4,12 @@ #include "pkcs11.h" #include "vendor_ids.h" -typedef CK_RV (*get_s_description_f)(CK_UTF8CHAR_PTR, CK_ULONG); typedef CK_RV (*get_s_manufacturer_f)(CK_UTF8CHAR_PTR, CK_ULONG); typedef CK_RV (*get_s_flags_f)(CK_FLAGS_PTR); typedef CK_RV (*get_s_version_f)(CK_VERSION_PTR); typedef struct { - get_s_description_f get_slot_description; get_s_manufacturer_f get_slot_manufacturer; get_s_flags_f get_slot_flags; get_s_version_f get_slot_version; diff --git a/ykcs11/yubico_slot.c b/ykcs11/yubico_slot.c index abfc8aa..d947f50 100644 --- a/ykcs11/yubico_slot.c +++ b/ykcs11/yubico_slot.c @@ -2,21 +2,10 @@ #include "pkcs11.h" #include -static const CK_UTF8CHAR_PTR slot_description = "YubiKey Virtual Reader"; static const CK_UTF8CHAR_PTR slot_manufacturer = "Yubico"; static const CK_FLAGS slot_flags = CKF_TOKEN_PRESENT | CKF_HW_SLOT; static const CK_VERSION slot_version = {1, 0}; -CK_RV YUBICO_get_slot_description(CK_UTF8CHAR_PTR str, CK_ULONG len) { - - if (strlen(slot_description) > len) - return CKR_BUFFER_TOO_SMALL; - - memcpy(str, slot_description, strlen(slot_description)); - return CKR_OK; - -} - CK_RV YUBICO_get_slot_manufacturer(CK_UTF8CHAR_PTR str, CK_ULONG len) { if (strlen(slot_manufacturer) > len) diff --git a/ykcs11/yubico_slot.h b/ykcs11/yubico_slot.h index 4bd617d..7f84106 100644 --- a/ykcs11/yubico_slot.h +++ b/ykcs11/yubico_slot.h @@ -3,7 +3,6 @@ #include "pkcs11.h" -CK_RV YUBICO_get_slot_description(CK_UTF8CHAR_PTR str, CK_ULONG len); CK_RV YUBICO_get_slot_manufacturer(CK_UTF8CHAR_PTR str, CK_ULONG len); CK_RV YUBICO_get_slot_flags(CK_FLAGS_PTR flags); CK_RV YUBICO_get_slot_version(CK_VERSION_PTR version);