break;
}
case 'n':
- if (slot_chosen || swap_seen || update_seen || option_seen) {
+ if (slot_chosen || swap_seen || update_seen || option_seen) {
fprintf(stderr, "Ndef (-n) must be used on it's own.\n");
*exit_code = 1;
return 0;
- }
- ndef = strdup(optarg);
- ndef_seen = true;
- break;
+ }
+ if (!ykp_configure_command(cfg, SLOT_NDEF)) {
+ return 0;
+ }
+ ndef = strdup(optarg);
+ ndef_seen = true;
+ break;
case 'o':
if (strncmp(optarg, "salt=", 5) == 0)
salt = strdup(optarg+5);
return 0;
}
break;
+ case SLOT_NDEF:
+ /* NDEF is available for neo, thus within 2.1 from build 4 */
+ if (!(cfg->yk_major_version == 2 && cfg->yk_minor_version == 1 &&
+ cfg->yk_build_version >= 4 && cfg->yk_build_version != 9))
+ ykp_errno = YKP_EYUBIKEYVER;
+ break;
default:
ykp_errno = YKP_EINVCONFNUM;
return 0;