aboutsummaryrefslogtreecommitdiff
path: root/src/credential/gnunet-credential.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2016-11-20 00:23:49 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2016-11-20 00:23:49 +0100
commit18f106166cf64cc72206cd35301276aa21ca100a (patch)
treea5f472d1d7f76366a9cfc23189ee5a44d7b2f38d /src/credential/gnunet-credential.c
parent691aa85bfaec80c08330db772499a123b2ac2373 (diff)
downloadgnunet-18f106166cf64cc72206cd35301276aa21ca100a.tar.gz
gnunet-18f106166cf64cc72206cd35301276aa21ca100a.zip
- move towards verification
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r--src/credential/gnunet-credential.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c
index 363ed03fc..94a4b3899 100644
--- a/src/credential/gnunet-credential.c
+++ b/src/credential/gnunet-credential.c
@@ -48,9 +48,9 @@ static struct GNUNET_TIME_Relative timeout;
48static char *lookup_credential; 48static char *lookup_credential;
49 49
50/** 50/**
51 * Handle to lookup request 51 * Handle to verify request
52 */ 52 */
53static struct GNUNET_CREDENTIAL_LookupRequest *lookup_request; 53static struct GNUNET_CREDENTIAL_VerifyRequest *verify_request;
54 54
55/** 55/**
56 * Lookup an ego with the identity service. 56 * Lookup an ego with the identity service.
@@ -87,11 +87,6 @@ static char *issuer_key;
87 */ 87 */
88static int credential_flags; 88static int credential_flags;
89 89
90/*
91 * Maximum delegation depth
92 */
93static int max_delegation_depth;
94
95 90
96 91
97/** 92/**
@@ -118,10 +113,10 @@ do_shutdown (void *cls)
118 GNUNET_IDENTITY_cancel (id_op); 113 GNUNET_IDENTITY_cancel (id_op);
119 id_op = NULL; 114 id_op = NULL;
120 } 115 }
121 if (NULL != lookup_request) 116 if (NULL != verify_request)
122 { 117 {
123 GNUNET_CREDENTIAL_lookup_cancel (lookup_request); 118 GNUNET_CREDENTIAL_verify_cancel (verify_request);
124 lookup_request = NULL; 119 verify_request = NULL;
125 } 120 }
126 if (NULL != identity) 121 if (NULL != identity)
127 { 122 {
@@ -162,14 +157,14 @@ do_timeout (void *cls)
162 * @param cd array of @a cd_count records with the results 157 * @param cd array of @a cd_count records with the results
163 */ 158 */
164static void 159static void
165handle_lookup_result (void *cls, 160handle_verify_result (void *cls,
166 struct GNUNET_IDENTITY_Ego *issuer, 161 struct GNUNET_IDENTITY_Ego *issuer,
167 uint16_t issuer_len, 162 uint16_t issuer_len,
168 const struct GNUNET_CREDENTIAL_RecordData *data) 163 const struct GNUNET_CREDENTIAL_RecordData *data)
169{ 164{
170 165
171 166
172 lookup_request = NULL; 167 verify_request = NULL;
173 if (0 == issuer_len) 168 if (0 == issuer_len)
174 printf ("No results.\n"); 169 printf ("No results.\n");
175 else 170 else
@@ -223,14 +218,13 @@ lookup_credentials (struct GNUNET_IDENTITY_Ego *ego)
223 return; 218 return;
224 } 219 }
225 220
226 lookup_request = GNUNET_CREDENTIAL_lookup(credential, 221 verify_request = GNUNET_CREDENTIAL_verify(credential,
222 "",
227 lookup_credential, 223 lookup_credential,
228 ego,
229 &subject_pkey, 224 &subject_pkey,
230 &issuer_pkey, 225 &issuer_pkey,
231 credential_flags, 226 credential_flags,
232 max_delegation_depth, 227 &handle_verify_result,
233 &handle_lookup_result,
234 NULL); 228 NULL);
235 return; 229 return;
236 } 230 }