]> err.no Git - yubikey-personalization.old/commitdiff
Access code handling seems to work.
authorRichard Levitte <levitte@lp.se>
Mon, 17 Aug 2009 16:22:48 +0000 (16:22 +0000)
committerRichard Levitte <levitte@lp.se>
Mon, 17 Aug 2009 16:22:48 +0000 (16:22 +0000)
If the access code is wrong, it will only output a write error when
you try to configure, should it do something more intelligent?
Please try this out, but USE WITH CAUTION...  Try with a spare key.

ykpersonalize.c

index c0b40af6eebc01e6529a0c5325872c5b4316f574..6581db04ede17a6058e3e27bdec27d9715a13716 100644 (file)
@@ -44,9 +44,7 @@ const char *usage =
 "-iFILE    read configuration from FILE.\n"
 "          (if FILE is -, read from stdin)\n"
 "-aXXX..   A 32 char hex value (not modhex) of a fixed AES key to use\n"
-#if 0
 "-cXXX..   A 12 char modhex value to use as access code for programming\n"
-#endif
 "-oOPTION  change configuration option.  Possible OPTION arguments are:\n"
 "          salt=ssssssss       Salt to be used for key generation.  If\n"
 "                              none is given, a unique random one will be\n"
@@ -57,10 +55,8 @@ const char *usage =
 "                              This is 0-16 characters long.\n"
 "          uid=uuuuuu          The uid part of the generated ticket.\n"
 "                              MUST be 12 characters long.\n"
-#if 0
 "          access=fffffffffff  New modhex access code to set.\n"
 "                              MUST be 12 characters long.\n"
-#endif
 "          [-]tab-first        set/clear the TAB_FIRST ticket flag.\n"
 "          [-]append-tab1      set/clear the APPEND_TAB1 ticket flag.\n"
 "          [-]append-tab2      set/clear the APPEND_TAB2 ticket flag.\n"
@@ -186,7 +182,6 @@ main(int argc, char **argv)
                        aesviahash = true;
                        aeshash = optarg;
                        break;
-#if 0
                case 'c':
                        if (strlen(optarg) != 12) {
                                fprintf(stderr,
@@ -203,7 +198,6 @@ main(int argc, char **argv)
                                                    strlen(optarg) / 2);
                        use_access_code = true;
                        break;
-#endif
                case 'o':
                        if (strncmp(optarg, "salt=", 5) == 0)
                                salt = strdup(optarg+5);
@@ -254,7 +248,6 @@ main(int argc, char **argv)
                                yubikey_hex_decode (uidbin, uid, uidlen);
                                ykp_set_uid(cfg, uidbin, uidlen / 2);
                        }
-#if 0
                        else if (strncmp(optarg, "access=", 7) == 0) {
                                const char *acc = optarg+7;
                                size_t acclen = strlen (acc);
@@ -270,7 +263,6 @@ main(int argc, char **argv)
                                yubikey_modhex_decode (accbin, acc, acclen);
                                ykp_set_access_code(cfg, accbin, acclen / 2);
                        }
-#endif
                        else if (strcmp(optarg, "tab-first") == 0)
                                ykp_set_tktflag_TAB_FIRST(cfg, true);
                        else if (strcmp(optarg, "-tab-first") == 0)