diff options
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r-- | src/credential/gnunet-credential.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c index d728f533d..82f0e349c 100644 --- a/src/credential/gnunet-credential.c +++ b/src/credential/gnunet-credential.c | |||
@@ -157,17 +157,43 @@ do_timeout (void *cls) | |||
157 | */ | 157 | */ |
158 | static void | 158 | static void |
159 | handle_verify_result (void *cls, | 159 | handle_verify_result (void *cls, |
160 | struct GNUNET_CREDENTIAL_CredentialRecordData *cred, | 160 | unsigned int d_count, |
161 | uint32_t delegation_count, | 161 | struct GNUNET_CREDENTIAL_Delegation *dc, |
162 | struct GNUNET_CREDENTIAL_AttributeRecordData *deleg) | 162 | struct GNUNET_CREDENTIAL_Credential *cred) |
163 | { | 163 | { |
164 | 164 | int i; | |
165 | 165 | ||
166 | verify_request = NULL; | 166 | verify_request = NULL; |
167 | if (NULL == cred) | 167 | if (NULL == cred) |
168 | printf ("Verify failed.\n"); | 168 | printf ("Failed.\n"); |
169 | else | 169 | else |
170 | { | ||
171 | for (i=0;i<d_count;i++) | ||
172 | { | ||
173 | char iss_attr[dc[i].issuer_attribute_len]; | ||
174 | char* iss_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dc[i].issuer_key); | ||
175 | char* sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dc[i].subject_key); | ||
176 | |||
177 | char sub_attr[dc[i].subject_attribute_len]; | ||
178 | memcpy (iss_attr, | ||
179 | dc[i].issuer_attribute, | ||
180 | dc[i].issuer_attribute_len); | ||
181 | iss_attr[dc[i].issuer_attribute_len] = '\0'; | ||
182 | printf ("%s.%s <- ",iss_key, iss_attr); | ||
183 | printf ("%s",sub_key); | ||
184 | if (0 != dc[i].subject_attribute_len) | ||
185 | { | ||
186 | memcpy (sub_attr, | ||
187 | dc[i].subject_attribute, | ||
188 | dc[i].subject_attribute_len); | ||
189 | sub_attr[dc[i].subject_attribute_len] = '\0'; | ||
190 | |||
191 | printf (".%s",sub_attr); | ||
192 | } | ||
193 | printf ("\n"); | ||
194 | } | ||
170 | printf ("Successful.\n"); | 195 | printf ("Successful.\n"); |
196 | } | ||
171 | 197 | ||
172 | 198 | ||
173 | GNUNET_SCHEDULER_shutdown (); | 199 | GNUNET_SCHEDULER_shutdown (); |
@@ -209,7 +235,7 @@ identity_cb (void *cls, | |||
209 | GNUNET_SCHEDULER_shutdown (); | 235 | GNUNET_SCHEDULER_shutdown (); |
210 | return; | 236 | return; |
211 | } else if (GNUNET_OK == GNUNET_STRINGS_fancy_time_to_relative (expiration, | 237 | } else if (GNUNET_OK == GNUNET_STRINGS_fancy_time_to_relative (expiration, |
212 | &etime_rel)) | 238 | &etime_rel)) |
213 | { | 239 | { |
214 | etime_abs = GNUNET_TIME_relative_to_absolute (etime_rel); | 240 | etime_abs = GNUNET_TIME_relative_to_absolute (etime_rel); |
215 | } else if (GNUNET_OK != GNUNET_STRINGS_fancy_time_to_absolute (expiration, | 241 | } else if (GNUNET_OK != GNUNET_STRINGS_fancy_time_to_absolute (expiration, |