diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-27 18:49:02 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-27 18:49:02 +0100 |
commit | 019af0919e3fbe2f831f92728fd95eb7ea505da9 (patch) | |
tree | 6b2b79d6462001b1c66f25d5dbff07d27753df43 /src/util/crypto.c | |
parent | c3731d0df7e03561c7da777b5f75ba53206a38b5 (diff) |
mint-httpd_db.c now compiles again
Diffstat (limited to 'src/util/crypto.c')
-rw-r--r-- | src/util/crypto.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c index b4a4a718b..930c43a7f 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -84,6 +84,33 @@ derive_refresh_key (const struct GNUNET_HashCode *secret, /** + * Use the @a trans_sec (from ECDHE) to decrypt the @a secret_enc + * to obtain the @a secret to decrypt the linkage data. + * + * @param secret_enc encrypted secret (FIXME: use different type!) + * @param trans_sec transfer secret (FIXME: use different type?) + * @param secret shared secret for refresh link decryption + * (FIXME: use different type?) + * @return #GNUNET_OK on success + */ +int +TALER_transfer_decrypt (const struct GNUNET_HashCode *secret_enc, + const struct GNUNET_HashCode *trans_sec, + struct GNUNET_HashCode *secret) +{ + struct GNUNET_CRYPTO_SymmetricInitializationVector iv; + struct GNUNET_CRYPTO_SymmetricSessionKey skey; + + derive_refresh_key (trans_sec, &iv, &skey); + return GNUNET_CRYPTO_symmetric_decrypt (secret_enc, + sizeof (struct GNUNET_HashCode), + &skey, + &iv, + secret); +} + + +/** * Decrypt refresh link information. * * @param input encrypted refresh link data |