sig_to_notation(PKT_signature *sig)
{
  const byte *p;
  size_t len;
  int seq=0,crit;
  struct notation *list=NULL;

  while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_NOTATION,&len,&seq,&crit)))
    {
      int n1,n2;
      struct notation *n=NULL;

      if(len<8)
	{
	  log_info(_("WARNING: invalid notation data found\n"));
	  continue;
	}

      n1=(p[4]<<8)|p[5];
      n2=(p[6]<<8)|p[7];

      if(8+n1+n2!=len)
	{
	  log_info(_("WARNING: invalid notation data found\n"));
	  continue;
	}

      n=xmalloc_clear(sizeof(*n));
      n->name=xmalloc(n1+1);

      memcpy(n->name,&p[8],n1);
      n->name[n1]='\0';

      if(p[0]&0x80)
	{
	  n->value=xmalloc(n2+1);
	  memcpy(n->value,&p[8+n1],n2);
	  n->value[n2]='\0';
	}
      else
	{
	  n->bdat=xmalloc(n2);
	  n->blen=n2;
	  memcpy(n->bdat,&p[8+n1],n2);

	  n->value=xmalloc(2+strlen(_("not human readable"))+2+1);
	  strcpy(n->value,"[ ");
	  strcat(n->value,_("not human readable"));
	  strcat(n->value," ]");
	}

      n->flags.critical=crit;

      n->next=list;
      list=n;
    }

  return list;
}
sig_to_notation(PKT_signature *sig)
{
  const byte *p;
  size_t len;
  int seq=0,crit;
  struct notation *list=NULL;

  while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_NOTATION,&len,&seq,&crit)))
    {
      int n1,n2;
      struct notation *n=NULL;

      if(len<8)
	{
	  log_info(_("WARNING: invalid notation data found\n"));
	  continue;
	}

      n1=(p[4]<<8)|p[5];
      n2=(p[6]<<8)|p[7];

      if(8+n1+n2!=len)
	{
	  log_info(_("WARNING: invalid notation data found\n"));
	  continue;
	}

      n=xmalloc_clear(sizeof(*n));
      n->name=xmalloc(n1+1);

      memcpy(n->name,&p[8],n1);
      n->name[n1]='\0';

      if(p[0]&0x80)
	{
	  n->value=xmalloc(n2+1);
	  memcpy(n->value,&p[8+n1],n2);
	  n->value[n2]='\0';
	}
      else
	{
	  n->bdat=xmalloc(n2);
	  n->blen=n2;
	  memcpy(n->bdat,&p[8+n1],n2);

	  n->value=xmalloc(2+strlen(_("not human readable"))+2+1);
	  strcpy(n->value,"[ ");
	  strcat(n->value,_("not human readable"));
	  strcat(n->value," ]");
	}

      n->flags.critical=crit;

      n->next=list;
      list=n;
    }

  return list;
}