diff options
Diffstat (limited to 'src/gnsrecord/test_gnsrecord_crypto.c')
-rw-r--r-- | src/gnsrecord/test_gnsrecord_crypto.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gnsrecord/test_gnsrecord_crypto.c b/src/gnsrecord/test_gnsrecord_crypto.c index 0da19fbe9..b67e9a123 100644 --- a/src/gnsrecord/test_gnsrecord_crypto.c +++ b/src/gnsrecord/test_gnsrecord_crypto.c | |||
@@ -41,8 +41,6 @@ | |||
41 | #define TEST_REMOVE_RECORD_DATA 'b' | 41 | #define TEST_REMOVE_RECORD_DATA 'b' |
42 | 42 | ||
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; | ||
45 | |||
46 | static struct GNUNET_GNSRECORD_Data *s_rd; | 44 | static struct GNUNET_GNSRECORD_Data *s_rd; |
47 | 45 | ||
48 | static char *s_name; | 46 | static char *s_name; |
@@ -106,15 +104,16 @@ run (void *cls, | |||
106 | struct GNUNET_HashCode query_pub; | 104 | struct GNUNET_HashCode query_pub; |
107 | struct GNUNET_HashCode query_priv; | 105 | struct GNUNET_HashCode query_priv; |
108 | struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get (); | 106 | struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get (); |
107 | struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | ||
108 | |||
109 | 109 | ||
110 | privkey = GNUNET_CRYPTO_ecdsa_key_create (); | 110 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); |
111 | GNUNET_assert (NULL != privkey); | ||
112 | /* get public key */ | 111 | /* get public key */ |
113 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, | 112 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
114 | &pubkey); | 113 | &pubkey); |
115 | 114 | ||
116 | /* test query derivation */ | 115 | /* test query derivation */ |
117 | GNUNET_GNSRECORD_query_from_private_key (privkey, | 116 | GNUNET_GNSRECORD_query_from_private_key (&privkey, |
118 | "testlabel", | 117 | "testlabel", |
119 | &query_priv); | 118 | &query_priv); |
120 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, | 119 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, |
@@ -129,7 +128,7 @@ run (void *cls, | |||
129 | 128 | ||
130 | /* Create block */ | 129 | /* Create block */ |
131 | GNUNET_assert (NULL != (block = | 130 | GNUNET_assert (NULL != (block = |
132 | GNUNET_GNSRECORD_block_create (privkey, | 131 | GNUNET_GNSRECORD_block_create (&privkey, |
133 | expire, | 132 | expire, |
134 | s_name, | 133 | s_name, |
135 | s_rd, | 134 | s_rd, |
@@ -143,7 +142,6 @@ run (void *cls, | |||
143 | &rd_decrypt_cb, | 142 | &rd_decrypt_cb, |
144 | s_name)); | 143 | s_name)); |
145 | GNUNET_free (block); | 144 | GNUNET_free (block); |
146 | GNUNET_free (privkey); | ||
147 | } | 145 | } |
148 | 146 | ||
149 | 147 | ||