mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
* packet.h, build-packet.c (sig_to_notation), keygen.c
(keygen_add_notations): Provide printable text for non-human-readable notation values.
This commit is contained in:
parent
889c4afd78
commit
0f7b4371b2
@ -1,5 +1,9 @@
|
|||||||
2006-03-08 David Shaw <dshaw@jabberwocky.com>
|
2006-03-08 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* packet.h, build-packet.c (sig_to_notation), keygen.c
|
||||||
|
(keygen_add_notations): Provide printable text for
|
||||||
|
non-human-readable notation values.
|
||||||
|
|
||||||
* packet.h, build-packet.c (sig_to_notation), keygen.c
|
* packet.h, build-packet.c (sig_to_notation), keygen.c
|
||||||
(keygen_add_notations): Tweak to handle non-human-readable
|
(keygen_add_notations): Tweak to handle non-human-readable
|
||||||
notation values.
|
notation values.
|
||||||
|
@ -1000,17 +1000,21 @@ sig_to_notation(PKT_signature *sig)
|
|||||||
|
|
||||||
if(p[0]&0x80)
|
if(p[0]&0x80)
|
||||||
{
|
{
|
||||||
n->flags.human=1;
|
|
||||||
n->value=xmalloc(n2+1);
|
n->value=xmalloc(n2+1);
|
||||||
|
memcpy(n->value,&p[8+n1],n2);
|
||||||
n->value[n2]='\0';
|
n->value[n2]='\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n->value=xmalloc(n2);
|
n->bdat=xmalloc(n2);
|
||||||
n->blen=n2;
|
n->blen=n2;
|
||||||
}
|
memcpy(n->bdat,&p[8+n1],n2);
|
||||||
|
|
||||||
memcpy(n->value,&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->flags.critical=crit;
|
||||||
|
|
||||||
@ -1030,6 +1034,8 @@ free_notation(struct notation *notation)
|
|||||||
|
|
||||||
xfree(n->name);
|
xfree(n->name);
|
||||||
xfree(n->value);
|
xfree(n->value);
|
||||||
|
xfree(n->altvalue);
|
||||||
|
xfree(n->bdat);
|
||||||
notation=n->next;
|
notation=n->next;
|
||||||
xfree(n);
|
xfree(n);
|
||||||
}
|
}
|
||||||
|
@ -708,7 +708,7 @@ keygen_add_notations(PKT_signature *sig,void *opaque)
|
|||||||
n1=strlen(notation->name);
|
n1=strlen(notation->name);
|
||||||
if(notation->altvalue)
|
if(notation->altvalue)
|
||||||
n2=strlen(notation->altvalue);
|
n2=strlen(notation->altvalue);
|
||||||
else if(!notation->flags.human)
|
else if(notation->bdat)
|
||||||
n2=notation->blen;
|
n2=notation->blen;
|
||||||
else
|
else
|
||||||
n2=strlen(notation->value);
|
n2=strlen(notation->value);
|
||||||
@ -716,7 +716,7 @@ keygen_add_notations(PKT_signature *sig,void *opaque)
|
|||||||
buf = xmalloc( 8 + n1 + n2 );
|
buf = xmalloc( 8 + n1 + n2 );
|
||||||
|
|
||||||
/* human readable or not */
|
/* human readable or not */
|
||||||
buf[0] = notation->flags.human?0x80:0;
|
buf[0] = notation->bdat?0:0x80;
|
||||||
buf[1] = buf[2] = buf[3] = 0;
|
buf[1] = buf[2] = buf[3] = 0;
|
||||||
buf[4] = n1 >> 8;
|
buf[4] = n1 >> 8;
|
||||||
buf[5] = n1;
|
buf[5] = n1;
|
||||||
@ -725,6 +725,8 @@ keygen_add_notations(PKT_signature *sig,void *opaque)
|
|||||||
memcpy(buf+8, notation->name, n1 );
|
memcpy(buf+8, notation->name, n1 );
|
||||||
if(notation->altvalue)
|
if(notation->altvalue)
|
||||||
memcpy(buf+8+n1, notation->altvalue, n2 );
|
memcpy(buf+8+n1, notation->altvalue, n2 );
|
||||||
|
else if(notation->bdat)
|
||||||
|
memcpy(buf+8+n1, notation->bdat, n2 );
|
||||||
else
|
else
|
||||||
memcpy(buf+8+n1, notation->value, n2 );
|
memcpy(buf+8+n1, notation->value, n2 );
|
||||||
build_sig_subpkt( sig, SIGSUBPKT_NOTATION |
|
build_sig_subpkt( sig, SIGSUBPKT_NOTATION |
|
||||||
|
@ -411,12 +411,12 @@ struct notation
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
char *value;
|
char *value;
|
||||||
size_t blen;
|
|
||||||
char *altvalue;
|
char *altvalue;
|
||||||
|
unsigned char *bdat;
|
||||||
|
size_t blen;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned int critical:1;
|
unsigned int critical:1;
|
||||||
unsigned int human:1;
|
|
||||||
unsigned int ignore:1;
|
unsigned int ignore:1;
|
||||||
} flags;
|
} flags;
|
||||||
struct notation *next;
|
struct notation *next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user