diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2016-11-20 00:23:49 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2016-11-20 00:23:49 +0100 |
commit | 18f106166cf64cc72206cd35301276aa21ca100a (patch) | |
tree | a5f472d1d7f76366a9cfc23189ee5a44d7b2f38d /src/credential/gnunet-credential.c | |
parent | 691aa85bfaec80c08330db772499a123b2ac2373 (diff) | |
download | gnunet-18f106166cf64cc72206cd35301276aa21ca100a.tar.gz gnunet-18f106166cf64cc72206cd35301276aa21ca100a.zip |
- move towards verification
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r-- | src/credential/gnunet-credential.c | 26 |
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; | |||
48 | static char *lookup_credential; | 48 | static char *lookup_credential; |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * Handle to lookup request | 51 | * Handle to verify request |
52 | */ | 52 | */ |
53 | static struct GNUNET_CREDENTIAL_LookupRequest *lookup_request; | 53 | static 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 | */ |
88 | static int credential_flags; | 88 | static int credential_flags; |
89 | 89 | ||
90 | /* | ||
91 | * Maximum delegation depth | ||
92 | */ | ||
93 | static 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 | */ |
164 | static void | 159 | static void |
165 | handle_lookup_result (void *cls, | 160 | handle_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 | } |