Suppress sscanf_s error on Windows
This commit is contained in:
@@ -714,7 +714,10 @@ ykpiv_rc ykpiv_util_generate_key(ykpiv_state *state, uint8_t slot, uint8_t algor
|
|||||||
if (ykpiv_util_devicemodel(state) == DEVTYPE_YK4 && (algorithm == YKPIV_ALGO_RSA1024 || algorithm == YKPIV_ALGO_RSA2048)) {
|
if (ykpiv_util_devicemodel(state) == DEVTYPE_YK4 && (algorithm == YKPIV_ALGO_RSA1024 || algorithm == YKPIV_ALGO_RSA2048)) {
|
||||||
if ((res = ykpiv_get_version(state, version, sizeof(version))) == YKPIV_OK) {
|
if ((res = ykpiv_get_version(state, version, sizeof(version))) == YKPIV_OK) {
|
||||||
int major, minor, build;
|
int major, minor, build;
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(suppress: 4996) // Suppress _CRT_SECURE_NO_WARNINGS complaint (about sscanf_s)
|
||||||
int match = sscanf(version, "%d.%d.%d", &major, &minor, &build);
|
int match = sscanf(version, "%d.%d.%d", &major, &minor, &build);
|
||||||
|
#pragma warning(pop)
|
||||||
if (match == 3 && major == 4 && (minor < 3 || (minor == 3 && build < 5))) {
|
if (match == 3 && major == 4 && (minor < 3 || (minor == 3 && build < 5))) {
|
||||||
fprintf(stderr, "On-chip RSA key generation on this YubiKey has been blocked.\n");
|
fprintf(stderr, "On-chip RSA key generation on this YubiKey has been blocked.\n");
|
||||||
fprintf(stderr, "Please see https://yubi.co/ysa201701/ for details.\n");
|
fprintf(stderr, "Please see https://yubi.co/ysa201701/ for details.\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user