const struct ExchangeResultMessage *erm)
{
char *str;
- size_t size = ntohs (erm->header.size) - sizeof (*erm);
+ size_t size = ntohs (erm->header.size);
- str = (char *) &erm[1];
+ str = (char *) &erm[0];
if ( (size > sizeof (struct ExchangeResultMessage)) &&
- ('\0' != str[size - sizeof (struct ExchangeResultMessage) - 1]) )
+ ('\0' != str[size - 1]) )
{
GNUNET_break (0);
return GNUNET_SYSERR;
const struct IssueResultMessage *irm)
{
char *str;
- size_t size = ntohs (irm->header.size) - sizeof (*irm);
- str = (char*) &irm[1];
+ size_t size = ntohs (irm->header.size);
+ str = (char*) &irm[0];
if ( (size > sizeof (struct IssueResultMessage)) &&
- ('\0' != str[size - sizeof (struct IssueResultMessage) - 1]) )
+ ('\0' != str[size - 1]) )
{
GNUNET_break (0);
return GNUNET_SYSERR;
const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss_key,
const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
const char* scopes,
+ const char* vattr,
struct GNUNET_TIME_Absolute expiration,
uint64_t nonce,
GNUNET_IDENTITY_PROVIDER_IssueCallback cb,
size_t slen;
slen = strlen (scopes) + 1;
- if (slen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (struct IssueMessage))
+ if (NULL != vattr)
+ slen += strlen (vattr) + 1;
+ if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct IssueMessage))
{
GNUNET_break (0);
return NULL;
im->id = op->r_id;
im->iss_key = *iss_key;
im->aud_key = *aud_key;
+ im->scope_len = htonl (strlen(scopes)+1);
im->nonce = htonl (nonce);
im->expiration = GNUNET_TIME_absolute_hton (expiration);
- GNUNET_memcpy (&im[1], scopes, slen);
+ GNUNET_memcpy (&im[1], scopes, strlen(scopes));
+ if (NULL != vattr)
+ GNUNET_memcpy ((char*)&im[1]+strlen(scopes)+1, vattr, strlen(vattr));
GNUNET_CONTAINER_DLL_insert_tail (id->op_head,
id->op_tail,
op);