Permalink
Browse files

* Fixing IV length.

        Stefan H. Holek <stefan>
        disastry
* Skipping the tail of armor.
        Stefan H. Holek <stefan>
  • Loading branch information...
1 parent 5c809b8 commit 64b66058beb4746ba2e99adc5d0679a0b87dc70e @kazu-yamamoto committed Feb 19, 2010
Showing with 49 additions and 13 deletions.
  1. +6 −1 CHANGES
  2. +5 −1 README
  3. +2 −1 buffer.c
  4. +8 −7 keys.c
  5. +1 −1 pgpdump.c
  6. +1 −0 pgpdump.h
  7. +26 −2 types.c
View
@@ -1,7 +1,12 @@
Change Log
+0.08 2001/04/12
-
+* Fixing IV length.
+ Stefan H. Holek <stefan>
+ disastry
+* Skipping the tail of armor.
+ Stefan H. Holek <stefan>
0.07 2001/04/05
View
6 README
@@ -1,7 +1,7 @@
pgpdump: a PGP packet visualizer
Kazu Yamamoto <kazu@iijlab.net>
- April 5, 2001
+ April 12, 2001
<Overview>
@@ -73,6 +73,10 @@ following options(see src/pgp/{keydb/pgpPrefs.c,utils/pgpConf.c}):
Also, try GNUPG which is an excellent alternative of PGP version 5.
Its options are easy-to-understand.
+ <Home page>
+
+The official home page of pgpdump is:
+ http://pgp.iijlab.net/pgpdump.html
<Bugs>
View
@@ -119,6 +119,7 @@ read_radix64(byte *p, unsigned int max)
}
return out;
skiptail:
+ while (getchar() != EOF);
done = YES;
return out;
}
@@ -291,7 +292,7 @@ Compressed_Data_Packet(int len)
{
#ifdef HAVE_LIBZ
unsigned int alg = Getc();
- int err;
+ int err = Z_OK;
comp_algs(alg);
View
15 keys.c
@@ -9,7 +9,7 @@ private int VERSION;
private void old_Public_Key_Packet(void);
private void new_Public_Key_Packet(int);
-private void IV(void);
+private void IV(unsigned int);
private void encrypted_Secret_Key(int);
public void
@@ -83,10 +83,10 @@ new_Public_Key_Packet(int len)
}
private void
-IV(void)
+IV(unsigned int len)
{
printf("\tIV - ");
- dump(8);
+ dump(len);
printf("\n");
}
@@ -99,7 +99,7 @@ Secret_Subkey_Packet(int len)
public void
Secret_Key_Packet(int len)
{
- int s2k;
+ int s2k, sym;
Getc_resetlen();
Public_Key_Packet(len);
@@ -130,14 +130,15 @@ Secret_Key_Packet(int len)
printf("\t\t-> m = sym alg(1) + checksum(2) + PKCS-1 block type 02\n");
break;
case 255:
- sym_algs(Getc());
+ sym = Getc();
+ sym_algs(sym);
string_to_key();
- IV();
+ IV(iv_len(sym));
encrypted_Secret_Key(len - Getc_getlen());
break;
default:
sym_algs(s2k);
- IV();
+ IV(iv_len(s2k));
encrypted_Secret_Key(len - Getc_getlen());
}
}
View
@@ -5,7 +5,7 @@
#include "pgpdump.h"
#include <stdarg.h>
-private char *pgpdump_version = "0.07, Copyright (C) 1998-2001 Kazu Yamamoto";
+private char *pgpdump_version = "0.08, Copyright (C) 1998-2001 Kazu Yamamoto";
private char *prog;
private void usage(void);
View
@@ -81,6 +81,7 @@ public void parse_subpacket(char *, int);
public void pub_algs(unsigned int);
public void sym_algs(unsigned int);
+public int iv_len(unsigned int);
public void comp_algs(unsigned int);
public void hash_algs(unsigned int);
public void key_id(void);
View
28 types.c
@@ -74,6 +74,30 @@ sym_algs(unsigned int type)
printf("\n");
}
+private int
+IV_LEN[SYM_ALGS_NUM] = {
+ 0, /* Plaintext */
+ 8, /* IDEA */
+ 8, /* Triple-DES */
+ 8, /* CAST5 */
+ 8, /* Blowfish */
+ 8, /* SAFER-SK128 */
+ 8, /* Reserved for DES/SK (AES) */
+ 16, /* AES-128 */
+ 16, /* AES-192 */
+ 16, /* AES-256 */
+ 16, /* Twofish */
+};
+
+public int
+iv_len(unsigned int type)
+{
+ if (type < SYM_ALGS_NUM)
+ return IV_LEN[type];
+ else
+ return 0;
+}
+
#define COMP_ALGS_NUM 3
private char *
COMP_ALGS[] = {
@@ -145,7 +169,7 @@ time4_base(char *str, time_t *pt)
pat = asctime(ptm);
pat[19] = 0;
pyr = pat + 20;
-
+
if (uflag)
printf("\t%s - %s UTC %s", str, pat, pyr);
else
@@ -279,7 +303,7 @@ multi_precision_integer(char *str)
printf("\t%s(%d bits) - ", str, bits);
if (iflag) {
dump(bytes);
- } else {
+ } else {
printf("...");
skip(bytes);
}

0 comments on commit 64b6605

Please sign in to comment.