|
@@ -300,7 +300,7 @@ struct OIDC_Variables
|
|
|
/**
|
|
|
* The RP client public key
|
|
|
*/
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey client_pkey;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey client_pkey;
|
|
|
|
|
|
/**
|
|
|
* The OIDC client id of the RP
|
|
@@ -411,7 +411,7 @@ struct RequestHandle
|
|
|
/**
|
|
|
* Pointer to ego private key
|
|
|
*/
|
|
|
- struct GNUNET_CRYPTO_EcdsaPrivateKey priv_key;
|
|
|
+ struct GNUNET_IDENTITY_PrivateKey priv_key;
|
|
|
|
|
|
/**
|
|
|
* OIDC variables
|
|
@@ -972,7 +972,7 @@ oidc_ticket_issue_cb (void *cls,
|
|
|
(NULL != handle->tld))
|
|
|
{
|
|
|
GNUNET_asprintf (&redirect_uri,
|
|
|
- "%s.%s/%s?%s=%s&state=%s",
|
|
|
+ "%s.%s/%s%s%s=%s&state=%s",
|
|
|
handle->redirect_prefix,
|
|
|
handle->tld,
|
|
|
handle->redirect_suffix,
|
|
@@ -1087,7 +1087,7 @@ oidc_cred_collect_finished_cb (void *cls)
|
|
|
*/
|
|
|
static void
|
|
|
oidc_cred_collect (void *cls,
|
|
|
- const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
|
|
|
+ const struct GNUNET_IDENTITY_PublicKey *identity,
|
|
|
const struct GNUNET_RECLAIM_Credential *cred)
|
|
|
{
|
|
|
struct RequestHandle *handle = cls;
|
|
@@ -1211,7 +1211,7 @@ attr_in_userinfo_request (struct RequestHandle *handle,
|
|
|
*/
|
|
|
static void
|
|
|
oidc_attr_collect (void *cls,
|
|
|
- const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
|
|
|
+ const struct GNUNET_IDENTITY_PublicKey *identity,
|
|
|
const struct GNUNET_RECLAIM_Attribute *attr)
|
|
|
{
|
|
|
struct RequestHandle *handle = cls;
|
|
@@ -1260,8 +1260,8 @@ code_redirect (void *cls)
|
|
|
struct RequestHandle *handle = cls;
|
|
|
struct GNUNET_TIME_Absolute current_time;
|
|
|
struct GNUNET_TIME_Absolute *relog_time;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey ego_pkey;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey pubkey;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey ego_pkey;
|
|
|
struct GNUNET_HashCode cache_key;
|
|
|
char *identity_cookie;
|
|
|
|
|
@@ -1281,11 +1281,8 @@ code_redirect (void *cls)
|
|
|
if (current_time.abs_value_us <= relog_time->abs_value_us)
|
|
|
{
|
|
|
if (GNUNET_OK !=
|
|
|
- GNUNET_CRYPTO_ecdsa_public_key_from_string (handle->oidc
|
|
|
+ GNUNET_IDENTITY_public_key_from_string (handle->oidc
|
|
|
->login_identity,
|
|
|
- strlen (
|
|
|
- handle->oidc
|
|
|
- ->login_identity),
|
|
|
&pubkey))
|
|
|
{
|
|
|
handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_COOKIE);
|
|
@@ -1376,7 +1373,7 @@ lookup_redirect_uri_result (void *cls,
|
|
|
char *tmp;
|
|
|
char *tmp_key_str;
|
|
|
char *pos;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey redirect_zone;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey redirect_zone;
|
|
|
|
|
|
handle->gns_op = NULL;
|
|
|
if (0 == rd_count)
|
|
@@ -1608,10 +1605,10 @@ static void
|
|
|
tld_iter (void *cls, const char *section, const char *option, const char *value)
|
|
|
{
|
|
|
struct RequestHandle *handle = cls;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey pkey;
|
|
|
|
|
|
if (GNUNET_OK !=
|
|
|
- GNUNET_CRYPTO_ecdsa_public_key_from_string (value, strlen (value), &pkey))
|
|
|
+ GNUNET_IDENTITY_public_key_from_string (value, &pkey))
|
|
|
{
|
|
|
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value);
|
|
|
return;
|
|
@@ -1635,8 +1632,8 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
|
|
|
{
|
|
|
struct RequestHandle *handle = cls;
|
|
|
struct EgoEntry *tmp_ego;
|
|
|
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
|
|
|
+ const struct GNUNET_IDENTITY_PrivateKey *priv_key;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey pkey;
|
|
|
|
|
|
cookie_identity_interpretation (handle);
|
|
|
|
|
@@ -1664,9 +1661,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
|
|
|
}
|
|
|
|
|
|
if (GNUNET_OK !=
|
|
|
- GNUNET_CRYPTO_ecdsa_public_key_from_string (handle->oidc->client_id,
|
|
|
- strlen (
|
|
|
- handle->oidc->client_id),
|
|
|
+ GNUNET_IDENTITY_public_key_from_string (handle->oidc->client_id,
|
|
|
&handle->oidc->client_pkey))
|
|
|
{
|
|
|
handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_UNAUTHORIZED_CLIENT);
|
|
@@ -1682,7 +1677,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
|
|
|
for (tmp_ego = ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next)
|
|
|
{
|
|
|
priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego);
|
|
|
- GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &pkey);
|
|
|
+ GNUNET_IDENTITY_key_get_public (priv_key, &pkey);
|
|
|
if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey))
|
|
|
{
|
|
|
handle->tld = GNUNET_strdup (tmp_ego->identifier);
|
|
@@ -1865,7 +1860,7 @@ parse_credentials_post_body (struct RequestHandle *handle,
|
|
|
|
|
|
static int
|
|
|
check_authorization (struct RequestHandle *handle,
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey *cid)
|
|
|
+ struct GNUNET_IDENTITY_PublicKey *cid)
|
|
|
{
|
|
|
char *expected_pass;
|
|
|
char *received_cid;
|
|
@@ -1902,7 +1897,7 @@ check_authorization (struct RequestHandle *handle,
|
|
|
GNUNET_STRINGS_string_to_data (received_cid,
|
|
|
strlen (received_cid),
|
|
|
cid,
|
|
|
- sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey));
|
|
|
+ sizeof(struct GNUNET_IDENTITY_PublicKey));
|
|
|
GNUNET_free (received_cid);
|
|
|
return GNUNET_OK;
|
|
|
|
|
@@ -1948,7 +1943,7 @@ check_authorization (struct RequestHandle *handle,
|
|
|
GNUNET_STRINGS_string_to_data (received_cid,
|
|
|
strlen (received_cid),
|
|
|
cid,
|
|
|
- sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey));
|
|
|
+ sizeof(struct GNUNET_IDENTITY_PublicKey));
|
|
|
|
|
|
GNUNET_free (received_cpw);
|
|
|
GNUNET_free (received_cid);
|
|
@@ -1958,10 +1953,10 @@ check_authorization (struct RequestHandle *handle,
|
|
|
|
|
|
const struct EgoEntry *
|
|
|
find_ego (struct RequestHandle *handle,
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey *test_key)
|
|
|
+ struct GNUNET_IDENTITY_PublicKey *test_key)
|
|
|
{
|
|
|
struct EgoEntry *ego_entry;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey pub_key;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey pub_key;
|
|
|
|
|
|
for (ego_entry = ego_head; NULL != ego_entry;
|
|
|
ego_entry = ego_entry->next)
|
|
@@ -1992,7 +1987,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
|
|
|
struct GNUNET_RECLAIM_AttributeList *cl = NULL;
|
|
|
struct GNUNET_RECLAIM_PresentationList *pl = NULL;
|
|
|
struct GNUNET_RECLAIM_Ticket ticket;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey cid;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey cid;
|
|
|
struct GNUNET_HashCode cache_key;
|
|
|
struct MHD_Response *resp;
|
|
|
char *grant_type;
|
|
@@ -2145,7 +2140,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
|
|
|
*/
|
|
|
static void
|
|
|
consume_ticket (void *cls,
|
|
|
- const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
|
|
|
+ const struct GNUNET_IDENTITY_PublicKey *identity,
|
|
|
const struct GNUNET_RECLAIM_Attribute *attr,
|
|
|
const struct GNUNET_RECLAIM_Presentation *pres)
|
|
|
{
|
|
@@ -2225,7 +2220,7 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
|
|
|
char *authorization_type;
|
|
|
char *authorization_access_token;
|
|
|
const struct EgoEntry *aud_ego;
|
|
|
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
|
|
|
+ const struct GNUNET_IDENTITY_PrivateKey *privkey;
|
|
|
|
|
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Getting userinfo\n");
|
|
|
GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY,
|
|
@@ -2349,7 +2344,7 @@ list_ego (void *cls,
|
|
|
const char *identifier)
|
|
|
{
|
|
|
struct EgoEntry *ego_entry;
|
|
|
- struct GNUNET_CRYPTO_EcdsaPublicKey pk;
|
|
|
+ struct GNUNET_IDENTITY_PublicKey pk;
|
|
|
|
|
|
if ((NULL == ego) && (ID_REST_STATE_INIT == state))
|
|
|
{
|
|
@@ -2362,7 +2357,7 @@ list_ego (void *cls,
|
|
|
{
|
|
|
ego_entry = GNUNET_new (struct EgoEntry);
|
|
|
GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
|
|
|
- ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
|
|
|
+ ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk);
|
|
|
ego_entry->ego = ego;
|
|
|
ego_entry->identifier = GNUNET_strdup (identifier);
|
|
|
GNUNET_CONTAINER_DLL_insert_tail (ego_head,
|
|
@@ -2389,7 +2384,7 @@ list_ego (void *cls,
|
|
|
/* Add */
|
|
|
ego_entry = GNUNET_new (struct EgoEntry);
|
|
|
GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
|
|
|
- ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
|
|
|
+ ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk);
|
|
|
ego_entry->ego = ego;
|
|
|
ego_entry->identifier = GNUNET_strdup (identifier);
|
|
|
GNUNET_CONTAINER_DLL_insert_tail (ego_head,
|