* If the passphrases entered do not match while generating a new key,
completly start over instead of going into an infinite loop asking
the user to re-enter the passphrase correctly. Affected file
lib/silcutil/silcapputil.c
+Wed Mar 23 11:20:33 CET 2005 Jochen Eisinger <jochen@penguin-breeder.org>
+
+ * If the passphrases entered do not match while generating a new key,
+ completly start over instead of going into an infinite loop asking
+ the user to re-enter the passphrase correctly. Affected file
+ lib/silcutil/silcapputil.c
+
Sun Jan 9 14:28:51 CET 2005 Pekka Riikonen <priikone@silcnet.org>
* Make sure server is removed from backup list when it is
}
if (!pass) {
- char *pass2 = NULL;
- pass = silc_get_input("Private key passphrase: ", TRUE);
- if (!pass) {
- pass = strdup("");
- } else {
- while (TRUE) {
+ while (TRUE) {
+ char *pass2 = NULL;
+ pass = silc_get_input("Private key passphrase: ", TRUE);
+ if (!pass) {
+ pass = strdup("");
+ break;
+ } else {
+ bool match;
printf("\n");
pass2 = silc_get_input("Retype private key passphrase: ", TRUE);
if (!pass2)
pass2 = strdup("");
- if (!strcmp(pass, pass2))
+ match = !strcmp(pass, pass2);
+ silc_free(pass2);
+ if (match)
break;
- fprintf(stderr, "\nPassphrases do not match");
+ fprintf(stderr, "\nPassphrases do not match\n\n");
}
- silc_free(pass2);
}
}