mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Cleanup of dek_to_passphrase function (part 2).
* g10/passphrase.c (passphrase_get): Remove arg KEYID. Change arg MODE to NOCACHE. (passphrase_to_dek): Remove args KEYID and PUBKEY_ALGO. Split arg MODE into CREATE and NOCACHE. Change all callers and adjust stubs. (passphrase_clear_cache): Remove args KEYID and ALGO. They are not used. Change caller. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
5b614973fe
commit
491d6fdabb
7 changed files with 46 additions and 204 deletions
|
@ -221,8 +221,7 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
|
|||
s2k = xmalloc_clear( sizeof *s2k );
|
||||
s2k->mode = opt.s2k_mode;
|
||||
s2k->hash_algo = S2K_DIGEST_ALGO;
|
||||
cfx.dek = passphrase_to_dek (NULL, 0,
|
||||
default_cipher_algo(), s2k, 4,
|
||||
cfx.dek = passphrase_to_dek (default_cipher_algo (), s2k, 1, 0,
|
||||
NULL, &canceled);
|
||||
if ( !cfx.dek || !cfx.dek->keylen )
|
||||
{
|
||||
|
@ -413,8 +412,8 @@ setup_symkey (STRING2KEY **symkey_s2k,DEK **symkey_dek)
|
|||
(*symkey_s2k)->mode = opt.s2k_mode;
|
||||
(*symkey_s2k)->hash_algo = S2K_DIGEST_ALGO;
|
||||
|
||||
*symkey_dek=passphrase_to_dek(NULL,0,opt.s2k_cipher_algo,
|
||||
*symkey_s2k, 4, NULL, &canceled);
|
||||
*symkey_dek = passphrase_to_dek (opt.s2k_cipher_algo,
|
||||
*symkey_s2k, 1, 0, NULL, &canceled);
|
||||
if(!*symkey_dek || !(*symkey_dek)->keylen)
|
||||
{
|
||||
xfree(*symkey_dek);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue