More GetTokenInfo.
This commit is contained in:
+12
-3
@@ -1,10 +1,11 @@
|
||||
#include "vendors.h"
|
||||
#include "yubico.h"
|
||||
#include <string.h>
|
||||
|
||||
vendor_id_t get_vendor_id(char *vendor_name) {
|
||||
vendor_id_t vid;
|
||||
|
||||
if (strncmp(vendor_name, "Yubico", 6) == 0)
|
||||
if (strstr(vendor_name, "Yubico") != NULL)
|
||||
return YUBICO;
|
||||
|
||||
return UNKNOWN;
|
||||
@@ -15,11 +16,19 @@ vendor_t get_vendor(vendor_id_t vid) {
|
||||
|
||||
switch (vid) {
|
||||
case YUBICO:
|
||||
v.get_version = YUBICO_get_version;
|
||||
v.get_version = YUBICO_get_version;
|
||||
v.get_label = YUBICO_get_label;
|
||||
v.get_manufacturer = YUBICO_get_manufacturer;
|
||||
v.get_model = YUBICO_get_model;
|
||||
v.get_flags = YUBICO_get_flags;
|
||||
break;
|
||||
|
||||
case UNKNOWN:
|
||||
v.get_version = NULL;
|
||||
v.get_version = NULL; // TODO: make up dummy functions?
|
||||
v.get_label = NULL;
|
||||
v.get_manufacturer = NULL;
|
||||
v.get_model = NULL;
|
||||
v.get_flags = NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user