summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2017-05-04 22:18:35 -0600
committerEduardo Chappa <chappa@washington.edu>2017-05-04 22:18:35 -0600
commit65dea5ff595b089c5d46131381f01d84b7dfd79a (patch)
tree6164e02d0b1cb667430ff0a0fa9157b44a8977c7 /pith
parent8f8122b0ec2d9a73b42bd0bc21781cc7fa95a1e2 (diff)
downloadalpine-65dea5ff595b089c5d46131381f01d84b7dfd79a.tar.xz
* Creating key for password file could not be cancelled.
Diffstat (limited to 'pith')
-rw-r--r--pith/pine.hlp2
-rw-r--r--pith/smkeys.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 846b3eb5..2f75dd38 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 210 2017-05-03 00:58:42
+Alpine Commit 211 2017-05-04 22:18:31
============= h_news =================
<HTML>
<HEAD>
diff --git a/pith/smkeys.c b/pith/smkeys.c
index cd940868..46501d08 100644
--- a/pith/smkeys.c
+++ b/pith/smkeys.c
@@ -98,11 +98,13 @@ create_master_password(char *pass, size_t passlen, int first_time)
_("Create master password \(attempt %d of %d): "), trial+1, MAXTRIAL);
prompt[sizeof(prompt)- 1] = '\0';
pass[0] = '\0';
- do {
+ do {
+ /* rv == 1 means cancel */
rv = (pith_smime_enter_password)(prompt, pass, passlen);
- if(password_policy_check(pass) == 0)
+ if(rv == 1 || password_policy_check(pass) == 0)
pass[0] = '\0';
- } while ((rv !=0 && rv !=1 && rv > 0) || pass[0] == '\0');
+ if(rv == 1) return 0;
+ } while ((rv != 0 && rv != 1) || (rv == 0 && pass[0] == '\0'));
snprintf(prompt, sizeof(prompt),
_("Confirm master password \(attempt %d of %d): "), trial+1, MAXTRIAL);