lib: warn, but don't fail on error reading serial number or version
lib: fix Windows build with OpenSSL 1.1.1 ykcs11: fix size_t/unsigned long type mismatch on Windows x64
This commit is contained in:
+4
-1
@@ -1,6 +1,5 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <strsafe.h>
|
||||
#ifdef _MSC_VER
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
@@ -24,6 +23,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <strsafe.h> /* must be included after openssl headers */
|
||||
#endif
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
/*
|
||||
|
||||
+13
-1
@@ -305,7 +305,19 @@ ykpiv_rc _ykpiv_select_application(ykpiv_state *state) {
|
||||
* will result in another selection of the PIV applet. */
|
||||
|
||||
res = _ykpiv_get_version(state, NULL);
|
||||
if (res == YKPIV_OK) res = _ykpiv_get_serial(state, NULL, false);
|
||||
if (res != YKPIV_OK) {
|
||||
if (state->verbose) {
|
||||
fprintf(stderr, "Failed to retrieve version: '%s'\n", ykpiv_strerror(res));
|
||||
}
|
||||
}
|
||||
|
||||
res = _ykpiv_get_serial(state, NULL, false);
|
||||
if (res != YKPIV_OK) {
|
||||
if (state->verbose) {
|
||||
fprintf(stderr, "Failed to retrieve serial number: '%s'\n", ykpiv_strerror(res));
|
||||
}
|
||||
res = YKPIV_OK;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user