[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: add tld handling from confi
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: add tld handling from config |
Date: |
Sat, 29 Sep 2018 10:39:05 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 13274f4bd add tld handling from config
13274f4bd is described below
commit 13274f4bd2009dd928e91f0b6e056cee7f7975a5
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Sat Sep 29 10:39:02 2018 +0200
add tld handling from config
---
src/rest-plugins/plugin_rest_openid_connect.c | 36 ++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/src/rest-plugins/plugin_rest_openid_connect.c
b/src/rest-plugins/plugin_rest_openid_connect.c
index 2bb60efce..2bcf576fb 100644
--- a/src/rest-plugins/plugin_rest_openid_connect.c
+++ b/src/rest-plugins/plugin_rest_openid_connect.c
@@ -1205,6 +1205,33 @@ build_authz_response (void *cls)
}
/**
+ * Iterate over tlds in config
+ */
+static void
+tld_iter (void *cls,
+ const char *section,
+ const char *option,
+ const char *value)
+{
+ struct RequestHandle *handle = cls;
+ struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
+
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_ecdsa_public_key_from_string (value,
+ strlen (value),
+ &pkey))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Skipping non key %s\n",
+ value);
+ return;
+ }
+ if ( 0 == memcmp (&pkey, &handle->oidc->client_pkey,
+ sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) )
+ handle->tld = GNUNET_strdup (option+1);
+}
+
+/**
* Responds to authorization GET and url-encoded POST request
*
* @param con_handle the connection handle
@@ -1287,7 +1314,14 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle
*con_handle,
handle->tld = GNUNET_strdup (tmp_ego->identifier);
handle->ego_entry = handle->ego_tail;
}
- }
+ }
+ if (NULL == handle->tld)
+ GNUNET_CONFIGURATION_iterate_section_values (cfg,
+ "gns",
+ tld_iter,
+ handle);
+ if (NULL == handle->tld)
+ handle->tld = GNUNET_strdup (tmp_ego->keystring);
GNUNET_SCHEDULER_add_now (&build_authz_response, handle);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: add tld handling from config,
gnunet <=