aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/namestore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/namestore_api.c')
-rw-r--r--src/namestore/namestore_api.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index 2c5efb745..7a4438e30 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -183,7 +183,7 @@ struct GNUNET_NAMESTORE_ZoneIterator
183 /** 183 /**
184 * Private key of the zone. 184 * Private key of the zone.
185 */ 185 */
186 struct GNUNET_IDENTITY_PrivateKey zone; 186 struct GNUNET_CRYPTO_PrivateKey zone;
187 187
188 /** 188 /**
189 * The operation id this zone iteration operation has 189 * The operation id this zone iteration operation has
@@ -448,7 +448,7 @@ handle_lookup_result (void *cls, const struct LabelLookupResponseMessage *msg)
448{ 448{
449 struct GNUNET_NAMESTORE_Handle *h = cls; 449 struct GNUNET_NAMESTORE_Handle *h = cls;
450 struct GNUNET_NAMESTORE_QueueEntry *qe; 450 struct GNUNET_NAMESTORE_QueueEntry *qe;
451 struct GNUNET_IDENTITY_PrivateKey private_key; 451 struct GNUNET_CRYPTO_PrivateKey private_key;
452 const char *name; 452 const char *name;
453 const char *rd_tmp; 453 const char *rd_tmp;
454 size_t name_len; 454 size_t name_len;
@@ -468,7 +468,7 @@ handle_lookup_result (void *cls, const struct LabelLookupResponseMessage *msg)
468 name_len = ntohs (msg->name_len); 468 name_len = ntohs (msg->name_len);
469 key_len = ntohs (msg->key_len); 469 key_len = ntohs (msg->key_len);
470 GNUNET_assert (GNUNET_SYSERR != 470 GNUNET_assert (GNUNET_SYSERR !=
471 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1], 471 GNUNET_CRYPTO_read_private_key_from_buffer (&msg[1],
472 key_len, 472 key_len,
473 &private_key, 473 &private_key,
474 &kbytes_read)); 474 &kbytes_read));
@@ -566,7 +566,7 @@ handle_record_result (void *cls, const struct RecordResultMessage *msg)
566 struct GNUNET_NAMESTORE_Handle *h = cls; 566 struct GNUNET_NAMESTORE_Handle *h = cls;
567 struct GNUNET_NAMESTORE_QueueEntry *qe; 567 struct GNUNET_NAMESTORE_QueueEntry *qe;
568 struct GNUNET_NAMESTORE_ZoneIterator *ze; 568 struct GNUNET_NAMESTORE_ZoneIterator *ze;
569 struct GNUNET_IDENTITY_PrivateKey private_key; 569 struct GNUNET_CRYPTO_PrivateKey private_key;
570 const char *name; 570 const char *name;
571 const char *rd_tmp; 571 const char *rd_tmp;
572 size_t name_len; 572 size_t name_len;
@@ -592,7 +592,7 @@ handle_record_result (void *cls, const struct RecordResultMessage *msg)
592 } 592 }
593 name = (const char *) &msg[1] + key_len; 593 name = (const char *) &msg[1] + key_len;
594 GNUNET_assert (GNUNET_SYSERR != 594 GNUNET_assert (GNUNET_SYSERR !=
595 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1], 595 GNUNET_CRYPTO_read_private_key_from_buffer (&msg[1],
596 key_len, 596 key_len,
597 &private_key, 597 &private_key,
598 &kbytes_read)); 598 &kbytes_read));
@@ -747,7 +747,7 @@ handle_zone_to_name_response (void *cls,
747{ 747{
748 struct GNUNET_NAMESTORE_Handle *h = cls; 748 struct GNUNET_NAMESTORE_Handle *h = cls;
749 struct GNUNET_NAMESTORE_QueueEntry *qe; 749 struct GNUNET_NAMESTORE_QueueEntry *qe;
750 struct GNUNET_IDENTITY_PrivateKey zone; 750 struct GNUNET_CRYPTO_PrivateKey zone;
751 enum GNUNET_ErrorCode res; 751 enum GNUNET_ErrorCode res;
752 size_t name_len; 752 size_t name_len;
753 size_t rd_ser_len; 753 size_t rd_ser_len;
@@ -768,7 +768,7 @@ handle_zone_to_name_response (void *cls,
768 res = ntohl (msg->ec); 768 res = ntohl (msg->ec);
769 key_len = ntohs (msg->key_len); 769 key_len = ntohs (msg->key_len);
770 GNUNET_assert (GNUNET_SYSERR != 770 GNUNET_assert (GNUNET_SYSERR !=
771 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1], 771 GNUNET_CRYPTO_read_private_key_from_buffer (&msg[1],
772 key_len, 772 key_len,
773 &zone, 773 &zone,
774 &kbytes_read)); 774 &kbytes_read));
@@ -1050,7 +1050,7 @@ warn_delay (void *cls)
1050struct GNUNET_NAMESTORE_QueueEntry * 1050struct GNUNET_NAMESTORE_QueueEntry *
1051GNUNET_NAMESTORE_records_store ( 1051GNUNET_NAMESTORE_records_store (
1052 struct GNUNET_NAMESTORE_Handle *h, 1052 struct GNUNET_NAMESTORE_Handle *h,
1053 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1053 const struct GNUNET_CRYPTO_PrivateKey *pkey,
1054 const char *label, 1054 const char *label,
1055 unsigned int rd_count, 1055 unsigned int rd_count,
1056 const struct GNUNET_GNSRECORD_Data *rd, 1056 const struct GNUNET_GNSRECORD_Data *rd,
@@ -1069,7 +1069,7 @@ GNUNET_NAMESTORE_records_store (
1069struct GNUNET_NAMESTORE_QueueEntry * 1069struct GNUNET_NAMESTORE_QueueEntry *
1070GNUNET_NAMESTORE_records_store2 ( 1070GNUNET_NAMESTORE_records_store2 (
1071 struct GNUNET_NAMESTORE_Handle *h, 1071 struct GNUNET_NAMESTORE_Handle *h,
1072 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1072 const struct GNUNET_CRYPTO_PrivateKey *pkey,
1073 unsigned int rd_set_count, 1073 unsigned int rd_set_count,
1074 const struct GNUNET_NAMESTORE_RecordInfo *record_info, 1074 const struct GNUNET_NAMESTORE_RecordInfo *record_info,
1075 unsigned int *rds_sent, 1075 unsigned int *rds_sent,
@@ -1093,7 +1093,7 @@ GNUNET_NAMESTORE_records_store2 (
1093 size_t rd_set_len = 0; 1093 size_t rd_set_len = 0;
1094 size_t key_len = 0; 1094 size_t key_len = 0;
1095 size_t max_len; 1095 size_t max_len;
1096 key_len = GNUNET_IDENTITY_private_key_get_length (pkey); 1096 key_len = GNUNET_CRYPTO_private_key_get_length (pkey);
1097 max_len = UINT16_MAX - key_len - sizeof (struct RecordStoreMessage); 1097 max_len = UINT16_MAX - key_len - sizeof (struct RecordStoreMessage);
1098 1098
1099 *rds_sent = 0; 1099 *rds_sent = 0;
@@ -1146,7 +1146,7 @@ GNUNET_NAMESTORE_records_store2 (
1146 msg->gns_header.r_id = htonl (rid); 1146 msg->gns_header.r_id = htonl (rid);
1147 msg->key_len = htons (key_len); 1147 msg->key_len = htons (key_len);
1148 msg->rd_set_count = htons ((uint16_t) (*rds_sent)); 1148 msg->rd_set_count = htons ((uint16_t) (*rds_sent));
1149 GNUNET_IDENTITY_write_private_key_to_buffer (pkey, 1149 GNUNET_CRYPTO_write_private_key_to_buffer (pkey,
1150 &msg[1], 1150 &msg[1],
1151 key_len); 1151 key_len);
1152 rd_set = (struct RecordSet*) (((char*) &msg[1]) + key_len); 1152 rd_set = (struct RecordSet*) (((char*) &msg[1]) + key_len);
@@ -1195,7 +1195,7 @@ GNUNET_NAMESTORE_records_store2 (
1195static struct GNUNET_NAMESTORE_QueueEntry * 1195static struct GNUNET_NAMESTORE_QueueEntry *
1196records_lookup ( 1196records_lookup (
1197 struct GNUNET_NAMESTORE_Handle *h, 1197 struct GNUNET_NAMESTORE_Handle *h,
1198 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1198 const struct GNUNET_CRYPTO_PrivateKey *pkey,
1199 const char *label, 1199 const char *label,
1200 GNUNET_SCHEDULER_TaskCallback error_cb, 1200 GNUNET_SCHEDULER_TaskCallback error_cb,
1201 void *error_cb_cls, 1201 void *error_cb_cls,
@@ -1225,12 +1225,12 @@ records_lookup (
1225 qe->op_id = get_op_id (h); 1225 qe->op_id = get_op_id (h);
1226 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); 1226 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe);
1227 1227
1228 key_len = GNUNET_IDENTITY_private_key_get_length (pkey); 1228 key_len = GNUNET_CRYPTO_private_key_get_length (pkey);
1229 env = GNUNET_MQ_msg_extra (msg, 1229 env = GNUNET_MQ_msg_extra (msg,
1230 label_len + key_len, 1230 label_len + key_len,
1231 GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP); 1231 GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP);
1232 msg->gns_header.r_id = htonl (qe->op_id); 1232 msg->gns_header.r_id = htonl (qe->op_id);
1233 GNUNET_IDENTITY_write_private_key_to_buffer (pkey, 1233 GNUNET_CRYPTO_write_private_key_to_buffer (pkey,
1234 &msg[1], 1234 &msg[1],
1235 key_len); 1235 key_len);
1236 1236
@@ -1249,7 +1249,7 @@ records_lookup (
1249struct GNUNET_NAMESTORE_QueueEntry * 1249struct GNUNET_NAMESTORE_QueueEntry *
1250GNUNET_NAMESTORE_records_lookup ( 1250GNUNET_NAMESTORE_records_lookup (
1251 struct GNUNET_NAMESTORE_Handle *h, 1251 struct GNUNET_NAMESTORE_Handle *h,
1252 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1252 const struct GNUNET_CRYPTO_PrivateKey *pkey,
1253 const char *label, 1253 const char *label,
1254 GNUNET_SCHEDULER_TaskCallback error_cb, 1254 GNUNET_SCHEDULER_TaskCallback error_cb,
1255 void *error_cb_cls, 1255 void *error_cb_cls,
@@ -1265,7 +1265,7 @@ GNUNET_NAMESTORE_records_lookup (
1265struct GNUNET_NAMESTORE_QueueEntry * 1265struct GNUNET_NAMESTORE_QueueEntry *
1266GNUNET_NAMESTORE_records_lookup2 ( 1266GNUNET_NAMESTORE_records_lookup2 (
1267 struct GNUNET_NAMESTORE_Handle *h, 1267 struct GNUNET_NAMESTORE_Handle *h,
1268 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1268 const struct GNUNET_CRYPTO_PrivateKey *pkey,
1269 const char *label, 1269 const char *label,
1270 GNUNET_SCHEDULER_TaskCallback error_cb, 1270 GNUNET_SCHEDULER_TaskCallback error_cb,
1271 void *error_cb_cls, 1271 void *error_cb_cls,
@@ -1283,7 +1283,7 @@ GNUNET_NAMESTORE_records_lookup2 (
1283struct GNUNET_NAMESTORE_QueueEntry * 1283struct GNUNET_NAMESTORE_QueueEntry *
1284GNUNET_NAMESTORE_records_edit ( 1284GNUNET_NAMESTORE_records_edit (
1285 struct GNUNET_NAMESTORE_Handle *h, 1285 struct GNUNET_NAMESTORE_Handle *h,
1286 const struct GNUNET_IDENTITY_PrivateKey *pkey, 1286 const struct GNUNET_CRYPTO_PrivateKey *pkey,
1287 const char *label, 1287 const char *label,
1288 GNUNET_SCHEDULER_TaskCallback error_cb, 1288 GNUNET_SCHEDULER_TaskCallback error_cb,
1289 void *error_cb_cls, 1289 void *error_cb_cls,
@@ -1298,8 +1298,8 @@ GNUNET_NAMESTORE_records_edit (
1298struct GNUNET_NAMESTORE_QueueEntry * 1298struct GNUNET_NAMESTORE_QueueEntry *
1299GNUNET_NAMESTORE_zone_to_name ( 1299GNUNET_NAMESTORE_zone_to_name (
1300 struct GNUNET_NAMESTORE_Handle *h, 1300 struct GNUNET_NAMESTORE_Handle *h,
1301 const struct GNUNET_IDENTITY_PrivateKey *zone, 1301 const struct GNUNET_CRYPTO_PrivateKey *zone,
1302 const struct GNUNET_IDENTITY_PublicKey *value_zone, 1302 const struct GNUNET_CRYPTO_PublicKey *value_zone,
1303 GNUNET_SCHEDULER_TaskCallback error_cb, 1303 GNUNET_SCHEDULER_TaskCallback error_cb,
1304 void *error_cb_cls, 1304 void *error_cb_cls,
1305 GNUNET_NAMESTORE_RecordMonitor proc, 1305 GNUNET_NAMESTORE_RecordMonitor proc,
@@ -1322,15 +1322,15 @@ GNUNET_NAMESTORE_zone_to_name (
1322 qe->op_id = rid; 1322 qe->op_id = rid;
1323 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); 1323 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe);
1324 1324
1325 key_len = GNUNET_IDENTITY_private_key_get_length (zone); 1325 key_len = GNUNET_CRYPTO_private_key_get_length (zone);
1326 pkey_len = GNUNET_IDENTITY_public_key_get_length (value_zone); 1326 pkey_len = GNUNET_CRYPTO_public_key_get_length (value_zone);
1327 env = GNUNET_MQ_msg_extra (msg, key_len + pkey_len, 1327 env = GNUNET_MQ_msg_extra (msg, key_len + pkey_len,
1328 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME); 1328 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME);
1329 msg->gns_header.r_id = htonl (rid); 1329 msg->gns_header.r_id = htonl (rid);
1330 msg->key_len = htons (key_len); 1330 msg->key_len = htons (key_len);
1331 msg->pkey_len = htons (pkey_len); 1331 msg->pkey_len = htons (pkey_len);
1332 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len); 1332 GNUNET_CRYPTO_write_private_key_to_buffer (zone, &msg[1], key_len);
1333 GNUNET_IDENTITY_write_public_key_to_buffer (value_zone, 1333 GNUNET_CRYPTO_write_public_key_to_buffer (value_zone,
1334 (char*) &msg[1] + key_len, 1334 (char*) &msg[1] + key_len,
1335 pkey_len); 1335 pkey_len);
1336 if (NULL == h->mq) 1336 if (NULL == h->mq)
@@ -1344,7 +1344,7 @@ GNUNET_NAMESTORE_zone_to_name (
1344struct GNUNET_NAMESTORE_ZoneIterator * 1344struct GNUNET_NAMESTORE_ZoneIterator *
1345GNUNET_NAMESTORE_zone_iteration_start ( 1345GNUNET_NAMESTORE_zone_iteration_start (
1346 struct GNUNET_NAMESTORE_Handle *h, 1346 struct GNUNET_NAMESTORE_Handle *h,
1347 const struct GNUNET_IDENTITY_PrivateKey *zone, 1347 const struct GNUNET_CRYPTO_PrivateKey *zone,
1348 GNUNET_SCHEDULER_TaskCallback error_cb, 1348 GNUNET_SCHEDULER_TaskCallback error_cb,
1349 void *error_cb_cls, 1349 void *error_cb_cls,
1350 GNUNET_NAMESTORE_RecordMonitor proc, 1350 GNUNET_NAMESTORE_RecordMonitor proc,
@@ -1372,7 +1372,7 @@ GNUNET_NAMESTORE_zone_iteration_start (
1372 if (NULL != zone) 1372 if (NULL != zone)
1373 { 1373 {
1374 it->zone = *zone; 1374 it->zone = *zone;
1375 key_len = GNUNET_IDENTITY_private_key_get_length (zone); 1375 key_len = GNUNET_CRYPTO_private_key_get_length (zone);
1376 } 1376 }
1377 GNUNET_CONTAINER_DLL_insert_tail (h->z_head, h->z_tail, it); 1377 GNUNET_CONTAINER_DLL_insert_tail (h->z_head, h->z_tail, it);
1378 env = GNUNET_MQ_msg_extra (msg, 1378 env = GNUNET_MQ_msg_extra (msg,
@@ -1381,7 +1381,7 @@ GNUNET_NAMESTORE_zone_iteration_start (
1381 msg->gns_header.r_id = htonl (rid); 1381 msg->gns_header.r_id = htonl (rid);
1382 msg->key_len = htons (key_len); 1382 msg->key_len = htons (key_len);
1383 if (NULL != zone) 1383 if (NULL != zone)
1384 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len); 1384 GNUNET_CRYPTO_write_private_key_to_buffer (zone, &msg[1], key_len);
1385 if (NULL == h->mq) 1385 if (NULL == h->mq)
1386 it->env = env; 1386 it->env = env;
1387 else 1387 else
@@ -1392,7 +1392,7 @@ GNUNET_NAMESTORE_zone_iteration_start (
1392struct GNUNET_NAMESTORE_ZoneIterator * 1392struct GNUNET_NAMESTORE_ZoneIterator *
1393GNUNET_NAMESTORE_zone_iteration_start2 ( 1393GNUNET_NAMESTORE_zone_iteration_start2 (
1394 struct GNUNET_NAMESTORE_Handle *h, 1394 struct GNUNET_NAMESTORE_Handle *h,
1395 const struct GNUNET_IDENTITY_PrivateKey *zone, 1395 const struct GNUNET_CRYPTO_PrivateKey *zone,
1396 GNUNET_SCHEDULER_TaskCallback error_cb, 1396 GNUNET_SCHEDULER_TaskCallback error_cb,
1397 void *error_cb_cls, 1397 void *error_cb_cls,
1398 GNUNET_NAMESTORE_RecordSetMonitor proc, 1398 GNUNET_NAMESTORE_RecordSetMonitor proc,
@@ -1421,7 +1421,7 @@ GNUNET_NAMESTORE_zone_iteration_start2 (
1421 if (NULL != zone) 1421 if (NULL != zone)
1422 { 1422 {
1423 it->zone = *zone; 1423 it->zone = *zone;
1424 key_len = GNUNET_IDENTITY_private_key_get_length (zone); 1424 key_len = GNUNET_CRYPTO_private_key_get_length (zone);
1425 } 1425 }
1426 GNUNET_CONTAINER_DLL_insert_tail (h->z_head, h->z_tail, it); 1426 GNUNET_CONTAINER_DLL_insert_tail (h->z_head, h->z_tail, it);
1427 env = GNUNET_MQ_msg_extra (msg, 1427 env = GNUNET_MQ_msg_extra (msg,
@@ -1431,7 +1431,7 @@ GNUNET_NAMESTORE_zone_iteration_start2 (
1431 msg->key_len = htons (key_len); 1431 msg->key_len = htons (key_len);
1432 msg->filter = htons ((uint16_t) filter); 1432 msg->filter = htons ((uint16_t) filter);
1433 if (NULL != zone) 1433 if (NULL != zone)
1434 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len); 1434 GNUNET_CRYPTO_write_private_key_to_buffer (zone, &msg[1], key_len);
1435 if (NULL == h->mq) 1435 if (NULL == h->mq)
1436 it->env = env; 1436 it->env = env;
1437 else 1437 else