struct GNUNET_CREDENTIAL_Request *vr;
size_t nlen;
- if (NULL == issuer_attribute)
+ if (NULL == issuer_attribute || NULL == subject_attribute)
{
GNUNET_break (0);
return NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Trying to verify `%s' in CREDENTIAL\n",
issuer_attribute);
- nlen = strlen (issuer_attribute) + 1;
+ nlen = strlen (issuer_attribute) + 1 + strlen (subject_attribute) + 1;
if (nlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*vr))
{
GNUNET_break (0);
v_msg->subject_key = *subject_key;
v_msg->issuer_key = *issuer_key;
GNUNET_memcpy (&v_msg[1],
+ issuer_attribute,
+ strlen (issuer_attribute));
+ GNUNET_memcpy (((char*)&v_msg[1]) + strlen (issuer_attribute) + 1,
subject_attribute,
- nlen);
+ strlen (subject_attribute));
GNUNET_CONTAINER_DLL_insert (handle->verify_head,
handle->verify_tail,
vr);
{
fprintf (stderr,
_("Failed to connect to CREDENTIAL\n"));
- return;
+ GNUNET_SCHEDULER_shutdown ();
+ }
+
+ if (NULL == issuer_attr || NULL == subject_credential)
+ {
+ fprintf (stderr,
+ _("You must provide issuer and subject attributes\n"));
+ GNUNET_SCHEDULER_shutdown ();
}
{'s', "subject", "PKEY",
gettext_noop ("The public key of the subject to lookup the credential for"), 1,
&GNUNET_GETOPT_set_string, &subject_key},
- {'c', "credential", "CRED",
+ {'b', "credential", "CRED",
gettext_noop ("The name of the credential presented by the subject"), 1,
&GNUNET_GETOPT_set_string, &subject_credential},
{'i', "issuer", "PKEY",