]> err.no Git - yubikey-personalization/commitdiff
pass a reference to the salt to args_to_config()
authorKlas Lindfors <klas@yubico.com>
Wed, 8 Jan 2014 11:23:58 +0000 (12:23 +0100)
committerKlas Lindfors <klas@yubico.com>
Wed, 8 Jan 2014 11:23:58 +0000 (12:23 +0100)
otherwise we won't get a salt back even when we ask for it

tests/test_args_to_config.c
ykpers-args.c
ykpers-args.h
ykpersonalize.c

index b742844932d53f3b439cc15724dea63326738f34..eb8b5d30ae2b7746ea76f5dc9b12a1836a4a3997 100644 (file)
@@ -143,7 +143,7 @@ int _test_config (YKP_CONFIG *cfg, YK_STATUS *st, int argc, char **argv)
        rc = args_to_config(argc, argv, cfg, yk,
                            &infname, &outfname,
                            &data_format,
-                           &autocommit, salt,
+                           &autocommit, &salt,
                            st, &verbose, &dry_run,
                            access_code, &use_access_code,
                            &aesviahash, &ndef_type, ndef, &usb_mode, &zap,
@@ -342,7 +342,7 @@ int _test_non_config_args(void)
        rc = args_to_config(argc, argv, cfg, yk,
                            &infname, &outfname,
                            &data_format,
-                           &autocommit, salt,
+                           &autocommit, &salt,
                            st, &verbose, &dry_run,
                            access_code, &use_access_code,
                            &aesviahash, &ndef_type, ndef, &usb_mode, &zap,
index 66ea07e744a46b17fa1683b0fa12d15e3e339c22..a6d109633775d0dfb5e8859819e04b749d7692e9 100644 (file)
@@ -229,7 +229,7 @@ void report_yk_error(void)
 int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk,
                   const char **infname, const char **outfname,
                   int *data_format,
-                  bool *autocommit, char *salt,
+                  bool *autocommit, char **salt,
                   YK_STATUS *st, bool *verbose, bool *dry_run,
                   unsigned char *access_code, bool *use_access_code,
                   bool *aesviahash, char *ndef_type, char *ndef,
@@ -494,7 +494,7 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk,
                                return 0;
                        }
                        if (strncmp(optarg, "salt=", 5) == 0)
-                               salt = strdup(optarg+5);
+                               *salt = strdup(optarg+5);
                        else if (strncmp(optarg, "fixed=", 6) == 0) {
                                if (_set_fixed(optarg + 6, cfg) != 1) {
                                        fprintf(stderr,
index 235a6cf11027792ae81c853bcd45ae5aa1c906ed..2d3b54267834c9e75c7ad580570affec1b8644d6 100644 (file)
@@ -36,7 +36,7 @@ const char *usage;
 int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk,
                   const char **infname, const char **outfname,
                   int *data_format,
-                  bool *autocommit, char *salt,
+                  bool *autocommit, char **salt,
                   YK_STATUS *st, bool *verbose, bool *dry_run,
                   unsigned char *access_code, bool *use_access_code,
                   bool *aesviahash, char *ndef_type, char *ndef, unsigned char *usb_mode, 
index 8ad1682efab4001d6c1a612d46d0068be18ad1dc..9985930ea5a4c27e716b2d7d8fe4d38c2042ac61 100644 (file)
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
        if (! args_to_config(argc, argv, cfg, yk,
                             &infname, &outfname,
                             &data_format,
-                            &autocommit, salt,
+                            &autocommit, &salt,
                             st, &verbose, &dry_run,
                             access_code, &use_access_code,
                             &aesviahash, &ndef_type, ndef_string,