: is used as a separator in MRHKP output, so we need to escape it. We
also need to escape % for similar reasons, so do so. Closes Debian bug
#487284
/*
* keyindex.c - Routines to list an OpenPGP key.
*
- * Jonathan McDowell <noodles@earth.li>
- *
- * Copyright 2002-2005 Project Purple
+ * Copyright 2002-2008 Jonathan McDowell <noodles@earth.li>
*/
#include <inttypes.h>
int i = 0;
size_t fplength = 0;
unsigned char fp[20];
+ int c;
while (keys != NULL) {
created_time = (keys->publickey->data[1] << 24) +
curuid = curuid->next) {
if (curuid->packet->tag == 13) {
- printf("uid:%.*s\n",
- (int) curuid->packet->length,
- curuid->packet->data);
+ printf("uid:");
+ for (i = 0; i < (int) curuid->packet->length;
+ i++) {
+ c = curuid->packet->data[i];
+ if (c == '%') {
+ putchar('%');
+ putchar(c);
+ } else if (c == ':' || c > 127) {
+ printf("%%%X", c);
+ } else {
+ putchar(c);
+ }
+ }
+ printf("\n");
}
}
keys = keys->next;