diff options
author | Werner Koch <[email protected]> | 2019-01-26 22:10:38 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-01-26 22:10:38 +0000 |
commit | ec13b1c562e34c0fcbc7b848ab6dc187b79cf2c1 (patch) | |
tree | 33ad3af6094e2a64625772e0f60104e48e8b917e /g10/card-util.c | |
parent | scd: Improve app selection for app "undefined". (diff) | |
download | gnupg-ec13b1c562e34c0fcbc7b848ab6dc187b79cf2c1.tar.gz gnupg-ec13b1c562e34c0fcbc7b848ab6dc187b79cf2c1.zip |
gpg: Move S2K encoding function to a shared file.
* g10/passphrase.c (encode_s2k_iterations): Move function to ...
* common/openpgp-s2k.c: new file. Remove default intialization code.
* common/openpgpdefs.h (S2K_DECODE_COUNT): New to keep only one copy.
* g10/call-agent.c (agent_get_s2k_count): Change to return the count
and print an error.
* agent/protect.c: Include openpgpdefs.h
* g10/card-util.c (gen_kdf_data): Adjust for changes
* g10/gpgcompose.c: Include call-agent.h.
(sk_esk): Adjust for changes.
* g10/passphrase (passphrase_to_dek): Adjust for changes.
* g10/main.h (S2K_DECODE_COUNT): Remove macro.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/card-util.c')
-rw-r--r-- | g10/card-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/card-util.c b/g10/card-util.c index eca248433..08844bae3 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -2039,7 +2039,7 @@ gen_kdf_data (unsigned char *data, int single_salt) p = data; - s2k_char = encode_s2k_iterations (0); + s2k_char = encode_s2k_iterations (agent_get_s2k_count ()); iterations = S2K_DECODE_COUNT (s2k_char); count_4byte[0] = (iterations >> 24) & 0xff; count_4byte[1] = (iterations >> 16) & 0xff; |