aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_remove_not_existing_record.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-01 16:31:20 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-01 16:31:20 +0000
commitc8ee017f28ce9c5f59bdae20bd2f9c0a6c4146a7 (patch)
tree485efac43580ff0ee16164697561b11cac5a1531 /src/namestore/test_namestore_api_remove_not_existing_record.c
parent9121b5fdbb38b5ee48695edf5c45bfca1eeb0a29 (diff)
downloadgnunet-c8ee017f28ce9c5f59bdae20bd2f9c0a6c4146a7.tar.gz
gnunet-c8ee017f28ce9c5f59bdae20bd2f9c0a6c4146a7.zip
- change signing func
Diffstat (limited to 'src/namestore/test_namestore_api_remove_not_existing_record.c')
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c
index 69e9d34f3..6818e28f3 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -47,7 +47,7 @@ static struct GNUNET_OS_Process *arm;
47 47
48static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; 48static struct GNUNET_CRYPTO_RsaPrivateKey * privkey;
49static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; 49static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey;
50struct GNUNET_CRYPTO_RsaSignature s_signature; 50struct GNUNET_CRYPTO_RsaSignature *s_signature;
51static GNUNET_HashCode s_zone; 51static GNUNET_HashCode s_zone;
52struct GNUNET_NAMESTORE_RecordData *s_rd; 52struct GNUNET_NAMESTORE_RecordData *s_rd;
53static char *s_name; 53static char *s_name;
@@ -279,12 +279,7 @@ run (void *cls, char *const *args, const char *cfgfile,
279 GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); 279 GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser);
280 280
281 /* sign */ 281 /* sign */
282 struct GNUNET_CRYPTO_RsaSignaturePurpose *sig_purpose = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) + rd_ser_len); 282 s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_name, s_rd, RECORDS);
283 sig_purpose->size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose)+ rd_ser_len);
284 sig_purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN);
285 memcpy (&sig_purpose[1], rd_ser, rd_ser_len);
286 GNUNET_CRYPTO_rsa_sign (privkey, sig_purpose, &s_signature);
287 GNUNET_free (sig_purpose);
288 283
289 /* create random zone hash */ 284 /* create random zone hash */
290 GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); 285 GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
@@ -305,8 +300,9 @@ run (void *cls, char *const *args, const char *cfgfile,
305 300
306 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, 301 GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name,
307 GNUNET_TIME_absolute_get_forever(), 302 GNUNET_TIME_absolute_get_forever(),
308 RECORDS, s_rd, &s_signature, put_cont, s_name); 303 RECORDS, s_rd, s_signature, put_cont, s_name);
309 304
305 GNUNET_free (s_signature);
310} 306}
311 307
312static int 308static int