More GetTokenInfo.

This commit is contained in:
Alessio Di Mauro
2015-07-06 16:42:36 +02:00
parent f95c6f2f2d
commit 9f6dfed7cd
6 changed files with 88 additions and 21 deletions
+12 -3
View File
@@ -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;
}