gpg: Move S2K encoding function to a shared file.
authorWerner Koch <wk@gnupg.org>
Sat, 26 Jan 2019 22:10:38 +0000 (23:10 +0100)
committerWerner Koch <wk@gnupg.org>
Sat, 26 Jan 2019 22:10:38 +0000 (23:10 +0100)
commitec13b1c562e34c0fcbc7b848ab6dc187b79cf2c1
tree33ad3af6094e2a64625772e0f60104e48e8b917e
parent0415b80227c52620bece3ae7502f38f24a23e59d
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 <wk@gnupg.org>
12 files changed:
agent/protect.c
common/Makefile.am
common/openpgp-s2k.c [new file with mode: 0644]
common/openpgpdefs.h
common/ttyio.c
g10/call-agent.c
g10/call-agent.h
g10/card-util.c
g10/gpgcompose.c
g10/keydb.h
g10/main.h
g10/passphrase.c