diff options
author | Werner Koch <[email protected]> | 2010-03-12 17:24:06 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-03-12 17:24:06 +0000 |
commit | cdbe2c212204f6d770eaee6aba92ddaffe1e4e2f (patch) | |
tree | a98b9d1911b3a99d01113572b00e679c46740fc0 | |
parent | Post release updates (diff) | |
download | gnupg-cdbe2c212204f6d770eaee6aba92ddaffe1e4e2f.tar.gz gnupg-cdbe2c212204f6d770eaee6aba92ddaffe1e4e2f.zip |
Return a posiive status message for a successfull passphrase change.
-rw-r--r-- | common/ChangeLog | 4 | ||||
-rw-r--r-- | common/status.h | 3 | ||||
-rw-r--r-- | g10/ChangeLog | 7 | ||||
-rw-r--r-- | g10/gpg.h | 1 | ||||
-rw-r--r-- | g10/keyedit.c | 15 | ||||
-rw-r--r-- | g10/seckey-cert.c | 2 |
6 files changed, 22 insertions, 10 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index c236ae17a..99a1a0994 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,7 @@ +2010-03-12 Werner Koch <[email protected]> + + * status.h (STATUS_ENTER): New. + 2010-02-11 Marcus Brinkmann <[email protected]> From trunk 2009-10-16, 2009-11-02, 2009-11-05: diff --git a/common/status.h b/common/status.h index a11f2a38c..8df64defa 100644 --- a/common/status.h +++ b/common/status.h @@ -124,7 +124,8 @@ enum STATUS_PKA_TRUST_GOOD, STATUS_TRUNCATED, - STATUS_ERROR + STATUS_ERROR, + STATUS_SUCCESS }; diff --git a/g10/ChangeLog b/g10/ChangeLog index 5f3b0aade..a6a2f6d43 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,10 @@ +2010-03-12 Werner Koch <[email protected]> + + * seckey-cert.c (do_check): Return GPG_ERR_CANCELED. + * keyedit.c (change_passphrase): Add arg R_ERR. + (keyedit_passwd): Return the correct error or emit a success + status message. + 2010-02-25 Werner Koch <[email protected]> * sign.c (hash_for): Force SHA1 only for v1 OpenPGP cards. Fixes @@ -119,5 +119,4 @@ struct server_control_s #define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY #define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY - #endif /*GNUPG_G10_GPG_H*/ diff --git a/g10/keyedit.c b/g10/keyedit.c index 14596a817..2aa7c28e2 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1098,7 +1098,7 @@ sign_uids( KBNODE keyblock, strlist_t locusr, int *ret_modified, * We use only one passphrase for all keys. */ static int -change_passphrase( KBNODE keyblock ) +change_passphrase (KBNODE keyblock, int *r_err) { int rc = 0; int changed=0; @@ -1262,6 +1262,8 @@ change_passphrase( KBNODE keyblock ) leave: xfree( passphrase ); set_next_passphrase( NULL ); + if (r_err) + *r_err = rc; return changed && !rc; } @@ -2121,7 +2123,7 @@ keyedit_menu( const char *username, strlist_t locusr, break; case cmdPASSWD: - if( change_passphrase( sec_keyblock ) ) + if (change_passphrase (sec_keyblock, NULL)) sec_modified = 1; break; @@ -2341,11 +2343,8 @@ keyedit_passwd (const char *username) if (err) goto leave; - if (!change_passphrase (keyblock)) - { - err = gpg_error (GPG_ERR_GENERAL); - goto leave; - } + if (!change_passphrase (keyblock, &err)) + goto leave; err = keydb_update_keyblock (kdh, keyblock); if (err) @@ -2362,6 +2361,8 @@ keyedit_passwd (const char *username) username, gpg_strerror (err)); write_status_error ("keyedit.passwd", gpg_err_code (err)); } + else + write_status_text (STATUS_SUCCESS, "keyedit.passwd"); } diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c index 1398b181b..9995aa416 100644 --- a/g10/seckey-cert.c +++ b/g10/seckey-cert.c @@ -83,7 +83,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode, &sk->protect.s2k, mode, tryagain_text, canceled ); if (!dek && canceled && *canceled) - return G10ERR_GENERAL; + return GPG_ERR_CANCELED; err = openpgp_cipher_open (&cipher_hd, sk->protect.algo, |