Added basic multivendor support for token information.

This commit is contained in:
Alessio Di Mauro
2015-07-03 17:23:16 +02:00
parent 2b2fe1f9fa
commit f95c6f2f2d
7 changed files with 154 additions and 13 deletions
+29
View File
@@ -0,0 +1,29 @@
#include "yubico.h"
#include "pkcs11.h"
CK_VERSION YUBICO_get_version(char *version, int len) {
CK_VERSION v = {0, 0};
int i = 0;
while (i < len && version[i] != '.') {
v.major *= 10;
v.major += version[i++] - '0';
}
i++;
while (i < len && version[i] != '.') {
v.minor *= 10;
v.minor += version[i++] - '0';
}
i++;
while (i < len && version[i] != '.') {
v.minor *= 10;
v.minor += version[i++] - '0';
}
return v;
}