add list-readers action to tool

also refactor ykpiv_list_readers() a bit
This commit is contained in:
Klas Lindfors
2015-09-08 12:26:42 +02:00
parent 1a9e62cec8
commit 8eb7595d42
5 changed files with 31 additions and 20 deletions
+3 -3
View File
@@ -47,8 +47,8 @@ CK_DEFINE_FUNCTION(CK_RV, C_Initialize)(
)
{
DIN;
CK_CHAR_PTR readers;
CK_ULONG len;
char readers[2048];
CK_ULONG len = sizeof(readers);
// TODO: check for locks and mutexes
@@ -60,7 +60,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Initialize)(
return CKR_FUNCTION_FAILED; // TODO: better error?
}
if (ykpiv_list_readers(piv_state, &readers, &len) != YKPIV_OK) {
if (ykpiv_list_readers(piv_state, readers, &len) != YKPIV_OK) {
DBG(("Unable to list readers"));
return CKR_FUNCTION_FAILED;
}