rename TALER_RefreshLinkDecryptedP to TALER_RefreshLinkDecrypted as it contains a pointer and is thus not (P)acked

This commit is contained in:
Christian Grothoff 2015-04-13 18:42:39 +02:00
parent 5827630699
commit 2f6a4bb11c
4 changed files with 39 additions and 8 deletions

View File

@ -379,7 +379,7 @@ struct TALER_EncryptedLinkSecretP
/** /**
* @brief Representation of an refresh link in cleartext. * @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 * @param secret shared secret to use for decryption
* @return NULL on error * @return NULL on error
*/ */
struct TALER_RefreshLinkDecryptedP * struct TALER_RefreshLinkDecrypted *
TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
const struct TALER_LinkSecretP *secret); const struct TALER_LinkSecretP *secret);
@ -473,7 +473,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
* @return NULL on error (should never happen) * @return NULL on error (should never happen)
*/ */
struct TALER_RefreshLinkEncrypted * struct TALER_RefreshLinkEncrypted *
TALER_refresh_encrypt (const struct TALER_RefreshLinkDecryptedP *input, TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input,
const struct TALER_LinkSecretP *secret); const struct TALER_LinkSecretP *secret);

View File

@ -940,7 +940,7 @@ check_commitment (struct MHD_Connection *connection,
for (j = 0; j < num_newcoins; j++) for (j = 0; j < num_newcoins; j++)
{ {
struct TALER_RefreshLinkDecryptedP *link_data; struct TALER_RefreshLinkDecrypted *link_data;
union TALER_CoinSpendPublicKeyP coin_pub; union TALER_CoinSpendPublicKeyP coin_pub;
struct GNUNET_HashCode h_msg; struct GNUNET_HashCode h_msg;
char *buf; char *buf;

View File

@ -183,11 +183,11 @@ TALER_transfer_encrypt (const struct TALER_LinkSecretP *secret,
* @param secret shared secret to use for decryption * @param secret shared secret to use for decryption
* @return NULL on error * @return NULL on error
*/ */
struct TALER_RefreshLinkDecryptedP * struct TALER_RefreshLinkDecrypted *
TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
const struct TALER_LinkSecretP *secret) const struct TALER_LinkSecretP *secret)
{ {
struct TALER_RefreshLinkDecryptedP *ret; struct TALER_RefreshLinkDecrypted *ret;
struct GNUNET_CRYPTO_SymmetricInitializationVector iv; struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct GNUNET_CRYPTO_SymmetricSessionKey skey; struct GNUNET_CRYPTO_SymmetricSessionKey skey;
size_t buf_size = input->blinding_key_enc_size size_t buf_size = input->blinding_key_enc_size
@ -203,7 +203,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
&iv, &iv,
buf)) buf))
return NULL; return NULL;
ret = GNUNET_new (struct TALER_RefreshLinkDecryptedP); ret = GNUNET_new (struct TALER_RefreshLinkDecrypted);
memcpy (&ret->coin_priv, memcpy (&ret->coin_priv,
buf, buf,
sizeof (union TALER_CoinSpendPrivateKeyP)); sizeof (union TALER_CoinSpendPrivateKeyP));
@ -227,7 +227,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
* @return NULL on error (should never happen) * @return NULL on error (should never happen)
*/ */
struct TALER_RefreshLinkEncrypted * struct TALER_RefreshLinkEncrypted *
TALER_refresh_encrypt (const struct TALER_RefreshLinkDecryptedP *input, TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input,
const struct TALER_LinkSecretP *secret) const struct TALER_LinkSecretP *secret)
{ {
char *b_buf; char *b_buf;

View File

@ -28,10 +28,41 @@ int
main(int argc, main(int argc,
const char *const argv[]) 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", GNUNET_log_setup ("test-crypto",
"WARNING", "WARNING",
NULL); NULL);
/* FIXME: implement test... */ /* 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; return 0;
} }