diff --git a/lib/util.c b/lib/util.c index 0c9f61f..f844f4a 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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 ((res = ykpiv_get_version(state, version, sizeof(version))) == YKPIV_OK) { 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); +#pragma warning(pop) 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, "Please see https://yubi.co/ysa201701/ for details.\n");