Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Supporting MacOS X.

        "Stefan H. Holek" <stefan>
* Catching up to 2440bis-07.
        "Stefan H. Holek" <stefan>
* A bug fix of old_Public_Key_Packet.
        Shigeru NAKAMURA <s-nakamu>
  • Loading branch information...
commit b9df9b142c0f606a1aa5f5b0a09ad1634dd6695b 1 parent c67ae97
@kazu-yamamoto authored
View
9 CHANGES
@@ -1,5 +1,14 @@
Change Log
+0.18 2003/05/20
+
+* Supporting MacOS X.
+ "Stefan H. Holek" <stefan>
+* Catching up to 2440bis-07.
+ "Stefan H. Holek" <stefan>
+* A bug fix of old_Public_Key_Packet.
+ Shigeru NAKAMURA <s-nakamu>
+
0.17 2002/06/28
* Defining the SHA-1 hash for Secret Key Packet.
View
8 README
@@ -1,7 +1,7 @@
pgpdump: a PGP packet visualizer
Kazu Yamamoto <kazu@iijlab.net>
- Dec 6, 2001
+ May 20, 2003
<Overview>
@@ -12,13 +12,14 @@ of OpenPGP (RFC 2440 + bis) and PGP version 2 (RFC 1991).
Here is an example:
% pgpdump data/sig1
+
Old: Marker Packet(tag 10)(3 bytes)
String - ...
New: One-Pass Signature Packet(tag 4)(13 bytes)
New version(3)
Sig type - Signature of a binary document(0x00).
Hash alg - SHA1(hash 2)
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Key ID - 0xA79778E247B63037
Next packet - other than one pass signature
New: Signature Packet(tag 2)(63 bytes)
@@ -27,14 +28,13 @@ Here is an example:
Sig type - Signature of a binary document(0x00).
Creation time - Fri Nov 27 22:35:02 JST 1998
Key ID - 0xA79778E247B63037
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hash left 2 bytes - 8f 82
DSA r(160 bits) - ...
DSA s(157 bits) - ...
-> hash(160 bits)
-
<Installation>
Take the following steps to install "pgpdump".
View
53 autotime.h
@@ -0,0 +1,53 @@
+/*
+ * autotime.h
+ *
+ * The code here tries its best to provide access to struct tm and the
+ * timezone name.
+ *
+ * In addition to including time.h (and sys/time.h), autotime.h defines the
+ * macro tm_zone() that may be used to get the timezone name given a
+ * struct tm pointer.
+ *
+ * Requires the following configure.in macros:
+ * AC_CHECK_HEADERS(sys/time.h)
+ * AC_HEADER_TIME
+ * AC_STRUCT_TM
+ * AC_STRUCT_TIMEZONE
+ *
+ * Also see:
+ * http://www.lns.cornell.edu/public/COMP/info/autoconf/autoconf_4.html#SEC32
+ */
+
+#ifndef _AUTOTIME_H_
+#define _AUTOTIME_H_
+
+#include "config.h"
+
+#if TM_IN_SYS_TIME /* struct tm is not in time.h ... */
+ #if HAVE_SYS_TIME_H
+ #if TIME_WITH_SYS_TIME
+ #include <sys/time.h>
+ #include <time.h>
+ #else
+ #include <sys/time.h> /* Supposedly includes time.h */
+ #endif
+ #else
+ #include <time.h> /* No struct tm in time.h and no sys/time.h ??? */
+ #endif
+#else
+ #include <time.h>
+#endif
+
+#if HAVE_TM_ZONE
+ #define tm_zone(tm) (tm->tm_zone)
+#elif HAVE_TZNAME
+ #define tm_zone(tm) (tzname[tm->tm_isdst])
+#else
+ #ifndef tzname /* Don't step on macro (SGI) */
+ extern char* tzname[]; /* RS6000 doesn't like **tzname */
+ #endif
+ #define tm_zone(tm) (tzname[tm->tm_isdst])
+#endif
+
+#endif /* _AUTOTIME_H_ */
+
View
16 config.h.in
@@ -1,8 +1,24 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* Define if your struct tm has tm_zone. */
+#undef HAVE_TM_ZONE
+
+/* Define if you don't have tm_zone but do have the external array
+ tzname. */
+#undef HAVE_TZNAME
+
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares struct tm. */
+#undef TM_IN_SYS_TIME
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
View
4,253 configure
3,570 additions, 683 deletions not shown
View
5 configure.in
@@ -13,7 +13,12 @@ AC_CONFIG_HEADER(config.h)
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(sys/time.h)
+AC_HEADER_TIME
+
dnl Checks for typedefs, structures, and compiler characteristics.
+AC_STRUCT_TM
+AC_STRUCT_TIMEZONE
dnl Checks for library functions.
View
2  data/enc1.res
@@ -3,7 +3,7 @@ Old: Marker Packet(tag 10)(3 bytes)
New: Symmetric-Key Encrypted Session Key Packet(tag 3)(4 bytes)
New version(4)
Sym alg - CAST5(sym 3)
- String-to-key(s2k 0):
+ Simple string-to-key(s2k 0):
Hash alg - MD5(hash 1)
New: Symmetrically Encrypted Data Packet(tag 9)(56 bytes)
Encrypted data [sym alg is CAST5(sym 3)]
View
2  data/gpg1.res
@@ -1,7 +1,7 @@
Old: Signature Packet(tag 2)(70 bytes)
Ver 4 - new
Sig type - Signature of a binary document(0x00).
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hashed Sub: signature creation time(sub 2)(4 bytes)
Time - Sat Nov 28 00:59:17 JST 1998
View
4 data/gpg2.res
@@ -2,7 +2,7 @@ Old: One-Pass Signature Packet(tag 4)(13 bytes)
New version(3)
Sig type - Signature of a binary document(0x00).
Hash alg - SHA1(hash 2)
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Key ID - 0xFD90DA9732D8EBD2
Next packet - other than one pass signature
Old: Literal Data Packet(tag 11)(45 bytes)
@@ -13,7 +13,7 @@ Old: Literal Data Packet(tag 11)(45 bytes)
Old: Signature Packet(tag 2)(70 bytes)
Ver 4 - new
Sig type - Signature of a binary document(0x00).
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hashed Sub: signature creation time(sub 2)(4 bytes)
Time - Sat Nov 28 01:11:39 JST 1998
View
2  data/gpg3.res
@@ -1,7 +1,7 @@
Old: Symmetric-Key Encrypted Session Key Packet(tag 3)(12 bytes)
New version(4)
Sym alg - Blowfish(sym 4)
- String-to-key(s2k 1):
+ Salted string-to-key(s2k 1):
Hash alg - RIPEMD160(hash 3)
Salt - ab 2b b0 87 b4 1d 43 48
New: Symmetrically Encrypted Data Packet(tag 9)(62 bytes)
View
8 data/pub.res
@@ -1,7 +1,7 @@
Old: Public Key Packet(tag 6)(418 bytes)
Ver 4 - new
Public key creation time - Thu Nov 26 22:49:00 JST 1998
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
DSA p(1024 bits) - ...
DSA q(160 bits) - ...
DSA g(1024 bits) - ...
@@ -11,7 +11,7 @@ Old: User ID Packet(tag 13)(31 bytes)
Old: Signature Packet(tag 2)(75 bytes)
Ver 4 - new
Sig type - Generic certification of a User ID and Public Key packet(0x10).
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hashed Sub: signature creation time(sub 2)(4 bytes)
Time - Thu Nov 26 22:49:00 JST 1998
@@ -30,7 +30,7 @@ Old: User ID Packet(tag 13)(20 bytes)
Old: Signature Packet(tag 2)(75 bytes)
Ver 4 - new
Sig type - Generic certification of a User ID and Public Key packet(0x10).
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hashed Sub: signature creation time(sub 2)(4 bytes)
Time - Fri Nov 27 02:18:58 JST 1998
@@ -57,7 +57,7 @@ Old: Signature Packet(tag 2)(63 bytes)
Sig type - Subkey Binding Signature(0x18).
Creation time - Thu Nov 26 22:49:00 JST 1998
Key ID - 0xA79778E247B63037
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hash left 2 bytes - e8 41
DSA r(160 bits) - ...
View
6 data/pub1.res
@@ -1,7 +1,7 @@
Old: Public Key Packet(tag 6)(418 bytes)
Ver 4 - new
Public key creation time - Sun Oct 11 23:27:53 JST 1998
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
DSA p(1024 bits) - ...
DSA q(160 bits) - ...
DSA g(1023 bits) - ...
@@ -11,7 +11,7 @@ Old: User ID Packet(tag 13)(35 bytes)
Old: Signature Packet(tag 2)(87 bytes)
Ver 4 - new
Sig type - Positive certification of a User ID and Public Key packet(0x13).
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hashed Sub: signature creation time(sub 2)(4 bytes)
Time - Sun Oct 11 23:27:53 JST 1998
@@ -44,7 +44,7 @@ Old: Public Subkey Packet(tag 14)(269 bytes)
Old: Signature Packet(tag 2)(70 bytes)
Ver 4 - new
Sig type - Subkey Binding Signature(0x18).
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hashed Sub: signature creation time(sub 2)(4 bytes)
Time - Sun Oct 11 23:29:23 JST 1998
View
2  data/sig.res
@@ -4,7 +4,7 @@ Old: Signature Packet(tag 2)(63 bytes)
Sig type - Signature of a binary document(0x00).
Creation time - Fri Nov 27 18:35:42 JST 1998
Key ID - 0xA79778E247B63037
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hash left 2 bytes - 27 ae
DSA r(159 bits) - ...
View
4 data/sig1.res
@@ -4,7 +4,7 @@ New: One-Pass Signature Packet(tag 4)(13 bytes)
New version(3)
Sig type - Signature of a binary document(0x00).
Hash alg - SHA1(hash 2)
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Key ID - 0xA79778E247B63037
Next packet - other than one pass signature
New: Signature Packet(tag 2)(63 bytes)
@@ -13,7 +13,7 @@ New: Signature Packet(tag 2)(63 bytes)
Sig type - Signature of a binary document(0x00).
Creation time - Fri Nov 27 22:35:02 JST 1998
Key ID - 0xA79778E247B63037
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hash left 2 bytes - 8f 82
DSA r(160 bits) - ...
View
4 data/sig3.res
@@ -4,7 +4,7 @@ New: One-Pass Signature Packet(tag 4)(13 bytes)
New version(3)
Sig type - Signature of a binary document(0x00).
Hash alg - SHA1(hash 2)
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Key ID - 0xA79778E247B63037
Next packet - other than one pass signature
New: Signature Packet(tag 2)(63 bytes)
@@ -13,7 +13,7 @@ New: Signature Packet(tag 2)(63 bytes)
Sig type - Signature of a binary document(0x00).
Creation time - Sat Nov 28 00:36:59 JST 1998
Key ID - 0xA79778E247B63037
- Pub alg - DSA Digital Signature Standard(pub 17)
+ Pub alg - DSA Digital Signature Algorithm(pub 17)
Hash alg - SHA1(hash 2)
Hash left 2 bytes - 51 81
DSA r(158 bits) - ...
View
4 keys.c
@@ -45,8 +45,8 @@ old_Public_Key_Packet(void)
{
int days;
time4("Public key creation time");
- days = Getc();
- days += Getc() * 256;
+ days = Getc() * 256;
+ days += Getc();
printf("\tValid days - %d[0 is forever]\n", days);
PUBLIC = Getc();
pub_algs(PUBLIC); /* PUBLIC should be 1 */
View
16 packet.c
@@ -18,9 +18,8 @@ private int is_partial(int);
#define OLD_TAG_SHIFT 2
#define OLD_LEN_MASK 0x03
-#define TAG_NUM 64
private char *
-TAG[TAG_NUM] = {
+TAG[] = {
"Reserved",
"Public-Key Encrypted Session Key Packet",
"Signature Packet",
@@ -86,6 +85,7 @@ TAG[TAG_NUM] = {
"Private",
"Private",
};
+#define TAG_NUM (sizeof(TAG) * sizeof(char *))
private void
(*tag_func[])() = {
@@ -156,9 +156,8 @@ private void
Private_Packet,
};
-#define SIGSUB_NUM 32
private char *
-SIGSUB[SIGSUB_NUM] = {
+SIGSUB[] = {
"unknown(sub 0)",
"unknown(sub 1)",
"signature creation time(sub 2)",
@@ -190,8 +189,9 @@ SIGSUB[SIGSUB_NUM] = {
"signer's user id(sub 28)",
"reason for revocation(sub 29)",
"features(sub 30)",
- "revocation target(sub 31)",
+ "signature target(sub 31)",
};
+#define SIGSUB_NUM (sizeof(SIGSUB) / sizeof(char *))
private funcptr
sigsub_func[] = {
@@ -226,15 +226,15 @@ sigsub_func[] = {
signer_user_id,
reason_for_revocation,
features,
- revocation_target,
+ signature_target,
};
-#define UATSUB_NUM 2
private char *
-UATSUB[UATSUB_NUM] = {
+UATSUB[] = {
"unknown(sub 0)",
"image attribute(sub 1)",
};
+#define UATSUB_NUM (sizeof(UATSUB) / sizeof(char *))
private funcptr
uatsub_func[] = {
View
2  pgpdump.c
@@ -13,7 +13,7 @@ int mflag;
int pflag;
int uflag;
-private char *pgpdump_version = "0.17, Copyright (C) 1998-2002 Kazu Yamamoto";
+private char *pgpdump_version = "0.18, Copyright (C) 1998-2003 Kazu Yamamoto";
private char *prog;
private void usage(void);
View
2  pgpdump.h
@@ -149,7 +149,7 @@ public void key_flags(int);
public void signer_user_id(int);
public void reason_for_revocation(int);
public void features(int);
-public void revocation_target(int);
+public void signature_target(int);
/*
* uatfunc.c
View
3  signature.c
@@ -89,6 +89,9 @@ signature_type(int type)
case 0x40:
printf("Timestamp signature(0x40).");
break;
+ case 0x50:
+ printf("Notary signature(0x50).");
+ break;
default:
printf("unknown(%02x)", type);
break;
View
2  subfunc.c
@@ -316,7 +316,7 @@ features(int len)
}
public void
-revocation_target(int len)
+signature_target(int len)
{
printf("\t");
pub_algs(Getc());
View
26 types.c
@@ -3,15 +3,14 @@
*/
#include "pgpdump.h"
-#include <time.h>
+#include "autotime.h"
private void time4_base(char *, time_t *);
private time_t key_creation_time = 0;
private time_t sig_creation_time = 0;
-#define PUB_ALGS_NUM 22
private char *
-PUB_ALGS[PUB_ALGS_NUM] = {
+PUB_ALGS[] = {
"unknown(pub 0)",
"RSA Encrypt or Sign(pub 1)",
"RSA Encrypt-Only(pub 2)",
@@ -29,12 +28,13 @@ PUB_ALGS[PUB_ALGS_NUM] = {
"unknown(pub 14)",
"unknown(pub 15)",
"ElGamal Encrypt-Only(pub 16)",
- "DSA Digital Signature Standard(pub 17)",
+ "DSA Digital Signature Algorithm(pub 17)",
"Reserved for Elliptic Curve(pub 18)",
"Reserved for ECDSA(pub 19)",
"ElGamal Encrypt or Sign (pub 20)",
"X9.42 Diffie-Hellman (pub 21)",
};
+#define PUB_ALGS_NUM (sizeof(PUB_ALGS) / sizeof(char *))
public void
pub_algs(unsigned int type)
@@ -47,9 +47,8 @@ pub_algs(unsigned int type)
printf("\n");
}
-#define SYM_ALGS_NUM 11
private char *
-SYM_ALGS[SYM_ALGS_NUM] = {
+SYM_ALGS[] = {
"Plaintext or unencrypted data(sym 0)",
"IDEA(sym 1)",
"Triple-DES(sym 2)",
@@ -62,6 +61,7 @@ SYM_ALGS[SYM_ALGS_NUM] = {
"AES with 256-bit key(sym 9)",
"Twofish with 256-bit key(sym 10)",
};
+#define SYM_ALGS_NUM (sizeof(SYM_ALGS) / sizeof(char *))
public void
sym_algs(unsigned int type)
@@ -84,7 +84,7 @@ sym_algs2(unsigned int type)
}
private int
-IV_LEN[SYM_ALGS_NUM] = {
+IV_LEN[] = {
0, /* Plaintext */
8, /* IDEA */
8, /* Triple-DES */
@@ -107,13 +107,13 @@ iv_len(unsigned int type)
return 0;
}
-#define COMP_ALGS_NUM 3
private char *
COMP_ALGS[] = {
"Uncompressed(comp 0)",
"ZIP <RFC1951>(comp 1)",
"ZLIB <RFC1950>(comp 2)",
};
+#define COMP_ALGS_NUM (sizeof(COMP_ALGS) / sizeof(char *))
public void
comp_algs(unsigned int type)
@@ -126,7 +126,6 @@ comp_algs(unsigned int type)
printf("\n");
}
-#define HASH_ALGS_NUM 11
private char *
HASH_ALGS[] = {
"unknown(hash 0)",
@@ -141,6 +140,7 @@ HASH_ALGS[] = {
"SHA384(hash 9)",
"SHA512(hash 10)",
};
+#define HASH_ALGS_NUM (sizeof(HASH_ALGS) / sizeof(char *))
public void
hash_algs(unsigned int type)
@@ -190,7 +190,7 @@ time4_base(char *str, time_t *pt)
if (uflag)
printf("\t%s - %s UTC %s", str, pat, pyr);
else
- printf("\t%s - %s %s %s", str, pat, tzname[ptm->tm_isdst], pyr);
+ printf("\t%s - %s %s %s", str, pat, tm_zone(ptm), pyr);
}
public void
@@ -281,13 +281,14 @@ string_to_key(void)
{
int type = Getc();
- printf("\tString-to-key(s2k %d):\n", type);
switch (type) {
case 0x00:
+ printf("\tSimple string-to-key(s2k %d):\n", type);
printf("\t");
hash_algs(Getc());
break;
case 0x01:
+ printf("\tSalted string-to-key(s2k %d):\n", type);
printf("\t");
hash_algs(Getc());
printf("\t\tSalt - ");
@@ -295,6 +296,7 @@ string_to_key(void)
printf("\n");
break;
case 0x03:
+ printf("\tIterated and salted string-to-key(s2k %d):\n", type);
printf("\t");
hash_algs(Getc());
printf("\t\tSalt - ");
@@ -307,7 +309,7 @@ string_to_key(void)
}
break;
default:
- printf("\t\tunknown(s2k %d)\n", type);
+ printf("\tUnknown string-to-key(s2k %d)\n", type);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.