" char hex value (not modhex)\n"
"-cXXX.. A 12 char hex value (not modhex) to use as access code for programming\n"
" (this does NOT SET the access code, that's done with -oaccess=)\n"
+"-nXXX.. The url to prepend to the OTP when sending OTP over NFC as ndef-type2\n"
+" smart-tag. Only available with the YubiKey NEO.\n"
"-oOPTION change configuration option. Possible OPTION arguments are:\n"
" salt=ssssssss Salt to be used when deriving key from a\n"
" password. If none is given, a unique random\n"
"-v verbose\n"
"-h help (this text)\n"
;
-const char *optstring = "u12xa:c:hi:o:s:vy";
+const char *optstring = "u12xa:c:n:hi:o:s:vy";
static const YK_CONFIG default_config1 = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* fixed */
bool *autocommit, char *salt,
YK_STATUS *st, bool *verbose,
unsigned char *access_code, bool *use_access_code,
- bool *aesviahash,
+ bool *aesviahash, char *ndef,
int *exit_code)
{
int c;
bool option_seen = false;
bool swap_seen = false;
bool update_seen = false;
+ bool ndef_seen = false;
ykp_configure_version(cfg, st);
*use_access_code = true;
break;
}
+ case 'n':
+ if (slot_chosen || swap_seen || update_seen) {
+ fprintf(stderr, "Ndef (-n) must be used on it's own.\n");
+ *exit_code = 1;
+ return 0;
+ }
+ ndef = optarg;
+ ndef_seen = true;
case 'o':
if (strncmp(optarg, "salt=", 5) == 0)
salt = strdup(optarg+5);