diff options
Diffstat (limited to 'src/identity/plugin_rest_identity.c')
-rw-r--r-- | src/identity/plugin_rest_identity.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c index d86d29e36..dba1d478d 100644 --- a/src/identity/plugin_rest_identity.c +++ b/src/identity/plugin_rest_identity.c | |||
@@ -384,7 +384,7 @@ ego_get_for_subsystem (void *cls, | |||
384 | { | 384 | { |
385 | struct RequestHandle *handle = cls; | 385 | struct RequestHandle *handle = cls; |
386 | struct MHD_Response *resp; | 386 | struct MHD_Response *resp; |
387 | struct GNUNET_CRYPTO_EcdsaPublicKey public_key; | 387 | struct GNUNET_IDENTITY_PublicKey public_key; |
388 | json_t *json_root; | 388 | json_t *json_root; |
389 | char *result_str; | 389 | char *result_str; |
390 | char *public_key_string; | 390 | char *public_key_string; |
@@ -398,7 +398,7 @@ ego_get_for_subsystem (void *cls, | |||
398 | } | 398 | } |
399 | 399 | ||
400 | GNUNET_IDENTITY_ego_get_public_key (ego, &public_key); | 400 | GNUNET_IDENTITY_ego_get_public_key (ego, &public_key); |
401 | public_key_string = GNUNET_CRYPTO_ecdsa_public_key_to_string (&public_key); | 401 | public_key_string = GNUNET_IDENTITY_public_key_to_string (&public_key); |
402 | 402 | ||
403 | // create json with subsystem identity | 403 | // create json with subsystem identity |
404 | json_root = json_object (); | 404 | json_root = json_object (); |
@@ -496,7 +496,7 @@ ego_get_all (struct GNUNET_REST_RequestHandle *con_handle, | |||
496 | GNUNET_CONTAINER_multihashmap_contains ( | 496 | GNUNET_CONTAINER_multihashmap_contains ( |
497 | handle->rest_handle->url_param_map, &key)) | 497 | handle->rest_handle->url_param_map, &key)) |
498 | { | 498 | { |
499 | privkey_str = GNUNET_CRYPTO_ecdsa_private_key_to_string ( | 499 | privkey_str = GNUNET_IDENTITY_private_key_to_string ( |
500 | GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego)); | 500 | GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego)); |
501 | json_object_set_new (json_ego, | 501 | json_object_set_new (json_ego, |
502 | GNUNET_REST_IDENTITY_PARAM_PRIVKEY, | 502 | GNUNET_REST_IDENTITY_PARAM_PRIVKEY, |
@@ -549,7 +549,7 @@ ego_get_response (struct RequestHandle *handle, struct EgoEntry *ego_entry) | |||
549 | GNUNET_CONTAINER_multihashmap_contains ( | 549 | GNUNET_CONTAINER_multihashmap_contains ( |
550 | handle->rest_handle->url_param_map, &key)) | 550 | handle->rest_handle->url_param_map, &key)) |
551 | { | 551 | { |
552 | privkey_str = GNUNET_CRYPTO_ecdsa_private_key_to_string ( | 552 | privkey_str = GNUNET_IDENTITY_private_key_to_string ( |
553 | GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego)); | 553 | GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego)); |
554 | json_object_set_new (json_ego, | 554 | json_object_set_new (json_ego, |
555 | GNUNET_REST_IDENTITY_PARAM_PRIVKEY, | 555 | GNUNET_REST_IDENTITY_PARAM_PRIVKEY, |
@@ -686,7 +686,7 @@ do_finished (void *cls, const char *emsg) | |||
686 | */ | 686 | */ |
687 | static void | 687 | static void |
688 | do_finished_create (void *cls, | 688 | do_finished_create (void *cls, |
689 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk, | 689 | const struct GNUNET_IDENTITY_PrivateKey *pk, |
690 | const char *emsg) | 690 | const char *emsg) |
691 | { | 691 | { |
692 | struct RequestHandle *handle = cls; | 692 | struct RequestHandle *handle = cls; |
@@ -999,8 +999,8 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle, | |||
999 | json_error_t err; | 999 | json_error_t err; |
1000 | char *egoname; | 1000 | char *egoname; |
1001 | char *privkey; | 1001 | char *privkey; |
1002 | struct GNUNET_CRYPTO_EcdsaPrivateKey pk; | 1002 | struct GNUNET_IDENTITY_PrivateKey pk; |
1003 | struct GNUNET_CRYPTO_EcdsaPrivateKey *pk_ptr; | 1003 | struct GNUNET_IDENTITY_PrivateKey *pk_ptr; |
1004 | int json_unpack_state; | 1004 | int json_unpack_state; |
1005 | char term_data[handle->data_size + 1]; | 1005 | char term_data[handle->data_size + 1]; |
1006 | 1006 | ||
@@ -1074,7 +1074,7 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle, | |||
1074 | strlen (privkey), | 1074 | strlen (privkey), |
1075 | &pk, | 1075 | &pk, |
1076 | sizeof(struct | 1076 | sizeof(struct |
1077 | GNUNET_CRYPTO_EcdsaPrivateKey)); | 1077 | GNUNET_IDENTITY_PrivateKey)); |
1078 | pk_ptr = &pk; | 1078 | pk_ptr = &pk; |
1079 | } | 1079 | } |
1080 | else | 1080 | else |
@@ -1084,6 +1084,7 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle, | |||
1084 | handle->op = GNUNET_IDENTITY_create (identity_handle, | 1084 | handle->op = GNUNET_IDENTITY_create (identity_handle, |
1085 | handle->name, | 1085 | handle->name, |
1086 | pk_ptr, | 1086 | pk_ptr, |
1087 | GNUNET_IDENTITY_TYPE_ECDSA, | ||
1087 | &do_finished_create, | 1088 | &do_finished_create, |
1088 | handle); | 1089 | handle); |
1089 | } | 1090 | } |
@@ -1208,7 +1209,7 @@ list_ego (void *cls, | |||
1208 | const char *identifier) | 1209 | const char *identifier) |
1209 | { | 1210 | { |
1210 | struct EgoEntry *ego_entry; | 1211 | struct EgoEntry *ego_entry; |
1211 | struct GNUNET_CRYPTO_EcdsaPublicKey pk; | 1212 | struct GNUNET_IDENTITY_PublicKey pk; |
1212 | 1213 | ||
1213 | if ((NULL == ego) && (ID_REST_STATE_INIT == state)) | 1214 | if ((NULL == ego) && (ID_REST_STATE_INIT == state)) |
1214 | { | 1215 | { |
@@ -1219,7 +1220,7 @@ list_ego (void *cls, | |||
1219 | { | 1220 | { |
1220 | ego_entry = GNUNET_new (struct EgoEntry); | 1221 | ego_entry = GNUNET_new (struct EgoEntry); |
1221 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 1222 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
1222 | ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 1223 | ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); |
1223 | ego_entry->ego = ego; | 1224 | ego_entry->ego = ego; |
1224 | ego_entry->identifier = GNUNET_strdup (identifier); | 1225 | ego_entry->identifier = GNUNET_strdup (identifier); |
1225 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, | 1226 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, |
@@ -1245,7 +1246,7 @@ list_ego (void *cls, | |||
1245 | /* Add */ | 1246 | /* Add */ |
1246 | ego_entry = GNUNET_new (struct EgoEntry); | 1247 | ego_entry = GNUNET_new (struct EgoEntry); |
1247 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 1248 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
1248 | ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 1249 | ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); |
1249 | ego_entry->ego = ego; | 1250 | ego_entry->ego = ego; |
1250 | ego_entry->identifier = GNUNET_strdup (identifier); | 1251 | ego_entry->identifier = GNUNET_strdup (identifier); |
1251 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, | 1252 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, |