Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* New scheme to handle partial bodies.

* Sophisticated buffering mechanism. No temporary files are created.
* Creating pgpdump.1.

Stefan H. Holek <stefan> kindly contributes the followings:

* Fixed keyserver preferences (can be >1 octet)
* Changed display of time fields to include timezone information
* Added -u flag to display time fields in UTC instead of the local
  timezone (PGP time fields == seconds since 00:00:00, January 1,
  1970, UTC)
* Fixed key and signature expiration time calculations
  (expiration time == seconds since creation time)
* Added capability to read from stdin when no file is specifed on the
  commandline
* Implemented missing subpackets
        - revocation_key
        - reason_for_revocation
        - key_flags
        - signer_user_id (not tested)
        - notation_data (not tested)
  • Loading branch information...
commit 5c809b8a294ead929b1aa76132c5452108195958 1 parent fd6c99a
@kazu-yamamoto authored
View
27 CHANGES
@@ -1,5 +1,32 @@
Change Log
+
+
+
+0.07 2001/04/05
+
+* New scheme to handle partial bodies.
+* Sophisticated buffering mechanism. No temporary files are created.
+* Creating pgpdump.1.
+
+Stefan H. Holek <stefan> kindly contributes the followings:
+
+* Fixed keyserver preferences (can be >1 octet)
+* Changed display of time fields to include timezone information
+* Added -u flag to display time fields in UTC instead of the local
+ timezone (PGP time fields == seconds since 00:00:00, January 1,
+ 1970, UTC)
+* Fixed key and signature expiration time calculations
+ (expiration time == seconds since creation time)
+* Added capability to read from stdin when no file is specifed on the
+ commandline
+* Implemented missing subpackets
+ - revocation_key
+ - reason_for_revocation
+ - key_flags
+ - signer_user_id (not tested)
+ - notation_data (not tested)
+
0.06 2001/03/30
* Supporting old-format packet length 3 ("until the end of the file").
View
12 Makefile.in
@@ -1,19 +1,22 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
+mandir = @mandir@/man1
LIBS = @LIBS@
CFLAGS = -O -Wall
RM = rm -f
-INSTALL = install -c -m 555
+INSTALL = install -c -m
INCS = pgpdump.h
SRCS = pgpdump.c types.c tagfuncs.c packet.c subfunc.c signature.c keys.c \
- armor.c uncomp.c
+ buffer.c
OBJS = pgpdump.o types.o tagfuncs.o packet.o subfunc.o signature.o keys.o \
- armor.o uncomp.o
+ buffer.o
PROG = pgpdump
+MAN = pgpdump.1
+
CNF = config.h config.status config.cache config.log
MKF = Makefile
@@ -31,4 +34,5 @@ clean:
distclean:
$(RM) $(OBJS) $(PROG) $(CNF) $(MKF)
install:
- $(INSTALL) $(PROG) $(bindir)
+ $(INSTALL) 555 $(PROG) $(bindir)
+ $(INSTALL) 444 $(MAN) $(mandir)
View
6 README
@@ -1,7 +1,7 @@
pgpdump: a PGP packet visualizer
Kazu Yamamoto <kazu@iijlab.net>
- March 30, 2001
+ April 5, 2001
<Overview>
@@ -76,5 +76,5 @@ Its options are easy-to-understand.
<Bugs>
- - Some sub-packets for the signature packet have not been
- implemented yet.
+ - pgpdump assumes that a compressed packet continues until
+ the end of the specified file.
View
163 armor.c
@@ -1,163 +0,0 @@
-/*
- * armor.c
- */
-
-#include "pgpdump.h"
-
-#define YES 1
-#define NO 0
-
-#define ON 1
-#define OFF 0
-
-#define CR 13
-#define LF 10
-
-#define PADDING '='
-#define EOP -2
-
-#define OOB -1
-
-private int GetChar(FILE *, int);
-private void base64_decode(FILE *, FILE *);
-
-private char
-base256[] = {
- OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB,
-
- OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB,
- /* - / */
- OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB, 62, OOB,OOB,OOB, 63,
- /* 0 1 2 3 4 5 6 7 8 9 = */
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,OOB,OOB, OOB,OOB,OOB,OOB,
- /* A B C D E F G H I J K L M N O*/
- OOB, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- /* P Q R S T U V W X Y Z */
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,OOB, OOB,OOB,OOB,OOB,
- /* a b c d e f g h i j k l m n o*/
- OOB, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- /* p q r s t u v w x y z */
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,OOB, OOB,OOB,OOB,OOB,
-};
-
-
-private int
-GetChar(FILE *stream, int cannot_be_eof)
-{
- int c, ret;
- static int Ineof = OFF;
-
- if (Ineof == ON)
- return EOF;
-
- do {
- c = getc(stream);
- } while ( c == CR || c == LF);
-
- if (c == EOF) {
- if (cannot_be_eof == YES)
- error("base64 decoder saw premature EOF.");
- Ineof = ON;
- return(EOF);
- }
-
- /* PGP radix64 encoding is always followed by CRC which
- * starts with '='. So, this works even if there is no
- * padding character.
- */
- if (c == PADDING)
- return(EOP);
-
- if ((ret = base256[c]) == OOB)
- error("base64 decoder saw an illegal character.");
-
- return(ret);
-}
-
-private void
-base64_decode(FILE *infile, FILE *outfile)
-{
- int c1, c2, c3, c4;
-
- while ((c1 = GetChar(infile, NO)) != EOF) {
- if (c1 == EOP)
- break;
- if ((c2 = GetChar(infile, YES)) == EOP)
- break;
- putc(((c1 << 2) | ((c2 & 0x30) >> 4)), outfile);
-
- if ((c3 = GetChar(infile, YES)) == EOP)
- break;
- putc((((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2)), outfile);
-
- if ((c4 = GetChar(infile, YES)) == EOP)
- break;
- putc((((c3 & 0x03) << 6) | c4), outfile);
- }
-}
-
-public void
-armor_decode(void)
-{
- FILE *input = Get_input_file();
- FILE *output;
- char buffer[BUFSIZ], *outfile;
-
- do {
- if (fgets(buffer, BUFSIZ, input) == NULL)
- error("can't find PGP armor boundary.");
- } while (strncmp("-----BEGIN PGP", buffer, 14) != 0);
-
- do {
- if (fgets(buffer, BUFSIZ, input) == NULL)
- error("can't find PGP armor.");
- } while (buffer[0] != CR && buffer[0] != LF);
-
- /*
- * The end of PGP data will detect by base64_decode().
- */
-
- output = Get_temp_file(&outfile);
-
- base64_decode(input, output);
-
- fclose(input);
- fclose(output);
- if ((output = fopen(outfile, "r")) == NULL) {
- unlink(outfile);
- error("can't reopen the stream.");
- }
-
- Set_input_file(output);
- unlink(outfile);
-}
-
-/*
- * Copyright (C) 1998 Kazuhiko Yamamoto
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
View
377 buffer.c
@@ -0,0 +1,377 @@
+/*
+ * buffer.c
+ */
+
+#include "pgpdump.h"
+
+typedef unsigned char byte;
+
+private int read_binary(byte *, unsigned int);
+private int read_radix64(byte *, unsigned int);
+private int decode_radix64(byte *, unsigned int);
+
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+private int inflate_gzip(byte *, unsigned int);
+#endif
+
+#define NUL '\0'
+#define CR '\r'
+#define LF '\n'
+
+#define OOB -1
+#define EOP -2
+#define ELF -3
+#define ECR -4
+
+private unsigned int MAGIC_COUNT = 0;
+private unsigned int AVAIL_COUNT = 0;
+private byte *NEXT_IN = NULL;
+
+private z_stream z;
+
+private int (*d_func1)(byte *, unsigned int);
+private int (*d_func2)(byte *, unsigned int);
+private int (*d_func3)(byte *, unsigned int);
+
+private byte tmpbuf[BUFSIZ];
+private byte d_buf1[BUFSIZ];
+private byte d_buf2[BUFSIZ];
+private byte d_buf3[BUFSIZ];
+
+private signed char
+base256[] = {
+ OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,ELF,OOB, OOB,ECR,OOB,OOB,
+
+ OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB,
+ /* - / */
+ OOB,OOB,OOB,OOB, OOB,OOB,OOB,OOB, OOB,OOB,OOB, 62, OOB,OOB,OOB, 63,
+ /* 0 1 2 3 4 5 6 7 8 9 = */
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,OOB,OOB, OOB,EOP,OOB,OOB,
+ /* A B C D E F G H I J K L M N O*/
+ OOB, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ /* P Q R S T U V W X Y Z */
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,OOB, OOB,OOB,OOB,OOB,
+ /* a b c d e f g h i j k l m n o*/
+ OOB, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ /* p q r s t u v w x y z */
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,OOB, OOB,OOB,OOB,OOB,
+};
+
+private int
+read_binary(byte *p, unsigned int max)
+{
+ /* errno */
+ return fread(p, sizeof(byte), max, stdin);
+}
+
+private int
+read_radix64(byte *p, unsigned int max)
+{
+ static int done = NO, found = NO;
+ int c, d, out = 0, lf = 0, cr = 0;
+ byte *lim = p + max;
+
+ if (done == YES) return 0;
+
+ if (found == NO) {
+
+ again:
+ do {
+ if (fgets(tmpbuf, BUFSIZ, stdin) == NULL)
+ warn_exit("can't find PGP armor boundary.");
+ } while (strncmp("-----BEGIN PGP", tmpbuf, 14) != 0);
+
+ if (strncmp("-----BEGIN PGP SIGNED", tmpbuf, 21) == 0)
+ goto again;
+
+ do {
+ if (fgets(tmpbuf, BUFSIZ, stdin) == NULL)
+ warn_exit("can't find PGP armor.");
+ } while (tmpbuf[0] != CR && tmpbuf[0] != LF);
+ found = YES;
+ }
+
+ while (p < lim) {
+ c = getchar();
+ if (c == EOF) {
+ done = YES;
+ return out;
+ }
+ d = base256[c];
+ switch (d) {
+ case OOB:
+ warning("illegal radix64 character.");
+ goto skiptail;
+ case EOP:
+ /* radix64 surely matches this */
+ goto skiptail;
+ case ELF:
+ if (++lf >= 2) goto skiptail;
+ continue;
+ case ECR:
+ if (++cr >= 2) goto skiptail;
+ continue;
+ }
+ lf = cr = 0;
+ *p++ = d;
+ out++;
+ }
+ return out;
+ skiptail:
+ done = YES;
+ return out;
+}
+
+private int
+decode_radix64(byte *p, unsigned int max)
+{
+ static int done = NO;
+ static unsigned int avail = 0;
+ static byte *q;
+ unsigned int i, size, out = 0;
+ byte c1, c2, c3, c4, *r, *lim = p + max;
+
+ if (done == YES) return 0;
+
+ while (p + 3 < lim) {
+ if (avail < 4) {
+ r = q;
+ q = d_buf1;
+ for (i = 0; i < avail; i++)
+ *q++ = *r++;
+ size = (*d_func1)(q, sizeof(d_buf1) - avail);
+ q = d_buf1;
+ avail += size;
+ if (size == 0) {
+ done = YES;
+ switch (avail) {
+ case 0:
+ return out;
+ case 1:
+ warning("illegal radix64 length.");
+ return out; /* anyway */
+ case 2:
+ c1 = *q++;
+ c2 = *q++;
+ *p++ = (c1 << 2) | ((c2 & 0x30) >> 4);
+ return out + 1;
+ case 3:
+ c1 = *q++;
+ c2 = *q++;
+ c3 = *q++;
+ *p++ = (c1 << 2) | ((c2 & 0x30) >> 4);
+ *p++ = ((c2 & 0x0f) << 4) |
+ ((c3 & 0x3c) >> 2);
+ return out + 2;
+ }
+ }
+ }
+
+ if (avail >= 4) {
+ c1 = *q++;
+ c2 = *q++;
+ c3 = *q++;
+ c4 = *q++;
+ *p++ = (c1 << 2) | ((c2 & 0x30) >> 4);
+ *p++ = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2);
+ *p++ = ((c3 & 0x03) << 6) | c4;
+ avail -= 4;
+ out += 3;
+ }
+ }
+ return out;
+}
+
+#ifdef HAVE_LIBZ
+private int
+inflate_gzip(byte *p, unsigned int max)
+{
+ static int done = NO;
+ int err, size, inflated = 0, old;
+
+ if (done == YES) return 0;
+
+ z.next_out = p;
+ z.avail_out = max;
+
+ while (z.avail_out != 0) {
+ if (z.avail_in == 0) {
+ size = (*d_func2)(d_buf2, sizeof(d_buf2));
+ z.next_in = d_buf2;
+ z.avail_in = size;
+ }
+
+ old = z.avail_out;
+ err = inflate(&z, Z_SYNC_FLUSH);
+
+ if (err != Z_OK && err != Z_STREAM_END)
+ warn_exit("inflate error (%d).", err);
+
+ inflated = max - z.avail_out;
+
+ if (old == z.avail_out)
+ break;
+
+ if (err == Z_STREAM_END) {
+ done = YES;
+ /* 8 bytes (crc and isize) are left. */
+ if (inflateEnd(&z) != Z_OK)
+ warn_exit("inflateEnd error.");
+ break;
+ }
+ }
+
+ return inflated;
+}
+#endif /* HAVE_LIBZ */
+
+public int
+Getc1(void)
+{
+ byte c;
+
+ if (AVAIL_COUNT == 0) {
+ AVAIL_COUNT = (*d_func3)(d_buf3, sizeof(d_buf3));
+ if (AVAIL_COUNT == 0)
+ return EOF;
+ NEXT_IN = d_buf3;
+ }
+
+ AVAIL_COUNT--;
+ MAGIC_COUNT++;
+ c = *NEXT_IN;
+ NEXT_IN++;
+ return c;
+}
+
+public int
+Getc(void)
+{
+ int c = Getc1();
+ if (c == EOF)
+ warn_exit("unexpected end of file");
+ return c;
+}
+
+public int
+Getc_getlen(void)
+{
+ return MAGIC_COUNT;
+}
+
+public void
+Getc_resetlen(void)
+{
+ MAGIC_COUNT = 0;
+}
+
+public void
+set_armor(void)
+{
+ d_func1 = read_radix64;
+ d_func2 = NULL;
+ d_func3 = decode_radix64;
+}
+
+public void
+set_binary(void)
+{
+ d_func1 = NULL;
+ d_func2 = NULL;
+ d_func3 = read_binary;
+}
+
+/*
+ * Assuming Compressed_Data_Packet ends at the end of file
+ */
+
+public void
+Compressed_Data_Packet(int len)
+{
+#ifdef HAVE_LIBZ
+ unsigned int alg = Getc();
+ int err;
+
+ comp_algs(alg);
+
+ z.zalloc = (alloc_func)0;
+ z.zfree = (free_func)0;
+ z.opaque = (voidpf)0;
+
+ /*
+ * 0 uncompressed
+ * 1 ZIP 1951 without zlib header
+ * inflateInit2 (strm, -13)
+ * 2 ZLIB 1950 with zlib header
+ * inflateInit (strm)
+ */
+
+ switch (alg) {
+ case 0:
+ return;
+ case 1:
+ err = inflateInit2(&z, -13);
+ break;
+ case 2:
+ err = inflateInit(&z);
+ break;
+ default:
+ warn_exit("unknown compress algorithm.");
+ }
+
+ if (err != Z_OK)
+ warn_exit("inflateInit error.");
+
+ z.next_in = d_buf2;
+ z.avail_in = AVAIL_COUNT;
+ z.next_out = 0;
+ z.avail_out = sizeof(d_buf2);
+
+ memcpy(d_buf2, NEXT_IN, AVAIL_COUNT);
+ AVAIL_COUNT = 0;
+
+ if (d_func1 == NULL) {
+ d_func1 = NULL;
+ d_func2 = read_binary;
+ d_func3 = inflate_gzip;
+ } else {
+ d_func1 = read_radix64;
+ d_func2 = decode_radix64;
+ d_func3 = inflate_gzip;
+ }
+#else /* HAVE_LIBZ */
+ comp_algs(Getc());
+ warn_exit("can't uncompress without zlib.");
+#endif /* HAVE_LIBZ */
+}
+
+/*
+ * Copyright (C) 1998 Kazuhiko Yamamoto
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
View
2  configure
@@ -451,7 +451,7 @@ echo > confdefs.h
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=armor.c
+ac_unique_file=pgpdump.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
View
2  configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(armor.c)
+AC_INIT(pgpdump.c)
dnl Checks for programs.
dnl AC_PROG_INSTALL
View
8 keys.c
@@ -41,7 +41,7 @@ Public_Key_Packet(int len)
}
private void
-old_Public_Key_Packet()
+old_Public_Key_Packet(void)
{
time4("Public key creation time");
printf("\tValid days - %d[0 is forever]\n", Getc() * 256 + Getc());
@@ -54,7 +54,7 @@ old_Public_Key_Packet()
private void
new_Public_Key_Packet(int len)
{
- time4("Public key creation time");
+ key_creation_time4("Public key creation time");
PUBLIC = Getc();
pub_algs(PUBLIC);
switch (PUBLIC) {
@@ -83,7 +83,7 @@ new_Public_Key_Packet(int len)
}
private void
-IV (void)
+IV(void)
{
printf("\tIV - ");
dump(8);
@@ -181,7 +181,7 @@ encrypted_Secret_Key(int len)
printf("\tEncrypted RSA p\n");
printf("\tEncrypted RSA q\n");
printf("\tEncrypted RSA u\n");
- printf("\tENcrypted checksum\n");
+ printf("\tEncrypted checksum\n");
break;
case 16:
case 20:
View
128 packet.c
@@ -4,11 +4,13 @@
#include "pgpdump.h"
+private int get_new_len(int);
+private int is_partial(int);
+
#define BINARY_TAG_FLAG 0x80
#define NEW_TAG_FLAG 0x40
#define TAG_MASK 0x3f
#define PARTIAL_MASK 0x1f
-#define PARTIAL -1
#define TAG_COMPRESSED 8
#define OLD_TAG_SHIFT 2
@@ -221,51 +223,62 @@ private void
reason_for_revocation,
};
+private int
+get_new_len(int c)
+{
+ int len;
+
+ if (c < 192)
+ len = c;
+ else if (c < 224)
+ len = ((c - 192) << 8) + Getc() + 192;
+ else if (c == 255)
+ len = (Getc() << 24) | (Getc () << 16)
+ | (Getc() << 8) | Getc ();
+ else
+ len = 1 << (c & PARTIAL_MASK);
+ return len;
+}
+
+private int
+is_partial(int c)
+{
+ if (c < 224 || c == 255)
+ return NO;
+ else
+ return YES;
+}
+
public void
parse_packet(void)
{
int c, tag, len = 0;
- int partial;
+ int partial = NO;
- c = Getc();
+ c = getchar();
+ ungetc(c, stdin);
+
/* If the PGP packet is in the binary raw form, 7th bit of
* the first byte is always 1. If it is set, let's assume
* it is the binary raw form. Otherwise, let's assume
* it is encoded with radix64.
*/
if (c & BINARY_TAG_FLAG)
- ungetc(c, Get_input_file());
- else {
- ungetc(c, Get_input_file());
- armor_decode();
- }
+ set_binary();
+ else
+ set_armor();
- partial = 0;
while ((c = Getc1()) != EOF) {
- if (partial)
- tag = PARTIAL;
- else
- tag = c & TAG_MASK;
- if (partial || (c & NEW_TAG_FLAG)) {
+ partial = NO;
+ tag = c & TAG_MASK;
+ if (c & NEW_TAG_FLAG) {
printf("New: ");
- if (partial || tag == TAG_COMPRESSED)
- len = c;
- else
- len = Getc();
- partial = 0;
- if (len < 192)
- ;
- else if (len < 223)
- len = ((len - 192) << 8) + Getc() + 192;
- else if (len < 255) {
- len = 1 << (len & PARTIAL_MASK);
- partial++;
- } else
- len = (Getc() << 24) | (Getc () << 16) |
- (Getc() << 8) | Getc ();
+ c = Getc();
+ len = get_new_len(c);
+ partial = is_partial(c);
} else {
int tlen;
-
+
printf("Old: ");
tlen = c & OLD_LEN_MASK;
tag >>= OLD_TAG_SHIFT;
@@ -282,37 +295,50 @@ parse_packet(void)
(Getc() << 8) | Getc ();
break;
case 3:
- len = 0;
- while (Getc1() != EOF) len++;
+ if (tag == TAG_COMPRESSED)
+ len = 0;
+ else
+ len = EOF;
break;
}
}
- if (tag == PARTIAL) {
- printf("Partial Body(%d bytes)\n", len);
+ if (tag < TAG_NUM)
+ printf("%s(tag %d)", TAG[tag], tag);
+ else
+ printf("unknown(tag %d)", tag);
+
+ if (partial == YES)
+ printf("(%d bytes) partial start\n", len);
+ else if (tag == TAG_COMPRESSED)
+ printf("\n");
+ else if (len == EOF)
+ printf("(until eof)\n");
+ else
+ printf("(%d bytes)\n", len);
+
+ if (tag < TAG_NUM && tag_func[tag] != NULL)
+ (*tag_func[tag])(len);
+ else {
+ printf("\tUNKNOWN TAG\n");
skip(len);
- } else {
- if (tag < TAG_NUM)
- printf("%s(tag %d)", TAG[tag], tag);
- else
- printf("unknown(tag %d)", tag);
- if (partial)
- printf(" Partial Body(%d bytes)\n", len);
- else if (tag == TAG_COMPRESSED)
- printf("\n");
+ }
+ while (partial == YES) {
+ printf("New: ");
+ c = Getc();
+ len = get_new_len(c);
+ partial = is_partial(c);
+ if (partial == YES)
+ printf("\t(%d bytes) partial continue\n", len);
else
- printf("(%d bytes)\n", len);
- if (tag < TAG_NUM && tag_func[tag] != NULL)
- (*tag_func[tag])(len);
- else {
- printf("\tUNKNOWN TAG\n");
- skip(len);
- }
+ printf("\t(%d bytes) partial end\n", len);
+ skip(len);
}
+ if (len == EOF) return;
}
}
public void
-parse_subpacket (char *prefix, int tlen)
+parse_subpacket(char *prefix, int tlen)
{
int len, sub;
View
64 pgpdump.1
@@ -0,0 +1,64 @@
+.\" Copyright (C) 2001 Kazu Yamamoto
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the team nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\" n
+.\" THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
+.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.Dd April 3, 2001
+.Dt PGPDUMP 1
+.Os
+.Sh NAME
+.Nm pgpdump
+.Nd A PGP packet visualizer
+.\"
+.Sh SYNOPSIS
+.Nm
+.Oo Ar options Oc
+.Oo Ar PGPfile Oc
+.\"
+.Sh DESCRIPTION
+The
+.Nm
+is a PGP packet visualizer which displays the packet format
+of OpenPGP (RFC 2440 + bis) and PGP version 2 (RFC 1991).
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl h
+Displays a help message.
+.It Fl i
+Dumps integer packets
+.It Fl l
+Prints literal packets.
+.It Fl m
+Prints marker packets.
+.It Fl p
+Dumps private packets.
+.It Fl u
+Displays UTC time.
+.It Fl v
+Displays the version.
+.It
+.El
+.\"
View
129 pgpdump.c
@@ -3,8 +3,9 @@
*/
#include "pgpdump.h"
+#include <stdarg.h>
-private char *pgpdump_version = "0.06, Copyright (C) 1998-2001 Kazu Yamamoto";
+private char *pgpdump_version = "0.07, Copyright (C) 1998-2001 Kazu Yamamoto";
private char *prog;
private void usage(void);
@@ -13,19 +14,45 @@ private void version(void);
private void
usage(void)
{
- fprintf(stderr, "%s [-h|-m|-l|-i|-p] PGPfile\n", prog);
+ fprintf(stderr, "%s -h|-v\n", prog);
+ fprintf(stderr, "%s [-i|-l|-m|-p|-u] [PGPfile]\n", prog);
fprintf(stderr, "\t -h -- displays this help\n");
- fprintf(stderr, "\t -m -- prints marker\n");
- fprintf(stderr, "\t -l -- prints literal\n");
- fprintf(stderr, "\t -i -- dump integer\n");
- fprintf(stderr, "\t -p -- dump private\n");
- exit(ERROR);
+ fprintf(stderr, "\t -v -- displays version\n");
+ fprintf(stderr, "\t -i -- dumps integer packets\n");
+ fprintf(stderr, "\t -l -- prints literal packets\n");
+ fprintf(stderr, "\t -m -- prints marker packets\n");
+ fprintf(stderr, "\t -p -- dumps private packets\n");
+ fprintf(stderr, "\t -u -- displays UTC time\n");
+ exit(SUCCESS);
+}
+
+public void
+warning(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (prog != NULL)
+ fprintf(stderr, "%s: ", prog);
+ va_start(ap, fmt);
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
}
public void
-error(char *msg)
+warn_exit(const char *fmt, ...)
{
- fprintf(stderr, "%s: %s\n", prog, msg);
+ va_list ap;
+
+ if (prog != NULL)
+ fprintf(stderr, "%s: ", prog);
+ va_start(ap, fmt);
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+
exit(ERROR);
}
@@ -33,19 +60,19 @@ private void
version(void)
{
fprintf(stderr, "%s version %s\n", prog, pgpdump_version);
- exit(ERROR);
+ exit(SUCCESS);
}
int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
{
char *target = NULL;
- FILE *input_stream;
iflag = 0;
- mflag = 0;
lflag = 0;
+ mflag = 0;
pflag = 0;
+ uflag = 0;
if ((prog = strrchr(argv[0], '/')) == NULL)
prog = argv[0];
@@ -72,6 +99,9 @@ main (int argc, char *argv[])
case 'p':
pflag++;
break;
+ case 'u':
+ uflag++;
+ break;
default:
usage();
}
@@ -81,81 +111,14 @@ main (int argc, char *argv[])
}
}
- if (target == NULL)
- error("no file specified.");
- if ((input_stream = fopen(target, "r")) == NULL)
- error("can't open the file.");
- Set_input_file(input_stream);
+ if (target != NULL)
+ if (freopen(target, "rb", stdin) == NULL)
+ warn_exit("can't open %s.", target);
parse_packet();
exit(SUCCESS);
}
-private FILE *input = NULL;
-private int MAGIC_COUNT = 0;
-
-public void
-Set_input_file(FILE *file)
-{
- input = file;
-}
-
-public FILE *
-Get_input_file(void)
-{
- return input;
-}
-
-public int
-Getc(void)
-{
- int c = getc(input);
-
- MAGIC_COUNT++;
- if (c == EOF) exit(ERROR);
- return c;
-}
-
-public int
-Getc1(void)
-{
- MAGIC_COUNT++;
- return getc(input);
-}
-
-public int
-Getc_getlen(void)
-{
- return MAGIC_COUNT;
-}
-
-public void
-Getc_resetlen(void)
-{
- MAGIC_COUNT = 0;
-}
-
-public FILE *
-Get_temp_file(char **file_name) {
- int fd;
- char *name = (char *)malloc(BUFSIZ);
- FILE *stream;
-
- if (name == NULL)
- error("memory exhausted.");
-
- strcpy(name, "/tmp/pgpdump.XXXXXX");
-
- if ((fd = mkstemp(name)) == -1)
- error("can't open a temporary file.");
-
- if ((stream = fdopen(fd, "r+")) == NULL)
- error("can't open a temporary file.");
-
- *file_name = name;
- return stream;
-}
-
/*
* Copyright (C) 1998 Kazuhiko Yamamoto
* All rights reserved.
View
63 pgpdump.h
@@ -20,33 +20,53 @@
#define SUCCESS 0
#define ERROR 1
+#define YES 1
+#define NO 0
+
#define NULL_VER -1
/*
* Global
*/
-int mflag;
-int lflag;
int iflag;
+int lflag;
+int mflag;
int pflag;
+int uflag;
/*
* pgpdump.c
*/
-public void error(char *);
-public void Set_input_file(FILE *);
-public FILE *Get_input_file(void);
+public void warning(const char *, ...);
+public void warn_exit(const char *, ...);
+
+/*
+ * buffer.c
+ */
+
+public void Compressed_Data_Packet(int);
+
+public void set_armor(void);
+public void set_binary(void);
+
public int Getc(void);
public int Getc1(void);
public int Getc_getlen(void);
public void Getc_resetlen(void);
-public FILE * Get_temp_file(char **);
-#define skip(len) {int i; for (i = 0; i < (len); i++) Getc();}
-#define pdump(len) {int i; for (i = 0; i < (len); i++) putchar(Getc());}
-#define dump(len) {int i; for (i = 0; i < (len); i++) printf("%02x ", Getc());}
+#define skip(len) do {\
+ int i; for (i = 0; i < (len); i++) Getc();\
+ } while (0)
+
+#define pdump(len) do {\
+ int i; for (i = 0; i < (len); i++) putchar(Getc());\
+ } while (0)
+
+#define dump(len) do {\
+ int i; for (i = 0; i < (len); i++) printf("%02x ", Getc());\
+ } while (0)
/*
* packet.c
@@ -59,12 +79,17 @@ public void parse_subpacket(char *, int);
* types.c
*/
-public void pub_algs(int);
-public void sym_algs(int);
-public void comp_algs(int);
-public void hash_algs(int);
+public void pub_algs(unsigned int);
+public void sym_algs(unsigned int);
+public void comp_algs(unsigned int);
+public void hash_algs(unsigned int);
public void key_id(void);
+public void fingerprint(void);
public void time4(char *);
+public void sig_creation_time4(char *);
+public void sig_expiration_time4(char *);
+public void key_creation_time4(char *);
+public void key_expiration_time4(char *);
public void ver(int, int, int);
public void string_to_key(void);
public void multi_precision_integer(char *);
@@ -94,12 +119,6 @@ public void Secret_Key_Packet(int);
public void Secret_Subkey_Packet(int);
/*
- * uncompress.c
- */
-
-public void Compressed_Data_Packet(int);
-
-/*
* signature.c
*/
@@ -132,12 +151,6 @@ public void key_flags(int);
public void signer_user_id(int);
public void reason_for_revocation(int);
-/*
- * armor.c
- */
-
-public void armor_decode(void);
-
#endif /* _PGP_DUMP_H_ */
/*
View
2  signature.c
@@ -129,7 +129,7 @@ Signature_Packet(int len)
}
private void
-old_Signature_Packet (int len)
+old_Signature_Packet(int len)
{
int pub;
View
98 subfunc.c
@@ -8,14 +8,14 @@ public void
signature_creation_time(int len)
{
printf("\t");
- time4("Time");
+ sig_creation_time4("Time");
}
public void
signature_expiration_time(int len)
{
printf("\t");
- time4("Time");
+ sig_expiration_time4("Time");
}
public void
@@ -32,10 +32,10 @@ exportable_certification(int len)
public void
trust_signature(int len)
{
- printf("\t\tlevel - ");
+ printf("\t\tLevel - ");
dump(1);
printf("\n");
- printf("\t\tamount - ");
+ printf("\t\tAmount - ");
dump(1);
printf("\n");
}
@@ -63,7 +63,7 @@ public void
key_expiration_time(int len)
{
printf("\t");
- time4("Time");
+ key_expiration_time4("Time");
}
public void
@@ -87,9 +87,19 @@ preferred_symmetric_algorithms(int len)
public void
revocation_key(int len)
{
- printf("\t\txxx\n");
- skip(len);
- /* xxx */
+ int c = Getc();
+ printf("\t\tClass - ");
+ if (c == 0x80)
+ printf("Unrestricted");
+ else if (c == 0xc0)
+ printf("Sensitive");
+ else
+ printf("Unknown class(%02x)", c);
+ printf("\n");
+ printf("\t");
+ pub_algs(Getc());
+ printf("\t");
+ fingerprint();
}
public void
@@ -102,9 +112,27 @@ issuer_key_ID(int len)
public void
notation_data(int len)
{
- printf("\t\txxx\n");
- skip(len);
- /* xxx */
+ int nlen, vlen, human = 0;
+ printf("\t\tFlag - ");
+ if (Getc() & 0x80) {
+ printf("Human-readable\n");
+ human = 1;
+ }
+ skip(3);
+ nlen = Getc() * 256 + Getc();
+ vlen = Getc() * 256 + Getc();
+ printf("\t\tName - ");
+ if (human)
+ pdump(nlen);
+ else
+ dump(nlen);
+ printf("\n");
+ printf("\t\tValue - ");
+ if (human)
+ pdump(vlen);
+ else
+ dump(vlen);
+ printf("\n");
}
public void
@@ -133,6 +161,7 @@ key_server_preferences(int len)
printf("\t\tFlag - ");
if (Getc() & 0x80)
printf("No-modify\n");
+ skip(len - 1);
}
public void
@@ -165,25 +194,54 @@ policy_URL(int len)
public void
key_flags(int len)
{
- printf("\t\txxx\n");
- skip(len);
- /* xxx */
+ int c = Getc();
+ if (c & 0x01)
+ printf("\t\tFlag - This key may be used to certify other keys\n");
+ if (c & 0x02)
+ printf("\t\tFlag - This key may be used to sign data\n");
+ if (c & 0x04)
+ printf("\t\tFlag - This key may be used to encrypt communications\n");
+ if (c & 0x08)
+ printf("\t\tFlag - This key may be used to encrypt storage\n");
+ if (c & 0x10)
+ printf("\t\tFlag - The private component of this key may have been split by "
+ "a secret-sharing mechanism\n");
+ if (c & 0x80)
+ printf("\t\tFlag - The private component of this key may be in the "
+ "possession of more than one person\n");
+ if ((c & ~0x60) == 0)
+ printf("\t\tFlag - \n");
+ skip(len-1);
}
public void
signer_user_id(int len)
{
- printf("\t\txxx\n");
- skip(len);
- /* xxx */
+ printf("\t");
+ User_ID_Packet(len);
}
public void
reason_for_revocation(int len)
{
- printf("\t\txxx\n");
- skip(len);
- /* xxx */
+ int c = Getc();
+ printf("\t\tReason - ");
+ if (c == 0)
+ printf("No reason specified");
+ else if (c == 0x01)
+ printf("Key is superceded");
+ else if (c == 0x02)
+ printf("Key material has been compromised");
+ else if (c == 0x03)
+ printf("Key is retired and no longer used");
+ else if (c == 0x20)
+ printf("User ID information is no longer valid");
+ else
+ printf("Unknown reason(%02x)", c);
+ printf("\n");
+ printf("\t\tComment - ");
+ pdump(len - 1);
+ printf("\n");
}
View
99 types.c
@@ -5,6 +5,10 @@
#include "pgpdump.h"
#include <time.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] = {
@@ -33,7 +37,7 @@ PUB_ALGS[PUB_ALGS_NUM] = {
};
public void
-pub_algs(int type)
+pub_algs(unsigned int type)
{
printf("\tPub alg - ");
if (type < PUB_ALGS_NUM)
@@ -60,7 +64,7 @@ SYM_ALGS[SYM_ALGS_NUM] = {
};
public void
-sym_algs(int type)
+sym_algs(unsigned int type)
{
printf("\tSym alg - ");
if (type < SYM_ALGS_NUM)
@@ -79,7 +83,7 @@ COMP_ALGS[] = {
};
public void
-comp_algs(int type)
+comp_algs(unsigned int type)
{
printf("\tComp alg - ");
if (type < COMP_ALGS_NUM)
@@ -103,13 +107,13 @@ HASH_ALGS[] = {
};
public void
-hash_algs(int type)
+hash_algs(unsigned int type)
{
printf("\tHash alg - ");
if (type < HASH_ALGS_NUM)
printf(HASH_ALGS[type]);
else
- printf("unknown");
+ printf("unknown(hash %d)", type);
printf("\n");
}
@@ -122,6 +126,33 @@ key_id(void)
}
public void
+fingerprint(void)
+{
+ printf("\tFingerprint - ");
+ dump(20);
+ printf("\n");
+}
+
+private void
+time4_base(char *str, time_t *pt)
+{
+ struct tm* ptm;
+ char* pat;
+ char* pyr;
+
+ ptm = uflag ? gmtime(pt) : localtime(pt);
+
+ pat = asctime(ptm);
+ pat[19] = 0;
+ pyr = pat + 20;
+
+ 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);
+}
+
+public void
time4(char *str)
{
int i;
@@ -130,7 +161,63 @@ time4(char *str)
for (i = 0; i < 4; i++)
t = t * 256 + Getc();
- printf("\t%s - %s", str, ctime(&t)); /* ctime is terminated by \n. */
+ time4_base(str, &t);
+}
+
+public void
+sig_creation_time4(char *str)
+{
+ int i;
+ time_t t = 0;
+
+ for (i = 0; i < 4; i++)
+ t = t * 256 + Getc();
+
+ sig_creation_time = t;
+
+ time4_base(str, &t);
+}
+
+public void
+sig_expiration_time4(char *str)
+{
+ int i;
+ time_t t = 0;
+
+ for (i = 0; i < 4; i++)
+ t = t * 256 + Getc();
+
+ t += sig_creation_time;
+
+ time4_base(str, &t);
+}
+
+public void
+key_creation_time4(char *str)
+{
+ int i;
+ time_t t = 0;
+
+ for (i = 0; i < 4; i++)
+ t = t * 256 + Getc();
+
+ key_creation_time = t;
+
+ time4_base(str, &t);
+}
+
+public void
+key_expiration_time4(char *str)
+{
+ int i;
+ time_t t = 0;
+
+ for (i = 0; i < 4; i++)
+ t = t * 256 + Getc();
+
+ t += key_creation_time;
+
+ time4_base(str, &t);
}
public void
View
132 uncomp.c
@@ -1,132 +0,0 @@
-/*
- * uncompress.c
- * NOT YET IMPLEMENTED
- */
-
-/*
- * 0 uncompressed
- * 1 ZIP 1951 without zlib header
- * inflateInit2 (strm, -13)
- * inflateInit2_(strm, -13, ZLIB_VERSION, sizeof(z_stream))
- * 2 ZLIB 1950 with zlib header
- * inflateInit (strm)
- * inflateInit_ (strm, ZLIB_VERSION, sizeof(z_stream))
- * inflateInit2_(strm, DEF_WBITS(15?), ZLIB_VERSION, sizeof(z_stream))
- */
-
-#include "pgpdump.h"
-
-#ifdef HAVE_LIBZ
-# include <zlib.h>
-#endif /* HAVE_LIBZ */
-
-public void
-Compressed_Data_Packet(int len)
-{
-#ifdef HAVE_LIBZ
- int alg = Getc();
- int ilen = BUFSIZ, olen = BUFSIZ * 8;
- int err = 0, inflated = 0;
- char ibuf[ilen], obuf[olen], *outfile;
- FILE *input = Get_input_file(), *output;
- z_stream z;
-
- comp_algs(alg);
-
- z.zalloc = (alloc_func)0;
- z.zfree = (free_func)0;
- z.opaque = (voidpf)0;
-
- switch (alg) {
- case 0:
- return;
- case 1:
- err = inflateInit2(&z, -13);
- break;
- case 2:
- err = inflateInit(&z);
- break;
- default:
- error("unknown compress algorithm.");
- }
-
- if (err != Z_OK)
- error("inflateInit error.");
-
- output = Get_temp_file(&outfile);
-
- z.avail_in = 0;
- z.next_out = obuf;
- z.avail_out = olen;
-
- do {
- if (z.avail_in == 0) {
- ilen = fread(ibuf, sizeof(char), ilen, input);
- z.next_in = ibuf;
- z.avail_in = ilen;
- }
-
- err = inflate(&z, Z_SYNC_FLUSH);
- if (err == Z_BUF_ERROR) break; /* xxx */
- if (err != Z_OK && err != Z_STREAM_END) {
- unlink(outfile);
- error("inflate error.");
- }
-
- inflated = olen - z.avail_out;
- if (inflated > 0) {
- fwrite(obuf, sizeof(char), inflated, output);
- z.next_out = obuf;
- z.avail_out = olen;
- }
- } while (err != Z_STREAM_END);
-
- if (inflateEnd(&z) != Z_OK) {
- unlink(outfile);
- error("inflateEnd error");
- }
-
- fclose(input);
- fclose(output);
- if ((output = fopen(outfile, "r")) == NULL) {
- unlink(outfile);
- error("can't reopen the stream.");
- }
-
- Set_input_file(output);
- unlink(outfile);
-#else /* HAVE_LIBZ */
- comp_algs(Getc());
- error("Can't uncompress without zlib.");
-#endif /* HAVE_LIBZ */
-}
-
-/*
- * Copyright (C) 1998 Kazuhiko Yamamoto
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
Please sign in to comment.
Something went wrong with that request. Please try again.