-----BEGIN PGP SIGNED MESSAGE-----

From: nobody@REPLAY.COM (Anonymous)
Newsgroups: alt.security.pgp
Subject: Key ID and PGPLog
Date: 13 Apr 1998 03:42:11 +0200
Organization: Replay Associates, L.L.P.
Lines: 69
Message-ID: <6grqhj$ikt@basement.replay.com>
NNTP-Posting-Host: basement.replay.com
X-XS4ALL-Date: Mon, 13 Apr 1998 03:42:13 CEST
X-001: Replay may or may not approve of the content of this posting
X-002: Report misuse of this automated service to <abuse@replay.com>
X-URL: http://www.replay.com/remailer/
Path:
news.CS.Uni-Magdeburg.De!fu-berlin.de!newsfeed.direct.ca!news1.exit109.com!ne
ws.cs.utwente.nl!newsfeed.xs4all.nl!xs4all!basement.replay.com!not-for-mail

A few people have asked about the value of inserting one's key ID into a
signature, so I thought that some might be interested in a modification that
I made to the Win95 version of PGP 5.5.3.  I'm not sure if a similar
modification has been offered, so please bear with me.

One feature that I liked about PGP 2.6x was that it told me the key ID of an
unknown signer, allowing me to quickly look up the key if I wanted to. 
However PGPLog (in the Win95 version, at least) doesn't offer this feature;
it simply tells me that the signer is "unknown" and leaves it at that. 
Also, with many moving to DSS/DH keys, some people are starting to have two
or more keys with the same user identity.  The following code modifications
will help sort things out by inserting information into a "Key ID" column
that is placed between the "Signer" and "Validity" columns of PGPLog.  It
will provide the signer's key ID whenever a signature is checked, whether
the signer is known or unknown.


The files associated with PGPLog only require slight modification to make
room for the column.

In "main.c" make the following changes:

line 17: static float ColRatio[NUMCOLUMNS]={0.20,0.30,0.15,0.1,0.39};

line 18: static char *ColText[NUMCOLUMNS]={"Name","Signer","Key
ID","Validity","Signed"};

line 201:  if(dd->numcols==3)



In "ListMng.h" make this change: 

line 14:  #define NUMCOLUMNS 5




A file associated with PGPSc "SigEvent.c" requires a bit more modification.

Under the "SigEvent" function in "SigEvent.c", add the following variable
declarations.  (This is roughly line 80):

	CHAR* curString;
	CHAR MyAddedString[12];
	INT keyByteIndex;
	static const char 	sHexDigits[] = "0123456789ABCDEF";
	union ShareDat
	{
		PGPKeyID MyAddedID;
		PGPByte MyAddedIDBytes[34];
	} MyAddedUnion;

Then immediately before the line "// Decode validity into string" (roughly
line 125) insert the following lines.  These lines are a simplified version
of the "pgpBytesToHex" function.

	// Adds Key ID string to szMsgStr to be sent to PGPLog.exe

	MyAddedUnion.MyAddedID=d->signingKeyID;

	MyAddedString[0] = '0';
	MyAddedString[1] = 'x';

	curString=&MyAddedString[2];

	for( keyByteIndex = 6; keyByteIndex < 10; ++keyByteIndex )
	{
		PGPByte	keyByte	= MyAddedUnion.MyAddedIDBytes[keyByteIndex];
		
		*curString = sHexDigits[ ( keyByte >> 4 ) & 0x0F ];
		curString++;
		*curString = sHexDigits[ keyByte & 0x0F ];
		curString++;
	}

	*curString = '\n';
	curString++;
	*curString = '\0';
	
	strcat(szMsgStr,MyAddedString);


This seems to be effective and I haven't encountered any strange bugs.  I
don't have time to make this more elegant, so if anyone knows of a better
way to go about this, I hope you'll post it.  


-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.5.3
Comment: Use PGP, it makes Big Brother wonder what you're up too!

iQCVAwUBNTNeg3yxk99nTXwHAQFQLwP+LM4zG6vOhiSglI+O8YSibGqTbJ5SQRmL
QvzR4bKZg0d/L6ijV2XmivdXxufJVpOg+2PmCaDQGMH82qDk4lQbX36QozLQZp/3
3PagR5OH5cpd9nithu//6XwSAEEt7Frg2zOyfcF8/rc1gSFU/7J0eKI1P9SUcpdh
+t89l45l/b8=
=fPrq
-----END PGP SIGNATURE-----
