diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-10-18 13:37:38 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-10-18 13:37:38 +0200 |
commit | 9ef4abad615bea12d13be542b8ae5fbeb2dfee32 (patch) | |
tree | 8875a687e004d331c9ea6a1d511a328c72b88113 /src/reclaim/reclaim_api.c | |
parent | e95236b3ed78cd597c15f34b89385295702b627f (diff) | |
download | gnunet-9ef4abad615bea12d13be542b8ae5fbeb2dfee32.tar.gz gnunet-9ef4abad615bea12d13be542b8ae5fbeb2dfee32.zip |
NEWS: Refactoring components under src/ into lib/, plugin/, cli/ and service/
This also includes a necessary API refactoring of crypto from IDENTITY
to UTIL.
Diffstat (limited to 'src/reclaim/reclaim_api.c')
-rw-r--r-- | src/reclaim/reclaim_api.c | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index fedee3fff..e9a34dd95 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c | |||
@@ -234,7 +234,7 @@ struct GNUNET_RECLAIM_AttributeIterator | |||
234 | /** | 234 | /** |
235 | * Private key of the zone. | 235 | * Private key of the zone. |
236 | */ | 236 | */ |
237 | struct GNUNET_IDENTITY_PrivateKey identity; | 237 | struct GNUNET_CRYPTO_PrivateKey identity; |
238 | 238 | ||
239 | /** | 239 | /** |
240 | * The operation id this zone iteration operation has | 240 | * The operation id this zone iteration operation has |
@@ -301,7 +301,7 @@ struct GNUNET_RECLAIM_CredentialIterator | |||
301 | /** | 301 | /** |
302 | * Private key of the zone. | 302 | * Private key of the zone. |
303 | */ | 303 | */ |
304 | struct GNUNET_IDENTITY_PrivateKey identity; | 304 | struct GNUNET_CRYPTO_PrivateKey identity; |
305 | 305 | ||
306 | /** | 306 | /** |
307 | * The operation id this zone iteration operation has | 307 | * The operation id this zone iteration operation has |
@@ -592,7 +592,7 @@ static void | |||
592 | handle_consume_ticket_result (void *cls, | 592 | handle_consume_ticket_result (void *cls, |
593 | const struct ConsumeTicketResultMessage *msg) | 593 | const struct ConsumeTicketResultMessage *msg) |
594 | { | 594 | { |
595 | struct GNUNET_IDENTITY_PublicKey identity; | 595 | struct GNUNET_CRYPTO_PublicKey identity; |
596 | struct GNUNET_RECLAIM_Handle *h = cls; | 596 | struct GNUNET_RECLAIM_Handle *h = cls; |
597 | struct GNUNET_RECLAIM_Operation *op; | 597 | struct GNUNET_RECLAIM_Operation *op; |
598 | size_t attrs_len; | 598 | size_t attrs_len; |
@@ -621,7 +621,7 @@ handle_consume_ticket_result (void *cls, | |||
621 | struct GNUNET_RECLAIM_PresentationListEntry *ple; | 621 | struct GNUNET_RECLAIM_PresentationListEntry *ple; |
622 | read_ptr = (char *) &msg[1]; | 622 | read_ptr = (char *) &msg[1]; |
623 | GNUNET_assert (GNUNET_SYSERR != | 623 | GNUNET_assert (GNUNET_SYSERR != |
624 | GNUNET_IDENTITY_read_public_key_from_buffer (read_ptr, | 624 | GNUNET_CRYPTO_read_public_key_from_buffer (read_ptr, |
625 | key_len, | 625 | key_len, |
626 | &identity, | 626 | &identity, |
627 | &read)); | 627 | &read)); |
@@ -714,7 +714,7 @@ check_attribute_result (void *cls, const struct AttributeResultMessage *msg) | |||
714 | static void | 714 | static void |
715 | handle_attribute_result (void *cls, const struct AttributeResultMessage *msg) | 715 | handle_attribute_result (void *cls, const struct AttributeResultMessage *msg) |
716 | { | 716 | { |
717 | static struct GNUNET_IDENTITY_PublicKey identity; | 717 | static struct GNUNET_CRYPTO_PublicKey identity; |
718 | struct GNUNET_RECLAIM_Handle *h = cls; | 718 | struct GNUNET_RECLAIM_Handle *h = cls; |
719 | struct GNUNET_RECLAIM_AttributeIterator *it; | 719 | struct GNUNET_RECLAIM_AttributeIterator *it; |
720 | struct GNUNET_RECLAIM_Operation *op; | 720 | struct GNUNET_RECLAIM_Operation *op; |
@@ -765,7 +765,7 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg) | |||
765 | { | 765 | { |
766 | struct GNUNET_RECLAIM_Attribute *attr; | 766 | struct GNUNET_RECLAIM_Attribute *attr; |
767 | GNUNET_assert (GNUNET_SYSERR != | 767 | GNUNET_assert (GNUNET_SYSERR != |
768 | GNUNET_IDENTITY_read_public_key_from_buffer (buf, | 768 | GNUNET_CRYPTO_read_public_key_from_buffer (buf, |
769 | key_len, | 769 | key_len, |
770 | &identity, | 770 | &identity, |
771 | &read)); | 771 | &read)); |
@@ -826,7 +826,7 @@ static void | |||
826 | handle_credential_result (void *cls, const struct | 826 | handle_credential_result (void *cls, const struct |
827 | CredentialResultMessage *msg) | 827 | CredentialResultMessage *msg) |
828 | { | 828 | { |
829 | struct GNUNET_IDENTITY_PublicKey identity; | 829 | struct GNUNET_CRYPTO_PublicKey identity; |
830 | struct GNUNET_RECLAIM_Handle *h = cls; | 830 | struct GNUNET_RECLAIM_Handle *h = cls; |
831 | struct GNUNET_RECLAIM_CredentialIterator *it; | 831 | struct GNUNET_RECLAIM_CredentialIterator *it; |
832 | struct GNUNET_RECLAIM_Operation *op; | 832 | struct GNUNET_RECLAIM_Operation *op; |
@@ -854,7 +854,7 @@ handle_credential_result (void *cls, const struct | |||
854 | if (0 < key_len) | 854 | if (0 < key_len) |
855 | { | 855 | { |
856 | GNUNET_assert (GNUNET_SYSERR != | 856 | GNUNET_assert (GNUNET_SYSERR != |
857 | GNUNET_IDENTITY_read_public_key_from_buffer (buf, | 857 | GNUNET_CRYPTO_read_public_key_from_buffer (buf, |
858 | key_len, | 858 | key_len, |
859 | &identity, | 859 | &identity, |
860 | &read)); | 860 | &read)); |
@@ -1161,7 +1161,7 @@ GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h) | |||
1161 | struct GNUNET_RECLAIM_Operation * | 1161 | struct GNUNET_RECLAIM_Operation * |
1162 | GNUNET_RECLAIM_attribute_store ( | 1162 | GNUNET_RECLAIM_attribute_store ( |
1163 | struct GNUNET_RECLAIM_Handle *h, | 1163 | struct GNUNET_RECLAIM_Handle *h, |
1164 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | 1164 | const struct GNUNET_CRYPTO_PrivateKey *pkey, |
1165 | const struct GNUNET_RECLAIM_Attribute *attr, | 1165 | const struct GNUNET_RECLAIM_Attribute *attr, |
1166 | const struct GNUNET_TIME_Relative *exp_interval, | 1166 | const struct GNUNET_TIME_Relative *exp_interval, |
1167 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 1167 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
@@ -1180,14 +1180,14 @@ GNUNET_RECLAIM_attribute_store ( | |||
1180 | op->cls = cont_cls; | 1180 | op->cls = cont_cls; |
1181 | op->r_id = h->r_id_gen++; | 1181 | op->r_id = h->r_id_gen++; |
1182 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1182 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1183 | key_len = GNUNET_IDENTITY_private_key_get_length (pkey); | 1183 | key_len = GNUNET_CRYPTO_private_key_get_length (pkey); |
1184 | attr_len = GNUNET_RECLAIM_attribute_serialize_get_size (attr); | 1184 | attr_len = GNUNET_RECLAIM_attribute_serialize_get_size (attr); |
1185 | op->env = GNUNET_MQ_msg_extra (sam, | 1185 | op->env = GNUNET_MQ_msg_extra (sam, |
1186 | attr_len + key_len, | 1186 | attr_len + key_len, |
1187 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE); | 1187 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE); |
1188 | sam->key_len = htons (key_len); | 1188 | sam->key_len = htons (key_len); |
1189 | buf = (char *) &sam[1]; | 1189 | buf = (char *) &sam[1]; |
1190 | written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); | 1190 | written = GNUNET_CRYPTO_write_private_key_to_buffer (pkey, buf, key_len); |
1191 | GNUNET_assert (0 < written); | 1191 | GNUNET_assert (0 < written); |
1192 | buf += written; | 1192 | buf += written; |
1193 | sam->id = htonl (op->r_id); | 1193 | sam->id = htonl (op->r_id); |
@@ -1205,7 +1205,7 @@ GNUNET_RECLAIM_attribute_store ( | |||
1205 | struct GNUNET_RECLAIM_Operation * | 1205 | struct GNUNET_RECLAIM_Operation * |
1206 | GNUNET_RECLAIM_attribute_delete ( | 1206 | GNUNET_RECLAIM_attribute_delete ( |
1207 | struct GNUNET_RECLAIM_Handle *h, | 1207 | struct GNUNET_RECLAIM_Handle *h, |
1208 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | 1208 | const struct GNUNET_CRYPTO_PrivateKey *pkey, |
1209 | const struct GNUNET_RECLAIM_Attribute *attr, | 1209 | const struct GNUNET_RECLAIM_Attribute *attr, |
1210 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 1210 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
1211 | void *cont_cls) | 1211 | void *cont_cls) |
@@ -1223,14 +1223,14 @@ GNUNET_RECLAIM_attribute_delete ( | |||
1223 | op->cls = cont_cls; | 1223 | op->cls = cont_cls; |
1224 | op->r_id = h->r_id_gen++; | 1224 | op->r_id = h->r_id_gen++; |
1225 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1225 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1226 | key_len = GNUNET_IDENTITY_private_key_get_length (pkey); | 1226 | key_len = GNUNET_CRYPTO_private_key_get_length (pkey); |
1227 | attr_len = GNUNET_RECLAIM_attribute_serialize_get_size (attr); | 1227 | attr_len = GNUNET_RECLAIM_attribute_serialize_get_size (attr); |
1228 | op->env = GNUNET_MQ_msg_extra (dam, | 1228 | op->env = GNUNET_MQ_msg_extra (dam, |
1229 | attr_len + key_len, | 1229 | attr_len + key_len, |
1230 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE); | 1230 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE); |
1231 | dam->key_len = htons (key_len); | 1231 | dam->key_len = htons (key_len); |
1232 | buf = (char *) &dam[1]; | 1232 | buf = (char *) &dam[1]; |
1233 | written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); | 1233 | written = GNUNET_CRYPTO_write_private_key_to_buffer (pkey, buf, key_len); |
1234 | GNUNET_assert (0 < written); | 1234 | GNUNET_assert (0 < written); |
1235 | buf += written; | 1235 | buf += written; |
1236 | dam->id = htonl (op->r_id); | 1236 | dam->id = htonl (op->r_id); |
@@ -1246,7 +1246,7 @@ GNUNET_RECLAIM_attribute_delete ( | |||
1246 | struct GNUNET_RECLAIM_Operation * | 1246 | struct GNUNET_RECLAIM_Operation * |
1247 | GNUNET_RECLAIM_credential_store ( | 1247 | GNUNET_RECLAIM_credential_store ( |
1248 | struct GNUNET_RECLAIM_Handle *h, | 1248 | struct GNUNET_RECLAIM_Handle *h, |
1249 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | 1249 | const struct GNUNET_CRYPTO_PrivateKey *pkey, |
1250 | const struct GNUNET_RECLAIM_Credential *credential, | 1250 | const struct GNUNET_RECLAIM_Credential *credential, |
1251 | const struct GNUNET_TIME_Relative *exp_interval, | 1251 | const struct GNUNET_TIME_Relative *exp_interval, |
1252 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 1252 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
@@ -1264,7 +1264,7 @@ GNUNET_RECLAIM_credential_store ( | |||
1264 | op->as_cb = cont; | 1264 | op->as_cb = cont; |
1265 | op->cls = cont_cls; | 1265 | op->cls = cont_cls; |
1266 | op->r_id = h->r_id_gen++; | 1266 | op->r_id = h->r_id_gen++; |
1267 | key_len = GNUNET_IDENTITY_private_key_get_length (pkey); | 1267 | key_len = GNUNET_CRYPTO_private_key_get_length (pkey); |
1268 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1268 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1269 | attr_len = GNUNET_RECLAIM_credential_serialize_get_size (credential); | 1269 | attr_len = GNUNET_RECLAIM_credential_serialize_get_size (credential); |
1270 | op->env = GNUNET_MQ_msg_extra (sam, | 1270 | op->env = GNUNET_MQ_msg_extra (sam, |
@@ -1272,7 +1272,7 @@ GNUNET_RECLAIM_credential_store ( | |||
1272 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE); | 1272 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE); |
1273 | sam->key_len = htons (key_len); | 1273 | sam->key_len = htons (key_len); |
1274 | buf = (char *) &sam[1]; | 1274 | buf = (char *) &sam[1]; |
1275 | written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); | 1275 | written = GNUNET_CRYPTO_write_private_key_to_buffer (pkey, buf, key_len); |
1276 | GNUNET_assert (0 <= written); | 1276 | GNUNET_assert (0 <= written); |
1277 | buf += written; | 1277 | buf += written; |
1278 | sam->id = htonl (op->r_id); | 1278 | sam->id = htonl (op->r_id); |
@@ -1290,7 +1290,7 @@ GNUNET_RECLAIM_credential_store ( | |||
1290 | struct GNUNET_RECLAIM_Operation * | 1290 | struct GNUNET_RECLAIM_Operation * |
1291 | GNUNET_RECLAIM_credential_delete ( | 1291 | GNUNET_RECLAIM_credential_delete ( |
1292 | struct GNUNET_RECLAIM_Handle *h, | 1292 | struct GNUNET_RECLAIM_Handle *h, |
1293 | const struct GNUNET_IDENTITY_PrivateKey *pkey, | 1293 | const struct GNUNET_CRYPTO_PrivateKey *pkey, |
1294 | const struct GNUNET_RECLAIM_Credential *attr, | 1294 | const struct GNUNET_RECLAIM_Credential *attr, |
1295 | GNUNET_RECLAIM_ContinuationWithStatus cont, | 1295 | GNUNET_RECLAIM_ContinuationWithStatus cont, |
1296 | void *cont_cls) | 1296 | void *cont_cls) |
@@ -1307,7 +1307,7 @@ GNUNET_RECLAIM_credential_delete ( | |||
1307 | op->as_cb = cont; | 1307 | op->as_cb = cont; |
1308 | op->cls = cont_cls; | 1308 | op->cls = cont_cls; |
1309 | op->r_id = h->r_id_gen++; | 1309 | op->r_id = h->r_id_gen++; |
1310 | key_len = GNUNET_IDENTITY_private_key_get_length (pkey); | 1310 | key_len = GNUNET_CRYPTO_private_key_get_length (pkey); |
1311 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1311 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1312 | attr_len = GNUNET_RECLAIM_credential_serialize_get_size (attr); | 1312 | attr_len = GNUNET_RECLAIM_credential_serialize_get_size (attr); |
1313 | op->env = GNUNET_MQ_msg_extra (dam, | 1313 | op->env = GNUNET_MQ_msg_extra (dam, |
@@ -1315,7 +1315,7 @@ GNUNET_RECLAIM_credential_delete ( | |||
1315 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE); | 1315 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE); |
1316 | dam->key_len = htons (key_len); | 1316 | dam->key_len = htons (key_len); |
1317 | buf = (char *) &dam[1]; | 1317 | buf = (char *) &dam[1]; |
1318 | written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); | 1318 | written = GNUNET_CRYPTO_write_private_key_to_buffer (pkey, buf, key_len); |
1319 | GNUNET_assert (0 <= written); | 1319 | GNUNET_assert (0 <= written); |
1320 | buf += written; | 1320 | buf += written; |
1321 | dam->id = htonl (op->r_id); | 1321 | dam->id = htonl (op->r_id); |
@@ -1331,7 +1331,7 @@ GNUNET_RECLAIM_credential_delete ( | |||
1331 | struct GNUNET_RECLAIM_AttributeIterator * | 1331 | struct GNUNET_RECLAIM_AttributeIterator * |
1332 | GNUNET_RECLAIM_get_attributes_start ( | 1332 | GNUNET_RECLAIM_get_attributes_start ( |
1333 | struct GNUNET_RECLAIM_Handle *h, | 1333 | struct GNUNET_RECLAIM_Handle *h, |
1334 | const struct GNUNET_IDENTITY_PrivateKey *identity, | 1334 | const struct GNUNET_CRYPTO_PrivateKey *identity, |
1335 | GNUNET_SCHEDULER_TaskCallback error_cb, | 1335 | GNUNET_SCHEDULER_TaskCallback error_cb, |
1336 | void *error_cb_cls, | 1336 | void *error_cb_cls, |
1337 | GNUNET_RECLAIM_AttributeResult proc, | 1337 | GNUNET_RECLAIM_AttributeResult proc, |
@@ -1356,7 +1356,7 @@ GNUNET_RECLAIM_get_attributes_start ( | |||
1356 | it->proc_cls = proc_cls; | 1356 | it->proc_cls = proc_cls; |
1357 | it->r_id = rid; | 1357 | it->r_id = rid; |
1358 | it->identity = *identity; | 1358 | it->identity = *identity; |
1359 | key_len = GNUNET_IDENTITY_private_key_get_length (identity); | 1359 | key_len = GNUNET_CRYPTO_private_key_get_length (identity); |
1360 | GNUNET_CONTAINER_DLL_insert_tail (h->it_head, h->it_tail, it); | 1360 | GNUNET_CONTAINER_DLL_insert_tail (h->it_head, h->it_tail, it); |
1361 | env = | 1361 | env = |
1362 | GNUNET_MQ_msg_extra (msg, | 1362 | GNUNET_MQ_msg_extra (msg, |
@@ -1364,7 +1364,7 @@ GNUNET_RECLAIM_get_attributes_start ( | |||
1364 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START); | 1364 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START); |
1365 | msg->id = htonl (rid); | 1365 | msg->id = htonl (rid); |
1366 | msg->key_len = htons (key_len); | 1366 | msg->key_len = htons (key_len); |
1367 | GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len); | 1367 | GNUNET_CRYPTO_write_private_key_to_buffer (identity, &msg[1], key_len); |
1368 | if (NULL == h->mq) | 1368 | if (NULL == h->mq) |
1369 | it->env = env; | 1369 | it->env = env; |
1370 | else | 1370 | else |
@@ -1408,7 +1408,7 @@ GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it) | |||
1408 | struct GNUNET_RECLAIM_CredentialIterator * | 1408 | struct GNUNET_RECLAIM_CredentialIterator * |
1409 | GNUNET_RECLAIM_get_credentials_start ( | 1409 | GNUNET_RECLAIM_get_credentials_start ( |
1410 | struct GNUNET_RECLAIM_Handle *h, | 1410 | struct GNUNET_RECLAIM_Handle *h, |
1411 | const struct GNUNET_IDENTITY_PrivateKey *identity, | 1411 | const struct GNUNET_CRYPTO_PrivateKey *identity, |
1412 | GNUNET_SCHEDULER_TaskCallback error_cb, | 1412 | GNUNET_SCHEDULER_TaskCallback error_cb, |
1413 | void *error_cb_cls, | 1413 | void *error_cb_cls, |
1414 | GNUNET_RECLAIM_CredentialResult proc, | 1414 | GNUNET_RECLAIM_CredentialResult proc, |
@@ -1433,7 +1433,7 @@ GNUNET_RECLAIM_get_credentials_start ( | |||
1433 | ait->proc_cls = proc_cls; | 1433 | ait->proc_cls = proc_cls; |
1434 | ait->r_id = rid; | 1434 | ait->r_id = rid; |
1435 | ait->identity = *identity; | 1435 | ait->identity = *identity; |
1436 | key_len = GNUNET_IDENTITY_private_key_get_length (identity); | 1436 | key_len = GNUNET_CRYPTO_private_key_get_length (identity); |
1437 | GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait); | 1437 | GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait); |
1438 | env = | 1438 | env = |
1439 | GNUNET_MQ_msg_extra (msg, | 1439 | GNUNET_MQ_msg_extra (msg, |
@@ -1441,7 +1441,7 @@ GNUNET_RECLAIM_get_credentials_start ( | |||
1441 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START); | 1441 | GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START); |
1442 | msg->id = htonl (rid); | 1442 | msg->id = htonl (rid); |
1443 | msg->key_len = htons (key_len); | 1443 | msg->key_len = htons (key_len); |
1444 | GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len); | 1444 | GNUNET_CRYPTO_write_private_key_to_buffer (identity, &msg[1], key_len); |
1445 | if (NULL == h->mq) | 1445 | if (NULL == h->mq) |
1446 | ait->env = env; | 1446 | ait->env = env; |
1447 | else | 1447 | else |
@@ -1488,8 +1488,8 @@ GNUNET_RECLAIM_get_credentials_stop (struct | |||
1488 | struct GNUNET_RECLAIM_Operation * | 1488 | struct GNUNET_RECLAIM_Operation * |
1489 | GNUNET_RECLAIM_ticket_issue ( | 1489 | GNUNET_RECLAIM_ticket_issue ( |
1490 | struct GNUNET_RECLAIM_Handle *h, | 1490 | struct GNUNET_RECLAIM_Handle *h, |
1491 | const struct GNUNET_IDENTITY_PrivateKey *iss, | 1491 | const struct GNUNET_CRYPTO_PrivateKey *iss, |
1492 | const struct GNUNET_IDENTITY_PublicKey *rp, | 1492 | const struct GNUNET_CRYPTO_PublicKey *rp, |
1493 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 1493 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
1494 | GNUNET_RECLAIM_IssueTicketCallback cb, | 1494 | GNUNET_RECLAIM_IssueTicketCallback cb, |
1495 | void *cb_cls) | 1495 | void *cb_cls) |
@@ -1507,8 +1507,8 @@ GNUNET_RECLAIM_ticket_issue ( | |||
1507 | op->ti_cb = cb; | 1507 | op->ti_cb = cb; |
1508 | op->cls = cb_cls; | 1508 | op->cls = cb_cls; |
1509 | op->r_id = h->r_id_gen++; | 1509 | op->r_id = h->r_id_gen++; |
1510 | key_len = GNUNET_IDENTITY_private_key_get_length (iss); | 1510 | key_len = GNUNET_CRYPTO_private_key_get_length (iss); |
1511 | rpk_len = GNUNET_IDENTITY_public_key_get_length (rp); | 1511 | rpk_len = GNUNET_CRYPTO_public_key_get_length (rp); |
1512 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1512 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1513 | attr_len = GNUNET_RECLAIM_attribute_list_serialize_get_size (attrs); | 1513 | attr_len = GNUNET_RECLAIM_attribute_list_serialize_get_size (attrs); |
1514 | op->env = GNUNET_MQ_msg_extra (tim, | 1514 | op->env = GNUNET_MQ_msg_extra (tim, |
@@ -1517,10 +1517,10 @@ GNUNET_RECLAIM_ticket_issue ( | |||
1517 | tim->key_len = htons (key_len); | 1517 | tim->key_len = htons (key_len); |
1518 | tim->pkey_len = htons (rpk_len); | 1518 | tim->pkey_len = htons (rpk_len); |
1519 | buf = (char *) &tim[1]; | 1519 | buf = (char *) &tim[1]; |
1520 | written = GNUNET_IDENTITY_write_private_key_to_buffer (iss, buf, key_len); | 1520 | written = GNUNET_CRYPTO_write_private_key_to_buffer (iss, buf, key_len); |
1521 | GNUNET_assert (0 <= written); | 1521 | GNUNET_assert (0 <= written); |
1522 | buf += written; | 1522 | buf += written; |
1523 | written = GNUNET_IDENTITY_write_public_key_to_buffer (rp, buf, rpk_len); | 1523 | written = GNUNET_CRYPTO_write_public_key_to_buffer (rp, buf, rpk_len); |
1524 | GNUNET_assert (0 <= written); | 1524 | GNUNET_assert (0 <= written); |
1525 | buf += written; | 1525 | buf += written; |
1526 | tim->id = htonl (op->r_id); | 1526 | tim->id = htonl (op->r_id); |
@@ -1548,7 +1548,7 @@ GNUNET_RECLAIM_ticket_issue ( | |||
1548 | struct GNUNET_RECLAIM_Operation * | 1548 | struct GNUNET_RECLAIM_Operation * |
1549 | GNUNET_RECLAIM_ticket_consume ( | 1549 | GNUNET_RECLAIM_ticket_consume ( |
1550 | struct GNUNET_RECLAIM_Handle *h, | 1550 | struct GNUNET_RECLAIM_Handle *h, |
1551 | const struct GNUNET_IDENTITY_PrivateKey *identity, | 1551 | const struct GNUNET_CRYPTO_PrivateKey *identity, |
1552 | const struct GNUNET_RECLAIM_Ticket *ticket, | 1552 | const struct GNUNET_RECLAIM_Ticket *ticket, |
1553 | GNUNET_RECLAIM_AttributeTicketResult cb, | 1553 | GNUNET_RECLAIM_AttributeTicketResult cb, |
1554 | void *cb_cls) | 1554 | void *cb_cls) |
@@ -1564,7 +1564,7 @@ GNUNET_RECLAIM_ticket_consume ( | |||
1564 | op->atr_cb = cb; | 1564 | op->atr_cb = cb; |
1565 | op->cls = cb_cls; | 1565 | op->cls = cb_cls; |
1566 | op->r_id = h->r_id_gen++; | 1566 | op->r_id = h->r_id_gen++; |
1567 | key_len = GNUNET_IDENTITY_private_key_get_length (identity); | 1567 | key_len = GNUNET_CRYPTO_private_key_get_length (identity); |
1568 | tkt_len = GNUNET_RECLAIM_ticket_serialize_get_size (ticket); | 1568 | tkt_len = GNUNET_RECLAIM_ticket_serialize_get_size (ticket); |
1569 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1569 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1570 | op->env = GNUNET_MQ_msg_extra (ctm, | 1570 | op->env = GNUNET_MQ_msg_extra (ctm, |
@@ -1572,7 +1572,7 @@ GNUNET_RECLAIM_ticket_consume ( | |||
1572 | GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET); | 1572 | GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET); |
1573 | ctm->key_len = htons (key_len); | 1573 | ctm->key_len = htons (key_len); |
1574 | buf = (char*) &ctm[1]; | 1574 | buf = (char*) &ctm[1]; |
1575 | GNUNET_IDENTITY_write_private_key_to_buffer (identity, buf, key_len); | 1575 | GNUNET_CRYPTO_write_private_key_to_buffer (identity, buf, key_len); |
1576 | buf += key_len; | 1576 | buf += key_len; |
1577 | ctm->tkt_len = htons (tkt_len); | 1577 | ctm->tkt_len = htons (tkt_len); |
1578 | GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len); | 1578 | GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len); |
@@ -1588,7 +1588,7 @@ GNUNET_RECLAIM_ticket_consume ( | |||
1588 | struct GNUNET_RECLAIM_TicketIterator * | 1588 | struct GNUNET_RECLAIM_TicketIterator * |
1589 | GNUNET_RECLAIM_ticket_iteration_start ( | 1589 | GNUNET_RECLAIM_ticket_iteration_start ( |
1590 | struct GNUNET_RECLAIM_Handle *h, | 1590 | struct GNUNET_RECLAIM_Handle *h, |
1591 | const struct GNUNET_IDENTITY_PrivateKey *identity, | 1591 | const struct GNUNET_CRYPTO_PrivateKey *identity, |
1592 | GNUNET_SCHEDULER_TaskCallback error_cb, | 1592 | GNUNET_SCHEDULER_TaskCallback error_cb, |
1593 | void *error_cb_cls, | 1593 | void *error_cb_cls, |
1594 | GNUNET_RECLAIM_TicketCallback proc, | 1594 | GNUNET_RECLAIM_TicketCallback proc, |
@@ -1613,14 +1613,14 @@ GNUNET_RECLAIM_ticket_iteration_start ( | |||
1613 | it->cls = proc_cls; | 1613 | it->cls = proc_cls; |
1614 | it->r_id = rid; | 1614 | it->r_id = rid; |
1615 | 1615 | ||
1616 | key_len = GNUNET_IDENTITY_private_key_get_length (identity); | 1616 | key_len = GNUNET_CRYPTO_private_key_get_length (identity); |
1617 | GNUNET_CONTAINER_DLL_insert_tail (h->ticket_it_head, h->ticket_it_tail, it); | 1617 | GNUNET_CONTAINER_DLL_insert_tail (h->ticket_it_head, h->ticket_it_tail, it); |
1618 | env = GNUNET_MQ_msg_extra (msg, | 1618 | env = GNUNET_MQ_msg_extra (msg, |
1619 | key_len, | 1619 | key_len, |
1620 | GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START); | 1620 | GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START); |
1621 | msg->id = htonl (rid); | 1621 | msg->id = htonl (rid); |
1622 | msg->key_len = htons (key_len); | 1622 | msg->key_len = htons (key_len); |
1623 | GNUNET_IDENTITY_write_private_key_to_buffer (identity, | 1623 | GNUNET_CRYPTO_write_private_key_to_buffer (identity, |
1624 | &msg[1], | 1624 | &msg[1], |
1625 | key_len); | 1625 | key_len); |
1626 | if (NULL == h->mq) | 1626 | if (NULL == h->mq) |
@@ -1691,7 +1691,7 @@ GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it) | |||
1691 | struct GNUNET_RECLAIM_Operation * | 1691 | struct GNUNET_RECLAIM_Operation * |
1692 | GNUNET_RECLAIM_ticket_revoke ( | 1692 | GNUNET_RECLAIM_ticket_revoke ( |
1693 | struct GNUNET_RECLAIM_Handle *h, | 1693 | struct GNUNET_RECLAIM_Handle *h, |
1694 | const struct GNUNET_IDENTITY_PrivateKey *identity, | 1694 | const struct GNUNET_CRYPTO_PrivateKey *identity, |
1695 | const struct GNUNET_RECLAIM_Ticket *ticket, | 1695 | const struct GNUNET_RECLAIM_Ticket *ticket, |
1696 | GNUNET_RECLAIM_ContinuationWithStatus cb, | 1696 | GNUNET_RECLAIM_ContinuationWithStatus cb, |
1697 | void *cb_cls) | 1697 | void *cb_cls) |
@@ -1711,7 +1711,7 @@ GNUNET_RECLAIM_ticket_revoke ( | |||
1711 | op->cls = cb_cls; | 1711 | op->cls = cb_cls; |
1712 | op->r_id = rid; | 1712 | op->r_id = rid; |
1713 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); | 1713 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); |
1714 | key_len = GNUNET_IDENTITY_private_key_get_length (identity); | 1714 | key_len = GNUNET_CRYPTO_private_key_get_length (identity); |
1715 | tkt_len = GNUNET_RECLAIM_ticket_serialize_get_size (ticket); | 1715 | tkt_len = GNUNET_RECLAIM_ticket_serialize_get_size (ticket); |
1716 | op->env = GNUNET_MQ_msg_extra (msg, | 1716 | op->env = GNUNET_MQ_msg_extra (msg, |
1717 | key_len + tkt_len, | 1717 | key_len + tkt_len, |
@@ -1720,7 +1720,7 @@ GNUNET_RECLAIM_ticket_revoke ( | |||
1720 | msg->key_len = htons (key_len); | 1720 | msg->key_len = htons (key_len); |
1721 | msg->tkt_len = htons (tkt_len); | 1721 | msg->tkt_len = htons (tkt_len); |
1722 | buf = (char*) &msg[1]; | 1722 | buf = (char*) &msg[1]; |
1723 | written = GNUNET_IDENTITY_write_private_key_to_buffer (identity, | 1723 | written = GNUNET_CRYPTO_write_private_key_to_buffer (identity, |
1724 | buf, | 1724 | buf, |
1725 | key_len); | 1725 | key_len); |
1726 | GNUNET_assert (0 <= written); | 1726 | GNUNET_assert (0 <= written); |
@@ -1741,8 +1741,8 @@ GNUNET_RECLAIM_ticket_serialize_get_size (const struct | |||
1741 | GNUNET_RECLAIM_Ticket *tkt) | 1741 | GNUNET_RECLAIM_Ticket *tkt) |
1742 | { | 1742 | { |
1743 | size_t size = sizeof (tkt->rnd); | 1743 | size_t size = sizeof (tkt->rnd); |
1744 | size += GNUNET_IDENTITY_public_key_get_length (&tkt->identity); | 1744 | size += GNUNET_CRYPTO_public_key_get_length (&tkt->identity); |
1745 | size += GNUNET_IDENTITY_public_key_get_length (&tkt->audience); | 1745 | size += GNUNET_CRYPTO_public_key_get_length (&tkt->audience); |
1746 | return size; | 1746 | return size; |
1747 | } | 1747 | } |
1748 | 1748 | ||
@@ -1756,7 +1756,7 @@ GNUNET_RECLAIM_read_ticket_from_buffer (const void *buffer, | |||
1756 | size_t read = 0; | 1756 | size_t read = 0; |
1757 | size_t left = len; | 1757 | size_t left = len; |
1758 | if (GNUNET_SYSERR == | 1758 | if (GNUNET_SYSERR == |
1759 | GNUNET_IDENTITY_read_public_key_from_buffer (tmp, | 1759 | GNUNET_CRYPTO_read_public_key_from_buffer (tmp, |
1760 | left, | 1760 | left, |
1761 | &tkt->identity, | 1761 | &tkt->identity, |
1762 | &read)) | 1762 | &read)) |
@@ -1764,7 +1764,7 @@ GNUNET_RECLAIM_read_ticket_from_buffer (const void *buffer, | |||
1764 | left -= read; | 1764 | left -= read; |
1765 | tmp += read; | 1765 | tmp += read; |
1766 | if (GNUNET_SYSERR == | 1766 | if (GNUNET_SYSERR == |
1767 | GNUNET_IDENTITY_read_public_key_from_buffer (tmp, | 1767 | GNUNET_CRYPTO_read_public_key_from_buffer (tmp, |
1768 | left, | 1768 | left, |
1769 | &tkt->audience, | 1769 | &tkt->audience, |
1770 | &read)) | 1770 | &read)) |
@@ -1788,14 +1788,14 @@ GNUNET_RECLAIM_write_ticket_to_buffer (const struct | |||
1788 | char *tmp = buffer; | 1788 | char *tmp = buffer; |
1789 | size_t left = len; | 1789 | size_t left = len; |
1790 | ssize_t written = 0; | 1790 | ssize_t written = 0; |
1791 | written = GNUNET_IDENTITY_write_public_key_to_buffer (&tkt->identity, | 1791 | written = GNUNET_CRYPTO_write_public_key_to_buffer (&tkt->identity, |
1792 | buffer, | 1792 | buffer, |
1793 | left); | 1793 | left); |
1794 | if (0 > written) | 1794 | if (0 > written) |
1795 | return written; | 1795 | return written; |
1796 | left -= written; | 1796 | left -= written; |
1797 | tmp += written; | 1797 | tmp += written; |
1798 | written = GNUNET_IDENTITY_write_public_key_to_buffer (&tkt->audience, | 1798 | written = GNUNET_CRYPTO_write_public_key_to_buffer (&tkt->audience, |
1799 | tmp, | 1799 | tmp, |
1800 | left); | 1800 | left); |
1801 | if (0 > written) | 1801 | if (0 > written) |