diff options
-rw-r--r-- | common/status.h | 1 | ||||
-rw-r--r-- | doc/DETAILS | 9 | ||||
-rw-r--r-- | g10/build-packet.c | 6 | ||||
-rw-r--r-- | g10/keylist.c | 6 | ||||
-rw-r--r-- | g10/packet.h | 9 |
5 files changed, 23 insertions, 8 deletions
diff --git a/common/status.h b/common/status.h index 966489fa3..f9771c208 100644 --- a/common/status.h +++ b/common/status.h @@ -96,6 +96,7 @@ enum STATUS_SIG_CREATED, STATUS_SESSION_KEY, STATUS_NOTATION_NAME, + STATUS_NOTATION_FLAGS, STATUS_NOTATION_DATA, STATUS_POLICY_URL, STATUS_KEY_CREATED, diff --git a/doc/DETAILS b/doc/DETAILS index 59f8d5619..d2df9ace4 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -520,14 +520,17 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB: letter 'T'. *** NOTATION_ - There are actually two related status codes to convey notation + There are actually three related status codes to convey notation data: - NOTATION_NAME <name> + - NOTATION_FLAGS <critical> <human_readable> - NOTATION_DATA <string> - <name> and <string> are %XX escaped; the data may be split among - several NOTATION_DATA lines. + <name> and <string> are %XX escaped. The data may be split among + several NOTATION_DATA lines. NOTATION_FLAGS is emitted after + NOTATION_NAME and gives the critical and human readable flags; + the flag values are either 0 or 1. *** POLICY_URL <string> Note that URL in <string> is %XX escaped. diff --git a/g10/build-packet.c b/g10/build-packet.c index 9b6496766..4bfc2ac10 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -1277,8 +1277,9 @@ sig_to_notation(PKT_signature *sig) { const byte *p; size_t len; - int seq=0,crit; - struct notation *list=NULL; + int seq = 0; + int crit; + notation_t list = NULL; /* See RFC 4880, 5.2.3.16 for the format of notation data. In short, a notation has: @@ -1323,6 +1324,7 @@ sig_to_notation(PKT_signature *sig) n->value=xmalloc(n2+1); memcpy(n->value,&p[8+n1],n2); n->value[n2]='\0'; + n->flags.human = 1; } else /* Binary data. */ diff --git a/g10/keylist.c b/g10/keylist.c index cbde0bb72..2a1ef2e12 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -401,7 +401,7 @@ void show_notation (PKT_signature * sig, int indent, int mode, int which) { estream_t fp = mode ? log_get_stream () : es_stdout; - struct notation *nd, *notations; + notation_t nd, notations; if (which == 0) which = 3; @@ -448,6 +448,10 @@ show_notation (PKT_signature * sig, int indent, int mode, int which) { write_status_buffer (STATUS_NOTATION_NAME, nd->name, strlen (nd->name), 0); + if (nd->flags.critical || nd->flags.human) + write_status_text (STATUS_NOTATION_FLAGS, + nd->flags.critical && nd->flags.human? "1 1" : + nd->flags.critical? "1 0" : "0 1"); write_status_buffer (STATUS_NOTATION_DATA, nd->value, strlen (nd->value), 50); } diff --git a/g10/packet.h b/g10/packet.h index 194c13442..6ea2f8314 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -531,12 +531,14 @@ struct notation /* The notation's name. */ char *name; /* If the notation is human readable, then the value is stored here - as a NUL-terminated string. */ + as a NUL-terminated string. If it is not human readable a human + readable approximation of the binary value _may_ be stored + here. */ char *value; /* Sometimes we want to %-expand the value. In these cases, we save that transformed value here. */ char *altvalue; - /* If the notation is not human readable, then the value is strored + /* If the notation is not human readable, then the value is stored here. */ unsigned char *bdat; /* The amount of data stored in BDAT. @@ -552,6 +554,8 @@ struct notation { /* The notation is critical. */ unsigned int critical:1; + /* The notation is human readable. */ + unsigned int human:1; /* The notation should be deleted. */ unsigned int ignore:1; } flags; @@ -559,6 +563,7 @@ struct notation /* A field to facilitate creating a list of notations. */ struct notation *next; }; +typedef struct notation *notation_t; /*-- mainproc.c --*/ void reset_literals_seen(void); |