aboutsummaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/passphrase.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 744da06ba..ae22074f6 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -613,17 +613,21 @@ passphrase_to_dek (u32 *keyid, int pubkey_algo,
pw = xstrdup ("");
if ( *pw && mode == 2 )
{
- char *pw2 = passphrase_get ( keyid, 2, NULL, NULL, NULL,
- NULL, canceled );
- if (!pw2)
- pw2 = xstrdup ("");
- if ( strcmp(pw, pw2) )
- {
- xfree(pw2);
- xfree(pw);
- return NULL;
- }
- xfree(pw2);
+ int i;
+ for(i=0;i<opt.passwd_repeat;i++)
+ {
+ char *pw2 = passphrase_get ( keyid, 2, NULL, NULL, NULL,
+ NULL, canceled );
+ if (!pw2)
+ pw2 = xstrdup ("");
+ if ( strcmp(pw, pw2) )
+ {
+ xfree(pw2);
+ xfree(pw);
+ return NULL;
+ }
+ xfree(pw2);
+ }
}
}