diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-04-13 18:42:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-04-13 18:42:39 +0200 |
commit | 2f6a4bb11c04e657a90eb96abb27a90a9f020230 (patch) | |
tree | 1d3cd91db6f2d84148220f161a5942f9e994f319 /src | |
parent | 5827630699a725e24a59d94861b01bad310f6a02 (diff) | |
download | exchange-2f6a4bb11c04e657a90eb96abb27a90a9f020230.tar.xz |
rename TALER_RefreshLinkDecryptedP to TALER_RefreshLinkDecrypted as it contains a pointer and is thus not (P)acked
Diffstat (limited to 'src')
-rw-r--r-- | src/include/taler_crypto_lib.h | 6 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_db.c | 2 | ||||
-rw-r--r-- | src/util/crypto.c | 8 | ||||
-rw-r--r-- | src/util/test_crypto.c | 31 |
4 files changed, 39 insertions, 8 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 3c8aee557..c3cbdcbab 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -379,7 +379,7 @@ struct TALER_EncryptedLinkSecretP /** * @brief Representation of an refresh link in cleartext. */ -struct TALER_RefreshLinkDecryptedP +struct TALER_RefreshLinkDecrypted { /** @@ -460,7 +460,7 @@ TALER_transfer_encrypt (const struct TALER_LinkSecretP *secret, * @param secret shared secret to use for decryption * @return NULL on error */ -struct TALER_RefreshLinkDecryptedP * +struct TALER_RefreshLinkDecrypted * TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, const struct TALER_LinkSecretP *secret); @@ -473,7 +473,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, * @return NULL on error (should never happen) */ struct TALER_RefreshLinkEncrypted * -TALER_refresh_encrypt (const struct TALER_RefreshLinkDecryptedP *input, +TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input, const struct TALER_LinkSecretP *secret); diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c index e72397571..12f5eecf2 100644 --- a/src/mint/taler-mint-httpd_db.c +++ b/src/mint/taler-mint-httpd_db.c @@ -940,7 +940,7 @@ check_commitment (struct MHD_Connection *connection, for (j = 0; j < num_newcoins; j++) { - struct TALER_RefreshLinkDecryptedP *link_data; + struct TALER_RefreshLinkDecrypted *link_data; union TALER_CoinSpendPublicKeyP coin_pub; struct GNUNET_HashCode h_msg; char *buf; diff --git a/src/util/crypto.c b/src/util/crypto.c index e2c298da5..e6d6917bc 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -183,11 +183,11 @@ TALER_transfer_encrypt (const struct TALER_LinkSecretP *secret, * @param secret shared secret to use for decryption * @return NULL on error */ -struct TALER_RefreshLinkDecryptedP * +struct TALER_RefreshLinkDecrypted * TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, const struct TALER_LinkSecretP *secret) { - struct TALER_RefreshLinkDecryptedP *ret; + struct TALER_RefreshLinkDecrypted *ret; struct GNUNET_CRYPTO_SymmetricInitializationVector iv; struct GNUNET_CRYPTO_SymmetricSessionKey skey; size_t buf_size = input->blinding_key_enc_size @@ -203,7 +203,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, &iv, buf)) return NULL; - ret = GNUNET_new (struct TALER_RefreshLinkDecryptedP); + ret = GNUNET_new (struct TALER_RefreshLinkDecrypted); memcpy (&ret->coin_priv, buf, sizeof (union TALER_CoinSpendPrivateKeyP)); @@ -227,7 +227,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, * @return NULL on error (should never happen) */ struct TALER_RefreshLinkEncrypted * -TALER_refresh_encrypt (const struct TALER_RefreshLinkDecryptedP *input, +TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input, const struct TALER_LinkSecretP *secret) { char *b_buf; diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c index a375bcfbb..55452c40d 100644 --- a/src/util/test_crypto.c +++ b/src/util/test_crypto.c @@ -28,10 +28,41 @@ int main(int argc, const char *const argv[]) { + struct TALER_EncryptedLinkSecretP secret_enc; + struct TALER_TransferSecretP trans_sec; + struct TALER_LinkSecretP secret; + struct TALER_RefreshLinkEncrypted *rl_enc; + struct TALER_RefreshLinkDecrypted rl; + struct GNUNET_CRYPTO_EcdhePrivateKey *pk; + + GNUNET_log_setup ("test-crypto", "WARNING", NULL); /* FIXME: implement test... */ + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, + &secret, + sizeof (secret)); + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, + &trans_sec, + sizeof (trans_sec)); + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, + &rl.coin_priv, + sizeof (rl.coin_priv)); + rl.blinding_key.rsa_blinding_key = GNUNET_CRYPTO_rsa_blinding_key_create (); + rl_enc = TALER_refresh_link_encrypt (&rl, + &secret); + GNUNET_assert (GNUNET_OK == + TALER_transfer_encrypt (&secret, + &trans_sec, + &secret_enc)); + pk = GNUNET_CRYPTO_ecdhe_key_create (); +#if 0 + .../.ecdhe_private_key = *pk; +#endif + + GNUNET_CRYPTO_rsa_blinding_key_free (rl.blinding_key); + GNUNET_free (pk); return 0; } |