Remove get slot description and use the reader string from pcsclite.

This commit is contained in:
Alessio Di Mauro
2015-09-09 15:54:16 +02:00
parent 44dae19348
commit 8f3e9230f3
4 changed files with 0 additions and 16 deletions
-2
View File
@@ -7,7 +7,6 @@ slot_vendor_t get_slot_vendor(vendor_id_t vid) {
switch (vid) { switch (vid) {
case YUBICO: case YUBICO:
v.get_slot_description = YUBICO_get_slot_description;
v.get_slot_manufacturer = YUBICO_get_slot_manufacturer; v.get_slot_manufacturer = YUBICO_get_slot_manufacturer;
v.get_slot_flags = YUBICO_get_slot_flags; v.get_slot_flags = YUBICO_get_slot_flags;
v.get_slot_version = YUBICO_get_slot_version; v.get_slot_version = YUBICO_get_slot_version;
@@ -15,7 +14,6 @@ slot_vendor_t get_slot_vendor(vendor_id_t vid) {
case UNKNOWN: case UNKNOWN:
default: default:
v.get_slot_description = NULL;
v.get_slot_manufacturer = NULL; v.get_slot_manufacturer = NULL;
v.get_slot_flags = NULL; v.get_slot_flags = NULL;
v.get_slot_version = NULL; v.get_slot_version = NULL;
-2
View File
@@ -4,14 +4,12 @@
#include "pkcs11.h" #include "pkcs11.h"
#include "vendor_ids.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_manufacturer_f)(CK_UTF8CHAR_PTR, CK_ULONG);
typedef CK_RV (*get_s_flags_f)(CK_FLAGS_PTR); typedef CK_RV (*get_s_flags_f)(CK_FLAGS_PTR);
typedef CK_RV (*get_s_version_f)(CK_VERSION_PTR); typedef CK_RV (*get_s_version_f)(CK_VERSION_PTR);
typedef struct { typedef struct {
get_s_description_f get_slot_description;
get_s_manufacturer_f get_slot_manufacturer; get_s_manufacturer_f get_slot_manufacturer;
get_s_flags_f get_slot_flags; get_s_flags_f get_slot_flags;
get_s_version_f get_slot_version; get_s_version_f get_slot_version;
-11
View File
@@ -2,21 +2,10 @@
#include "pkcs11.h" #include "pkcs11.h"
#include <string.h> #include <string.h>
static const CK_UTF8CHAR_PTR slot_description = "YubiKey Virtual Reader";
static const CK_UTF8CHAR_PTR slot_manufacturer = "Yubico"; static const CK_UTF8CHAR_PTR slot_manufacturer = "Yubico";
static const CK_FLAGS slot_flags = CKF_TOKEN_PRESENT | CKF_HW_SLOT; static const CK_FLAGS slot_flags = CKF_TOKEN_PRESENT | CKF_HW_SLOT;
static const CK_VERSION slot_version = {1, 0}; 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) { CK_RV YUBICO_get_slot_manufacturer(CK_UTF8CHAR_PTR str, CK_ULONG len) {
if (strlen(slot_manufacturer) > len) if (strlen(slot_manufacturer) > len)
-1
View File
@@ -3,7 +3,6 @@
#include "pkcs11.h" #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_manufacturer(CK_UTF8CHAR_PTR str, CK_ULONG len);
CK_RV YUBICO_get_slot_flags(CK_FLAGS_PTR flags); CK_RV YUBICO_get_slot_flags(CK_FLAGS_PTR flags);
CK_RV YUBICO_get_slot_version(CK_VERSION_PTR version); CK_RV YUBICO_get_slot_version(CK_VERSION_PTR version);