aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/plugin_namestore_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-06 14:18:31 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-06 14:18:31 +0000
commitfe76c075e315c0351e2fe465434ae39087daf014 (patch)
tree436887ccaf331932a3c13a8b9d2a2a710dad4be6 /src/namestore/plugin_namestore_postgres.c
parent7eb2835d8a494c83aedb720a2ac6f6e5ba23f22f (diff)
downloadgnunet-fe76c075e315c0351e2fe465434ae39087daf014.tar.gz
gnunet-fe76c075e315c0351e2fe465434ae39087daf014.zip
moving to new, fixed-size encoding of public and private ECC keys everywhere, also improving ECC API to better support ECRS/GADS operations
Diffstat (limited to 'src/namestore/plugin_namestore_postgres.c')
-rw-r--r--src/namestore/plugin_namestore_postgres.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c
index 070549b33..64bfa631c 100644
--- a/src/namestore/plugin_namestore_postgres.c
+++ b/src/namestore/plugin_namestore_postgres.c
@@ -1,6 +1,6 @@
1 /* 1 /*
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * (C) 2009, 2011, 2012 Christian Grothoff (and other contributing authors) 3 * (C) 2009-2013 Christian Grothoff (and other contributing authors)
4 * 4 *
5 * GNUnet is free software; you can redistribute it and/or modify 5 * GNUnet is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published 6 * it under the terms of the GNU General Public License as published
@@ -269,7 +269,7 @@ namestore_postgres_remove_records (void *cls,
269 */ 269 */
270static int 270static int
271namestore_postgres_put_records (void *cls, 271namestore_postgres_put_records (void *cls,
272 const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, 272 const struct GNUNET_CRYPTO_EccPublicKey *zone_key,
273 struct GNUNET_TIME_Absolute expire, 273 struct GNUNET_TIME_Absolute expire,
274 const char *name, 274 const char *name,
275 unsigned int rd_count, 275 unsigned int rd_count,
@@ -287,7 +287,7 @@ namestore_postgres_put_records (void *cls,
287 unsigned int i; 287 unsigned int i;
288 288
289 GNUNET_CRYPTO_short_hash (zone_key, 289 GNUNET_CRYPTO_short_hash (zone_key,
290 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), 290 sizeof (struct GNUNET_CRYPTO_EccPublicKey),
291 &zone); 291 &zone);
292 (void) namestore_postgres_remove_records (plugin, &zone, name); 292 (void) namestore_postgres_remove_records (plugin, &zone, name);
293 name_len = strlen (name); 293 name_len = strlen (name);
@@ -327,7 +327,7 @@ namestore_postgres_put_records (void *cls,
327 (const char *) &rvalue_be 327 (const char *) &rvalue_be
328 }; 328 };
329 int paramLengths[] = { 329 int paramLengths[] = {
330 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), 330 sizeof (struct GNUNET_CRYPTO_EccPublicKey),
331 name_len, 331 name_len,
332 sizeof (uint32_t), 332 sizeof (uint32_t),
333 data_size, 333 data_size,
@@ -378,7 +378,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
378{ 378{
379 unsigned int record_count; 379 unsigned int record_count;
380 size_t data_size; 380 size_t data_size;
381 const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key; 381 const struct GNUNET_CRYPTO_EccPublicKey *zone_key;
382 const struct GNUNET_CRYPTO_EccSignature *sig; 382 const struct GNUNET_CRYPTO_EccSignature *sig;
383 struct GNUNET_TIME_Absolute expiration; 383 struct GNUNET_TIME_Absolute expiration;
384 const char *data; 384 const char *data;
@@ -406,7 +406,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
406 } 406 }
407 GNUNET_assert (1 == cnt); 407 GNUNET_assert (1 == cnt);
408 if ((6 != PQnfields (res)) || 408 if ((6 != PQnfields (res)) ||
409 (sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) != PQgetlength (res, 0, 0)) || 409 (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != PQgetlength (res, 0, 0)) ||
410 (sizeof (uint32_t) != PQfsize (res, 2)) || 410 (sizeof (uint32_t) != PQfsize (res, 2)) ||
411 (sizeof (uint64_t) != PQfsize (res, 4)) || 411 (sizeof (uint64_t) != PQfsize (res, 4)) ||
412 (sizeof (struct GNUNET_CRYPTO_EccSignature) != PQgetlength (res, 0, 5))) 412 (sizeof (struct GNUNET_CRYPTO_EccSignature) != PQgetlength (res, 0, 5)))
@@ -415,7 +415,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
415 PQclear (res); 415 PQclear (res);
416 return GNUNET_SYSERR; 416 return GNUNET_SYSERR;
417 } 417 }
418 zone_key = (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *) PQgetvalue (res, 0, 0); 418 zone_key = (const struct GNUNET_CRYPTO_EccPublicKey *) PQgetvalue (res, 0, 0);
419 name = PQgetvalue (res, 0, 1); 419 name = PQgetvalue (res, 0, 1);
420 name_len = PQgetlength (res, 0, 1); 420 name_len = PQgetlength (res, 0, 1);
421 record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); 421 record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2));