diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-01 16:31:20 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-01 16:31:20 +0000 |
commit | c8ee017f28ce9c5f59bdae20bd2f9c0a6c4146a7 (patch) | |
tree | 485efac43580ff0ee16164697561b11cac5a1531 /src/namestore/test_namestore_api_remove_not_existing_record.c | |
parent | 9121b5fdbb38b5ee48695edf5c45bfca1eeb0a29 (diff) | |
download | gnunet-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.c | 12 |
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 | ||
48 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 48 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; |
49 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 49 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; |
50 | struct GNUNET_CRYPTO_RsaSignature s_signature; | 50 | struct GNUNET_CRYPTO_RsaSignature *s_signature; |
51 | static GNUNET_HashCode s_zone; | 51 | static GNUNET_HashCode s_zone; |
52 | struct GNUNET_NAMESTORE_RecordData *s_rd; | 52 | struct GNUNET_NAMESTORE_RecordData *s_rd; |
53 | static char *s_name; | 53 | static 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 | ||
312 | static int | 308 | static int |