Remove get slot description and use the reader string from pcsclite.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -2,21 +2,10 @@
|
||||
#include "pkcs11.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_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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user