1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-16 00:29:50 +02:00

Return a posiive status message for a successfull passphrase change.

This commit is contained in:
Werner Koch 2010-03-12 17:24:06 +00:00
parent 75db9afe81
commit cdbe2c2122
6 changed files with 22 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2010-03-12 Werner Koch <wk@g10code.com>
* status.h (STATUS_ENTER): New.
2010-02-11 Marcus Brinkmann <marcus@g10code.de>
From trunk 2009-10-16, 2009-11-02, 2009-11-05:

View File

@ -124,7 +124,8 @@ enum
STATUS_PKA_TRUST_GOOD,
STATUS_TRUNCATED,
STATUS_ERROR
STATUS_ERROR,
STATUS_SUCCESS
};

View File

@ -1,3 +1,10 @@
2010-03-12 Werner Koch <wk@g10code.com>
* 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 <wk@g10code.com>
* sign.c (hash_for): Force SHA1 only for v1 OpenPGP cards. Fixes

View File

@ -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*/

View File

@ -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");
}

View File

@ -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,