- switch (sigs->packet->data[0]) {
- case 2:
- case 3:
- uid = keyid2uid(
- ((uint64_t) sigs->packet->data[7] << 56) +
- ((uint64_t) sigs->packet->data[8] << 48) +
- ((uint64_t) sigs->packet->data[9] << 40) +
- ((uint64_t) sigs->packet->data[10] << 32) +
- ((uint64_t) sigs->packet->data[11] << 24) +
- ((uint64_t) sigs->packet->data[12] << 16) +
- ((uint64_t) sigs->packet->data[13] << 8) +
- sigs->packet->data[14]);
- if (html && uid != NULL) {
- printf("sig <a href=\"lookup?op=get&"
- "search=%02X%02X%02X%02X\">"
- "%02X%02X%02X%02X</a> "
- "<a href=\"lookup?op=vindex&"
- "search=0x%02X%02X%02X%02X\">"
- "%s</a>\n",
- sigs->packet->data[11],
- sigs->packet->data[12],
- sigs->packet->data[13],
- sigs->packet->data[14],
- sigs->packet->data[11],
- sigs->packet->data[12],
- sigs->packet->data[13],
- sigs->packet->data[14],
-
- sigs->packet->data[11],
- sigs->packet->data[12],
- sigs->packet->data[13],
- sigs->packet->data[14],
- txt2html(uid));
- } else if (html && uid == NULL) {
- printf("sig %02X%02X%02X%02X"
- " "
- "[User id not found]\n",
- sigs->packet->data[11],
- sigs->packet->data[12],
- sigs->packet->data[13],
- sigs->packet->data[14]);
- } else {
- printf("sig %02X%02X%02X%02X"
- " %s\n",
- sigs->packet->data[11],
- sigs->packet->data[12],
- sigs->packet->data[13],
- sigs->packet->data[14],
- (uid != NULL) ? uid :
- "[User id not found]");
- }
- break;
- case 4:
- length = parse_subpackets(&sigs->packet->data[4], html);
- parse_subpackets(&sigs->packet->data[length + 4], html);
- break;
- default:
- printf("sig [Unknown packet version %d]",
- sigs->packet->data[0]);
+ sigid = sig_keyid(sigs->packet);
+ uid = config.dbbackend->keyid2uid(sigid);
+ if (sigs->packet->data[0] == 4 &&
+ sigs->packet->data[1] == 0x30) {
+ /* It's a Type 4 sig revocation */
+ sig = "rev";
+ } else {
+ sig = "sig";
+ }
+ if (html && uid != NULL) {
+ printf("%s <a href=\"lookup?op=get&"
+ "search=0x%016" PRIX64 "\">%08" PRIX64
+ "</a> "
+ "<a href=\"lookup?op=vindex&search=0x%016"
+ PRIX64 "\">%s</a>\n",
+ sig,
+ sigid,
+ sigid & 0xFFFFFFFF,
+ sigid,
+ txt2html(uid));
+ } else if (html && uid == NULL) {
+ printf("%s %08" PRIX64 " "
+ "[User id not found]\n",
+ sig,
+ sigid & 0xFFFFFFFF);
+ } else {
+ printf("%s %08" PRIX64
+ " %s\n",
+ sig,
+ sigid & 0xFFFFFFFF,
+ (uid != NULL) ? uid :
+ "[User id not found]");
+ }
+ if (uid != NULL) {
+ free(uid);
+ uid = NULL;