static bool quiet;
static bool sync_done;
static bool has_key;
-static bool password_prompt;
+static int password_prompt;
static enum {
CMD_UNKNOWN,
CMD_GENERATE,
}
if (password_prompt) {
+ char *pw2;
+
pw = getpass("Password: ");
if (pw)
len = strlen(pw);
+
+ if (pw && password_prompt > 1) {
+ pw = strcpy(buf, pw);
+ pw2 = getpass("Retype password: ");
+ if (!pw2 || strcmp(pw, pw2) != 0) {
+ INFO("Passwords do not match\n");
+ return false;
+ }
+ }
} else {
len = fread(buf, 1, sizeof(buf), stdin);
if (!feof(stdin)) {
has_pubkey = true;
break;
case 'p':
- password_prompt = true;
+ password_prompt++;
break;
case 'b':
if (load_network_data(optarg))