From: Jochen Eisinger Date: Wed, 23 Mar 2005 10:23:09 +0000 (+0000) Subject: Wed Mar 23 11:20:33 CET 2005 Jochen Eisinger X-Git-Tag: silc.server.0.9.19~43 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=b950ef2bbcb71151c8105bcaffc6a74597dc9867 Wed Mar 23 11:20:33 CET 2005 Jochen Eisinger * 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 --- diff --git a/CHANGES b/CHANGES index 7834e25c..871e47f7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Wed Mar 23 11:20:33 CET 2005 Jochen Eisinger + + * 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 * Make sure server is removed from backup list when it is diff --git a/lib/silcutil/silcapputil.c b/lib/silcutil/silcapputil.c index 1f486afa..a79ee597 100644 --- a/lib/silcutil/silcapputil.c +++ b/lib/silcutil/silcapputil.c @@ -175,21 +175,24 @@ New pair of keys will be created. Please, answer to following questions.\n\ } 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); } }