From 14d553d6c309b5e3a1ce3fdd344a706a89e6c3cc Mon Sep 17 00:00:00 2001 From: mdw Date: Sun, 13 Jan 2002 13:41:37 +0000 Subject: [PATCH] Fix stupidity in passphrase verification. --- passphrase.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/passphrase.c b/passphrase.c index a8dacc2..d27b9a4 100644 --- a/passphrase.c +++ b/passphrase.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: passphrase.c,v 1.4 2001/04/19 18:26:01 mdw Exp $ + * $Id: passphrase.c,v 1.5 2002/01/13 13:41:37 mdw Exp $ * * Reading of passphrases (Unix-specific) * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: passphrase.c,v $ + * Revision 1.5 2002/01/13 13:41:37 mdw + * Fix stupidity in passphrase verification. + * * Revision 1.4 2001/04/19 18:26:01 mdw * Re-request broken passphrases. * @@ -125,7 +128,6 @@ int passphrase_read(const char *tag, unsigned mode, char *buf, size_t sz) /* --- Read from the terminal --- */ -again: dstr_putf(&d, "%s %s: ", mode == PMODE_READ ? "Passphrase" : "New passphrase", tag); @@ -135,9 +137,9 @@ again: char b[1024]; DRESET(&d); dstr_putf(&d, "Verify passphrase %s: ", tag); - if (pixie_getpass(d.buf, b, sizeof(b)) || - strcmp(b, buf) != 0) { + if (pixie_getpass(d.buf, b, sizeof(b)) || strcmp(b, buf) != 0) { memset(b, 0, sizeof(b)); + goto fail; } } dstr_destroy(&d); -- 2.11.0