diff options
author | Werner Koch <[email protected]> | 2010-08-31 15:58:39 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-08-31 15:58:39 +0000 |
commit | 87fac9911241310a4b601e126fa2e26b10bd370f (patch) | |
tree | 49e09cc881b44a1dba0e9474040cda1d5f9ce581 /agent/protect.c | |
parent | Fix for W32. (diff) | |
download | gnupg-87fac9911241310a4b601e126fa2e26b10bd370f.tar.gz gnupg-87fac9911241310a4b601e126fa2e26b10bd370f.zip |
Import OpenPGP keys into the agent.
Diffstat (limited to '')
-rw-r--r-- | agent/protect.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/agent/protect.c b/agent/protect.c index db6caa48c..3a983e2bd 100644 --- a/agent/protect.c +++ b/agent/protect.c @@ -73,6 +73,8 @@ hash_passphrase (const char *passphrase, int hashalgo, const unsigned char *s2ksalt, unsigned long s2kcount, unsigned char *key, size_t keylen); + + /* Get the process time and store it in DATA. */ static void calibrate_get_time (struct calibrate_time_s *data) @@ -1076,6 +1078,19 @@ hash_passphrase (const char *passphrase, int hashalgo, } +gpg_error_t +s2k_hash_passphrase (const char *passphrase, int hashalgo, + int s2kmode, + const unsigned char *s2ksalt, + unsigned int s2kcount, + unsigned char *key, size_t keylen) +{ + return hash_passphrase (passphrase, hashalgo, s2kmode, s2ksalt, + (16ul + (s2kcount & 15)) << ((s2kcount >> 4) + 6), + key, keylen); +} + + /* Create an canonical encoded S-expression with the shadow info from |