From: markus schnalke Date: Wed, 11 Apr 2012 13:41:05 +0000 (+0200) Subject: Removed RFC 1864 (Content-MD5) support. I.e. -check switches. X-Git-Tag: mmh-thesis-end~99 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=31dc797eb5178970d68962ca8939da3fd9a8efda Removed RFC 1864 (Content-MD5) support. I.e. -check switches. Transfer integrity should be cared for in the transfer protocols. Data integrity is better covered with digital signatures. --- diff --git a/h/Makefile.in b/h/Makefile.in index f0152dd..de70d7a 100644 --- a/h/Makefile.in +++ b/h/Makefile.in @@ -9,7 +9,7 @@ VPATH = @srcdir@ # header files included in distribution HDRS = addrsbr.h aliasbr.h crawl_folders.h dropsbr.h fmt_compile.h \ - fmt_scan.h md5.h mf.h mh.h mhcachesbr.h mhparse.h mime.h \ + fmt_scan.h mf.h mh.h mhcachesbr.h mhparse.h mime.h \ nmh.h prototypes.h rcvmail.h \ scansbr.h signals.h tws.h utils.h diff --git a/h/md5.h b/h/md5.h deleted file mode 100644 index 8a1104a..0000000 --- a/h/md5.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -** md5.h -- header file for md5 message digest -** taken from RFC-1321/Appendices A.1/A.2 -*/ - -/* -** RSAREF types and constants -*/ - -/* -** Use include for nmh/mh -*/ - -#include - -/* -** Use prototypes for nmh/mh -*/ -#define PROTOTYPES 1 - -/* -** PROTOTYPES should be set to one if and only if the compiler -** supports function argument prototyping. The following makes -** PROTOTYPES default to 0 if it has not already been defined -** with C compiler flags. -*/ -#ifndef PROTOTYPES -# define PROTOTYPES 0 -#endif - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -/* UINT2 defines a two byte word */ -typedef unsigned short int UINT2; - -/* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; - -/* -** PROTO_LIST is defined depending on how PROTOTYPES is defined above. -** If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it -** returns an empty list. -*/ -#if PROTOTYPES -# define PROTO_LIST(list) list -#else -# define PROTO_LIST(list) () -#endif - -/* MD5.H - header file for MD5C.C */ - -/* -** Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -** rights reserved. -** -** License to copy and use this software is granted provided that it -** is identified as the "RSA Data Security, Inc. MD5 Message-Digest -** Algorithm" in all material mentioning or referencing this software -** or this function. -** -** License is also granted to make and use derivative works provided -** that such works are identified as "derived from the RSA Data -** Security, Inc. MD5 Message-Digest Algorithm" in all material -** mentioning or referencing the derived work. -** -** RSA Data Security, Inc. makes no representations concerning either -** the merchantability of this software or the suitability of this -** software for any particular purpose. It is provided "as is" -** without express or implied warranty of any kind. -** -** These notices must be retained in any copies of any part of this -** documentation and/or software. -*/ - -/* MD5 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD5_CTX; - -void MD5Init PROTO_LIST ((MD5_CTX *)); -void MD5Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int)); -void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); diff --git a/h/mhparse.h b/h/mhparse.h index 71c3563..af9b8ca 100644 --- a/h/mhparse.h +++ b/h/mhparse.h @@ -99,10 +99,6 @@ struct Content { CE c_cefile; /* structure holding decoded content */ int c_encoding; /* internal flag for encoding type */ - /* Content-MD5 info */ - int c_digested; /* have we seen this header before? */ - unsigned char c_digest[16]; /* decoded MD5 checksum */ - /* pointers to content-specific structures */ void *c_ctparams; /* content type specific data */ struct exbody *c_ctexbody; /* data for type message/external */ @@ -278,5 +274,3 @@ int get_ctinfo(unsigned char *, CT, int); int params_external(CT, int); int open7Bit(CT, char **); void close_encoding(CT); - -extern int checksw; /* Add Content-MD5 field */ diff --git a/h/mime.h b/h/mime.h index dc37db2..22c2349 100644 --- a/h/mime.h +++ b/h/mime.h @@ -10,7 +10,6 @@ #define ID_FIELD "Content-ID" #define DESCR_FIELD "Content-Description" #define DISPO_FIELD "Content-Disposition" -#define MD5_FIELD "Content-MD5" #define isatom(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ diff --git a/man/mhbuild.man1 b/man/mhbuild.man1 index db44f02..babc1b2 100644 --- a/man/mhbuild.man1 +++ b/man/mhbuild.man1 @@ -16,7 +16,6 @@ mhbuild \- translate MIME composition draft .RB [ \-rfc934mode " | " \-norfc934mode ] .RB [ \-contentid " | " \-nocontentid ] .RB [ \-verbose " | " \-noverbose ] -.RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .ad @@ -441,16 +440,6 @@ This third part will be text/plain /home/foobar/lib/picture.gif .fi .RE -.SS "Integrity Check" -If -.B mhbuild -is given the -.B \-check -switch, then it will also associate -an integrity check with each \*(lqleaf\*(rq content. This will add a -Content-MD5 header field to the content, along with the md5 sum of the -unencoded contents. This may be used by the receiver of the message to -verify that the contents of the message were not changed in transport. .SS "Transfer Encodings" After @@ -461,16 +450,6 @@ which transfer encoding to use. It will check for 8bit data, long lines, spaces at the end of lines, and clashes with multipart boundaries. It will then choose a transfer encoding appropriate for each content type. .PP -If an integrity check is being associated with each content by using -the -.B \-check -switch, then -.B mhbuild -will encode each content with -a transfer encoding, even it the content contains only 7\-bit data. This -is to increase the likelihood that the content is not changed while in -transport. -.PP The switch .B \-ebcdicsafe will cause @@ -637,7 +616,6 @@ mhlist(1), mhshow(1), mhstore(1), .RB ` \-realsize ' .RB ` \-norfc934mode ' .RB ` \-contentid ' -.RB ` \-nocheck ' .RB ` \-noebcdicsafe ' .RB ` \-noverbose ' .fi diff --git a/man/mhlist.man1 b/man/mhlist.man1 index 14912a2..e6016bc 100644 --- a/man/mhlist.man1 +++ b/man/mhlist.man1 @@ -24,7 +24,6 @@ mhlist \- list information about MIME messages .IR policy ] .RB [ \-wcache .IR policy ] -.RB [ \-check " | " \-nocheck ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-version ] .RB [ \-help ] @@ -142,17 +141,6 @@ act on a message/external-body content, then the switch must be used twice: once for message/external-body and once for the content externally referenced. -.SS "Checking the Contents" -The -.B \-check -switch tells -.B mhlist -to check each content for an -integrity checksum. If a content has such a checksum (specified as a -Content-MD5 header field), then -.B mhlist -will attempt to verify the -integrity of the content. .SH FILES .fc ^ ~ @@ -177,7 +165,6 @@ mhbuild(1), mhshow(1), mhstore(1), sendfiles(1) .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" -.RB ` \-nocheck ' .RB ` \-headers ' .RB ` \-realsize ' .RB ` \-rcache \ ask' diff --git a/man/mhshow.man1 b/man/mhshow.man1 index 13cb015..57bfa31 100644 --- a/man/mhshow.man1 +++ b/man/mhshow.man1 @@ -24,7 +24,6 @@ mhshow \- display MIME messages .IR policy ] .RB [ \-wcache .IR policy ] -.RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .ad @@ -126,17 +125,6 @@ non\-empty, then .B mhshow will remove each of the messages shown from each sequence named by the profile entry. -.SS "Checking the Contents" -The -.B \-check -switch tells -.B mhshow -to check each content for an -integrity checksum. If a content has such a checksum (specified as a -Content-MD5 header field), then -.B mhshow -will attempt to verify the -integrity of the content. .SS "Showing the Contents" The headers of each message are displayed with .B mhl @@ -572,7 +560,6 @@ mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1) .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" -.RB ` \-nocheck ' .RB ` \-form \ mhl.headers' .RB ` \-rcache \ ask' .RB ` \-noverbose ' diff --git a/man/mhstore.man1 b/man/mhstore.man1 index ec4c7a1..0a338e7 100644 --- a/man/mhstore.man1 +++ b/man/mhstore.man1 @@ -23,7 +23,6 @@ mhstore \- store contents of MIME messages into files .IR policy ] .RB [ \-wcache .IR policy ] -.RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .ad @@ -124,17 +123,6 @@ desirable to act on a message/external-body content, then the .B \-type switch must be used twice: once for message/external-body and once for the content externally referenced. -.SS "Checking the Contents" -The -.B \-check -switch tells -.B mhstore -to check each content for -an integrity checksum. If a content has such a checksum (specified -as a Content-MD5 header field), then -.B mhstore -will attempt to -verify the integrity of the content. .SS "Storing the Contents" The .B mhstore @@ -504,7 +492,6 @@ mhbuild(1), mhlist(1), mhshow(1), sendfiles(1) .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-noauto ' -.RB ` \-nocheck ' .RB ` \-rcache \ ask' .RB ` \-wcache \ ask' diff --git a/uip/Makefile.in b/uip/Makefile.in index 0ae3167..6d6347d 100644 --- a/uip/Makefile.in +++ b/uip/Makefile.in @@ -65,7 +65,7 @@ SCMDS = inc # source files SRCS = ali.c aliasbr.c anno.c ap.c burst.c comp.c \ dist.c distsbr.c dp.c dropsbr.c flist.c fmtdump.c \ - folder.c forw.c inc.c mark.c mmh.sh mmhwrap.sh md5.c mhbuild.c \ + folder.c forw.c inc.c mark.c mmh.sh mmhwrap.sh mhbuild.c \ mhcachesbr.c mhfree.c mhl.c mhlist.c mhlistsbr.c \ mhmail.c mhmisc.c mhoutsbr.c mhparam.c mhparse.c \ mhpath.c mhshow.c mhshowsbr.c mhstore.c mhtest.c \ @@ -134,14 +134,14 @@ mmhwrap: mmhwrap.sh sed "s,%bindir%,"$(bindir)"," $(srcdir)/mmhwrap.sh >mmhwrap chmod +x mmhwrap -mhbuild: mhbuild.o mhcachesbr.o mhlistsbr.o mhoutsbr.o mhmisc.o mhfree.o mhparse.o termsbr.o md5.o $(LOCALLIBS) - $(LINK) mhbuild.o mhcachesbr.o mhlistsbr.o mhoutsbr.o mhmisc.o mhfree.o mhparse.o md5.o $(LINKLIBS) $(TERMLIB) +mhbuild: mhbuild.o mhcachesbr.o mhlistsbr.o mhoutsbr.o mhmisc.o mhfree.o mhparse.o termsbr.o $(LOCALLIBS) + $(LINK) mhbuild.o mhcachesbr.o mhlistsbr.o mhoutsbr.o mhmisc.o mhfree.o mhparse.o $(LINKLIBS) $(TERMLIB) mhl: mhl.o termsbr.o $(LOCALLIBS) $(LINK) mhl.o termsbr.o $(LINKLIBS) $(TERMLIB) -mhlist: mhlist.o mhparse.o mhcachesbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LOCALLIBS) - $(LINK) mhlist.o mhparse.o mhcachesbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LINKLIBS) $(TERMLIB) +mhlist: mhlist.o mhparse.o mhcachesbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o $(LOCALLIBS) + $(LINK) mhlist.o mhparse.o mhcachesbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o $(LINKLIBS) $(TERMLIB) mhmail: mhmail.o $(LOCALLIBS) $(LINK) mhmail.o $(LINKLIBS) @@ -152,14 +152,14 @@ mhparam: mhparam.o $(LOCALLIBS) mhpath: mhpath.o $(LOCALLIBS) $(LINK) mhpath.o $(LINKLIBS) -mhshow: mhshow.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LOCALLIBS) - $(LINK) mhshow.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LINKLIBS) $(TERMLIB) +mhshow: mhshow.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o $(LOCALLIBS) + $(LINK) mhshow.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o $(LINKLIBS) $(TERMLIB) -mhstore: mhstore.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LOCALLIBS) - $(LINK) mhstore.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LINKLIBS) $(TERMLIB) +mhstore: mhstore.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o $(LOCALLIBS) + $(LINK) mhstore.o mhparse.o mhcachesbr.o mhshowsbr.o mhlistsbr.o mhmisc.o mhfree.o termsbr.o $(LINKLIBS) $(TERMLIB) -mhtest: mhtest.o mhparse.o mhcachesbr.o mhoutsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LOCALLIBS) - $(LINK) mhtest.o mhparse.o mhcachesbr.o mhoutsbr.o mhmisc.o mhfree.o termsbr.o md5.o $(LINKLIBS) $(TERMLIB) +mhtest: mhtest.o mhparse.o mhcachesbr.o mhoutsbr.o mhmisc.o mhfree.o termsbr.o $(LOCALLIBS) + $(LINK) mhtest.o mhparse.o mhcachesbr.o mhoutsbr.o mhmisc.o mhfree.o termsbr.o $(LINKLIBS) $(TERMLIB) msgchk: msgchk.o $(LOCALLIBS) $(LINK) msgchk.o $(LINKLIBS) diff --git a/uip/md5.c b/uip/md5.c deleted file mode 100644 index 6737a3e..0000000 --- a/uip/md5.c +++ /dev/null @@ -1,309 +0,0 @@ -/* -** md5.c -- md5 message digest algorithm -** taken from RFC-1321/Appendix A.3 -*/ - -/* -** MD5C.C -- RSA Data Security, Inc., MD5 message-digest algorithm -*/ - -/* -** Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -** rights reserved. -** -** License to copy and use this software is granted provided that it -** is identified as the "RSA Data Security, Inc. MD5 Message-Digest -** Algorithm" in all material mentioning or referencing this software -** or this function. -** -** License is also granted to make and use derivative works provided -** that such works are identified as "derived from the RSA Data -** Security, Inc. MD5 Message-Digest Algorithm" in all material -** mentioning or referencing the derived work. -** -** RSA Data Security, Inc. makes no representations concerning either -** the merchantability of this software or the suitability of this -** software for any particular purpose. It is provided "as is" -** without express or implied warranty of any kind. -** -** These notices must be retained in any copies of any part of this -** documentation and/or software. -*/ - -#include - -/* -** Constants for MD5Transform routine. -*/ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); -static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); -static void Decode PROTO_LIST ((UINT4 *, unsigned char *, unsigned int)); - -static unsigned char PADDING[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* -** F, G, H and I are basic MD5 functions. -*/ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* -** ROTATE_LEFT rotates x left n bits. -*/ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. -** Rotation is separate from addition to prevent recomputation. -*/ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ -} -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ -} -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ -} -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ -} - -/* -** MD5 initialization. Begins an MD5 operation, writing a new context. -*/ -void MD5Init (context) -MD5_CTX *context; /* context */ -{ - context->count[0] = context->count[1] = 0; - /* - ** Load magic initialization constants. - */ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -} - -/* -** MD5 block update operation. Continues an MD5 message-digest -** operation, processing another message block, and updating the -** context. -*/ -void MD5Update (context, input, inputLen) -MD5_CTX *context; /* context */ -unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) - context->count[1]++; - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. */ - if (inputLen >= partLen) { - memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD5Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform (context->state, &input[i]); - - index = 0; - } else - i = 0; - - /* Buffer remaining input */ - memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); -} - -/* -** MD5 finalization. Ends an MD5 message-digest operation, writing the -** the message digest and zeroizing the context. -*/ -void MD5Final (digest, context) -unsigned char digest[16]; /* message digest */ -MD5_CTX *context; /* context */ -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64. */ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD5Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD5Update (context, bits, 8); - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information. */ - memset ((POINTER)context, 0, sizeof(*context)); -} - -/* -** MD5 basic transformation. Transforms state based on block. -*/ -static void MD5Transform (state, block) -UINT4 state[4]; -unsigned char block[64]; -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - - /* Round 1 */ - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ - FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ - FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ - FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ - FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ - FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ - GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ - GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ - GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ - GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ - GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ - HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ - HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ - HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ - HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ - II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ - II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ - II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ - II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ - II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ - II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. */ - memset ((POINTER)x, 0, sizeof(x)); -} - -/* -** Encodes input (UINT4) into output (unsigned char). Assumes len is -** a multiple of 4. -*/ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - -/* -** Decodes input (unsigned char) into output (UINT4). Assumes len is -** a multiple of 4. -*/ -static void Decode (output, input, len) -UINT4 *output; -unsigned char *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | - (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 5f29d0e..e6caba3 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -31,47 +30,43 @@ #include static struct swit switches[] = { -#define CHECKSW 0 - { "check", 0 }, -#define NCHECKSW 1 - { "nocheck", 0 }, -#define EBCDICSW 2 +#define EBCDICSW 0 { "ebcdicsafe", 0 }, -#define NEBCDICSW 3 +#define NEBCDICSW 1 { "noebcdicsafe", 0 }, -#define HEADSW 4 +#define HEADSW 2 { "headers", 0 }, -#define NHEADSW 5 +#define NHEADSW 3 { "noheaders", 0 }, -#define LISTSW 6 +#define LISTSW 4 { "list", 0 }, -#define NLISTSW 7 +#define NLISTSW 5 { "nolist", 0 }, -#define SIZESW 8 +#define SIZESW 6 { "realsize", 0 }, -#define NSIZESW 9 +#define NSIZESW 7 { "norealsize", 0 }, -#define RFC934SW 10 +#define RFC934SW 8 { "rfc934mode", 0 }, -#define NRFC934SW 11 +#define NRFC934SW 9 { "norfc934mode", 0 }, -#define VERBSW 12 +#define VERBSW 10 { "verbose", 0 }, -#define NVERBSW 13 +#define NVERBSW 11 { "noverbose", 0 }, -#define RCACHESW 14 +#define RCACHESW 12 { "rcache policy", 0 }, -#define WCACHESW 15 +#define WCACHESW 13 { "wcache policy", 0 }, -#define CONTENTIDSW 16 +#define CONTENTIDSW 14 { "contentid", 0 }, -#define NCONTENTIDSW 17 +#define NCONTENTIDSW 15 { "nocontentid", 0 }, -#define VERSIONSW 18 +#define VERSIONSW 16 { "version", 0 }, -#define HELPSW 19 +#define HELPSW 17 { "help", 0 }, -#define DEBUGSW 20 +#define DEBUGSW 18 { "debug", -5 }, { NULL, 0 } }; @@ -117,7 +112,6 @@ static void set_id(CT, int); static int compose_content(CT); static int scan_content(CT); static int build_headers(CT); -static char *calculate_digest(CT, int); static CT build_mime(char *); @@ -232,13 +226,6 @@ main(int argc, char **argv) } continue; - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - case EBCDICSW: ebcdicsw++; continue; @@ -1730,8 +1717,7 @@ scan_content(CT ct) *ep = cp; } - if (contains8bit || ebcdicunsafe || linelen || linespace || - checksw) + if (contains8bit || ebcdicunsafe || linelen || linespace) ct->c_encoding = CE_QUOTED; else ct->c_encoding = CE_7BIT; @@ -1739,8 +1725,7 @@ scan_content(CT ct) case CT_APPLICATION: /* For application type, use base64, except when postscript */ - if (contains8bit || ebcdicunsafe || linelen || linespace || - checksw) + if (contains8bit || ebcdicunsafe || linelen || linespace) ct->c_encoding = (ct->c_subtype == APPLICATION_POSTSCRIPT) ? CE_QUOTED : CE_BASE64; @@ -1899,16 +1884,6 @@ skip_headers: return OK; /* - ** output the Content-MD5 - */ - if (checksw) { - np = getcpy(MD5_FIELD); - vp = calculate_digest(ct, (ct->c_encoding == CE_QUOTED) ? - 1 : 0); - add_header(ct, np, vp); - } - - /* ** output the Content-Transfer-Encoding */ switch (ct->c_encoding) { @@ -1992,97 +1967,3 @@ skip_headers: return OK; } - - -static char nib2b64[0x40+1] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -static char * -calculate_digest(CT ct, int asciiP) -{ - int cc; - char buffer[BUFSIZ], *vp, *op; - unsigned char *dp; - unsigned char digest[16]; - unsigned char outbuf[25]; - FILE *in; - MD5_CTX mdContext; - CE ce = ct->c_cefile; - char *infilename = ce->ce_file ? ce->ce_file : ct->c_file; - - /* open content */ - if ((in = fopen(infilename, "r")) == NULL) - adios (infilename, "unable to open for reading"); - - /* Initialize md5 context */ - MD5Init(&mdContext); - - /* calculate md5 message digest */ - if (asciiP) { - while (fgets(buffer, sizeof(buffer) - 1, in)) { - char c, *cp; - - cp = buffer + strlen(buffer) - 1; - if ((c = *cp) == '\n') - *cp = '\0'; - - MD5Update(&mdContext, (unsigned char *) buffer, - (unsigned int) strlen(buffer)); - - if (c == '\n') - MD5Update(&mdContext, (unsigned char *) "\r\n", - 2); - } - } else { - while ((cc = fread(buffer, sizeof(*buffer), sizeof(buffer), - in)) > 0) - MD5Update(&mdContext, (unsigned char *) buffer, - (unsigned int) cc); - } - - /* md5 finalization. Write digest and zero md5 context */ - MD5Final(digest, &mdContext); - - /* close content */ - fclose(in); - - /* print debugging info */ - if (debugsw) { - unsigned char *ep; - - fprintf(stderr, "MD5 digest="); - for (ep = (dp = digest) + sizeof(digest) / sizeof(digest[0]); - dp < ep; dp++) - fprintf(stderr, "%02x", *dp & 0xff); - fprintf(stderr, "\n"); - } - - /* encode the digest using base64 */ - for (dp = digest, op = outbuf, cc = sizeof(digest) / sizeof(digest[0]); - cc > 0; cc -= 3, op += 4) { - unsigned long bits; - char *bp; - - bits = (*dp++ & 0xff) << 16; - if (cc > 1) { - bits |= (*dp++ & 0xff) << 8; - if (cc > 2) - bits |= *dp++ & 0xff; - } - - for (bp = op + 4; bp > op; bits >>= 6) - *--bp = nib2b64[bits & 0x3f]; - if (cc < 3) { - *(op + 3) = '='; - if (cc < 2) - *(op + 2) = '='; - } - } - - /* null terminate string */ - outbuf[24] = '\0'; - - /* now make copy and return string */ - vp = concat(" ", outbuf, "\n", NULL); - return vp; -} diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c index 201ce51..8d25132 100644 --- a/uip/mhcachesbr.c +++ b/uip/mhcachesbr.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/uip/mhlist.c b/uip/mhlist.c index 45f3e9d..66f9d89 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -19,37 +18,33 @@ #include static struct swit switches[] = { -#define CHECKSW 0 - { "check", 0 }, -#define NCHECKSW 1 - { "nocheck", 0 }, -#define HEADSW 2 +#define HEADSW 0 { "headers", 0 }, -#define NHEADSW 3 +#define NHEADSW 1 { "noheaders", 0 }, -#define SIZESW 4 +#define SIZESW 2 { "realsize", 0 }, -#define NSIZESW 5 +#define NSIZESW 3 { "norealsize", 0 }, -#define VERBSW 6 +#define VERBSW 4 { "verbose", 0 }, -#define NVERBSW 7 +#define NVERBSW 5 { "noverbose", 0 }, -#define FILESW 8 /* interface from show */ +#define FILESW 6 /* interface from show */ { "file file", 0 }, -#define PARTSW 9 +#define PARTSW 7 { "part number", 0 }, -#define TYPESW 10 +#define TYPESW 8 { "type content", 0 }, -#define RCACHESW 11 +#define RCACHESW 9 { "rcache policy", 0 }, -#define WCACHESW 12 +#define WCACHESW 10 { "wcache policy", 0 }, -#define VERSIONSW 13 +#define VERSIONSW 11 { "version", 0 }, -#define HELPSW 14 +#define HELPSW 12 { "help", 0 }, -#define DEBUGSW 15 +#define DEBUGSW 13 { "debug", -5 }, { NULL, 0 } }; @@ -169,13 +164,6 @@ do_cache: } continue; - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - case HEADSW: headsw = 1; continue; diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 130b4e5..03aff61 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/uip/mhparse.c b/uip/mhparse.c index bf65480..483ad84 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -28,8 +27,6 @@ extern pid_t xpid; /* mhshowsbr.c */ extern int rcachesw; /* mhcachesbr.c */ extern int wcachesw; /* mhcachesbr.c */ -int checksw = 0; /* check Content-MD5 field */ - /* ** Directory to place temp files. This must ** be set before these routines are called. @@ -122,7 +119,6 @@ static int InitFTP(CT); static int openFTP(CT, char **); static int InitMail(CT); static int openMail(CT, char **); -static int readDigest(CT, char *); struct str2init str2cts[] = { { "application", CT_APPLICATION, InitApplication }, @@ -445,45 +441,6 @@ get_content(FILE *in, char *file, int toplevel) if (s2i->si_init && (*s2i->si_init) (ct) == NOTOK) goto out; - } else if (!mh_strcasecmp(hp->name, MD5_FIELD)) { - /* Get Content-MD5 field */ - unsigned char *cp, *dp; - char *ep; - - if (!checksw) - goto next_header; - - if (ct->c_digested) { - advise(NULL, "message %s has multiple %s: fields", ct->c_file, MD5_FIELD); - goto next_header; - } - - ep = cp = getcpy(hp->value); - - while (isspace(*cp)) - cp++; - for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n')) - *dp++ = ' '; - for (dp = cp + strlen(cp) - 1; dp >= cp; dp--) - if (!isspace(*dp)) - break; - *++dp = '\0'; - if (debugsw) - fprintf(stderr, "%s: %s\n", MD5_FIELD, cp); - - if (*cp == '(' && get_comment(ct, &cp, 0) == NOTOK) { - free(ep); - goto out; - } - - for (dp = cp; *dp && !isspace(*dp); dp++) - continue; - *dp = '\0'; - - readDigest(ct, cp); - free(ep); - ct->c_digested++; - } else if (!mh_strcasecmp(hp->name, ID_FIELD)) { /* Get Content-ID field */ ct->c_id = add(hp->value, ct->c_id); @@ -1695,7 +1652,7 @@ InitBase64(CT ct) static int openBase64(CT ct, char **file) { - int bitno, cc, digested; + int bitno, cc; int fd, len, skip, own_ct_fp = 0; unsigned long bits; unsigned char value, *b, *b1, *b2, *b3; @@ -1704,7 +1661,6 @@ openBase64(CT ct, char **file) /* sbeck -- handle suffixes */ CI ci; CE ce; - MD5_CTX mdContext; b = (unsigned char *) &bits; b1 = &b[endian > 0 ? 1 : 2]; @@ -1781,9 +1737,6 @@ openBase64(CT ct, char **file) own_ct_fp = 1; } - if ((digested = ct->c_digested)) - MD5Init(&mdContext); - bitno = 18; bits = 0L; skip = 0; @@ -1821,16 +1774,10 @@ openBase64(CT ct, char **file) test_end: if ((bitno -= 6) < 0) { putc((char) *b1, ce->ce_fp); - if (digested) - MD5Update(&mdContext, b1, 1); if (skip < 2) { putc((char) *b2, ce->ce_fp); - if (digested) - MD5Update(&mdContext, b2, 1); if (skip < 1) { putc((char) *b3, ce->ce_fp); - if (digested) - MD5Update(&mdContext, b3, 1); } } @@ -1869,17 +1816,6 @@ self_delimiting: goto clean_up; } - if (digested) { - unsigned char digest[16]; - - MD5Final(digest, &mdContext); - if (memcmp((char *) digest, (char *) ct->c_digest, - sizeof(digest) / sizeof(digest[0]))) - content_error(NULL, ct, "content integrity suspect (digest mismatch) -- continuing"); - else if (debugsw) - fprintf(stderr, "content integrity confirmed\n"); - } - fseek(ce->ce_fp, 0L, SEEK_SET); ready_to_go: @@ -1934,14 +1870,13 @@ InitQuoted(CT ct) static int openQuoted(CT ct, char **file) { - int cc, digested, len, quoted, own_ct_fp = 0; + int cc, len, quoted, own_ct_fp = 0; unsigned char *cp, *ep; char buffer[BUFSIZ]; unsigned char mask; CE ce; /* sbeck -- handle suffixes */ CI ci; - MD5_CTX mdContext; ce = ct->c_cefile; if (ce->ce_fp) { @@ -2011,9 +1946,6 @@ openQuoted(CT ct, char **file) own_ct_fp = 1; } - if ((digested = ct->c_digested)) - MD5Init(&mdContext); - quoted = 0; #ifdef lint mask = 0; @@ -2048,8 +1980,6 @@ openQuoted(CT ct, char **file) mask <<= 4; mask |= hex2nib[*cp & 0x7f]; putc(mask, ce->ce_fp); - if (digested) - MD5Update(&mdContext, &mask, 1); if (ferror(ce->ce_fp)) { content_error(ce->ce_file, ct, "error writing to"); goto clean_up; @@ -2102,13 +2032,6 @@ openQuoted(CT ct, char **file) /* Just show the raw byte. */ putc(*cp, ce->ce_fp); - if (digested) { - if (*cp == '\n') { - MD5Update(&mdContext, (unsigned char *) "\r\n",2); - } else { - MD5Update(&mdContext, (unsigned char *) cp, 1); - } - } if (ferror(ce->ce_fp)) { content_error(ce->ce_file, ct, "error writing to"); @@ -2128,17 +2051,6 @@ openQuoted(CT ct, char **file) goto clean_up; } - if (digested) { - unsigned char digest[16]; - - MD5Final(digest, &mdContext); - if (memcmp((char *) digest, (char *) ct->c_digest, - sizeof(digest) / sizeof(digest[0]))) - content_error(NULL, ct, "content integrity suspect (digest mismatch) -- continuing"); - else if (debugsw) - fprintf(stderr, "content integrity confirmed\n"); - } - fseek(ce->ce_fp, 0L, SEEK_SET); ready_to_go: @@ -2801,85 +2713,3 @@ openMail(CT ct, char **file) *file = ce->ce_file; return fileno(ce->ce_fp); } - - -static int -readDigest(CT ct, char *cp) -{ - int bitno, skip; - unsigned long bits; - char *bp = cp; - unsigned char *dp, value, *ep; - unsigned char *b, *b1, *b2, *b3; - - b = (unsigned char *) &bits, - b1 = &b[endian > 0 ? 1 : 2], - b2 = &b[endian > 0 ? 2 : 1], - b3 = &b[endian > 0 ? 3 : 0]; - bitno = 18; - bits = 0L; - skip = 0; - - for (ep = (dp = ct->c_digest) - + sizeof(ct->c_digest) / sizeof(ct->c_digest[0]); *cp; cp++) - switch (*cp) { - default: - if (skip || (*cp & 0x80) || - (value = b642nib[*cp & 0x7f]) - > 0x3f) { - if (debugsw) - fprintf(stderr, "invalid BASE64 encoding\n"); - return NOTOK; - } - - bits |= value << bitno; -test_end: - if ((bitno -= 6) < 0) { - if (dp + (3 - skip) > ep) - goto invalid_digest; - *dp++ = *b1; - if (skip < 2) { - *dp++ = *b2; - if (skip < 1) - *dp++ = *b3; - } - bitno = 18; - bits = 0L; - skip = 0; - } - break; - - case '=': - if (++skip > 3) - goto self_delimiting; - goto test_end; - } - if (bitno != 18) { - if (debugsw) - fprintf(stderr, "premature ending (bitno %d)\n", - bitno); - - return NOTOK; - } -self_delimiting: - if (dp != ep) { -invalid_digest: - if (debugsw) { - while (*cp) - cp++; - fprintf(stderr, "invalid MD5 digest (got %d octets)\n", - (int)(cp - bp)); - } - - return NOTOK; - } - - if (debugsw) { - fprintf(stderr, "MD5 digest="); - for (dp = ct->c_digest; dp < ep; dp++) - fprintf(stderr, "%02x", *dp & 0xff); - fprintf(stderr, "\n"); - } - - return OK; -} diff --git a/uip/mhshow.c b/uip/mhshow.c index 6e694c4..ac6b0c3 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -19,31 +18,27 @@ #include static struct swit switches[] = { -#define CHECKSW 0 - { "check", 0 }, -#define NCHECKSW 1 - { "nocheck", 0 }, -#define VERBSW 2 +#define VERBSW 0 { "verbose", 0 }, -#define NVERBSW 3 +#define NVERBSW 1 { "noverbose", 0 }, -#define FILESW 4 /* interface from show */ +#define FILESW 2 /* interface from show */ { "file file", 0 }, -#define FORMSW 5 +#define FORMSW 3 { "form formfile", 0 }, -#define PARTSW 6 +#define PARTSW 4 { "part number", 0 }, -#define TYPESW 7 +#define TYPESW 5 { "type content", 0 }, -#define RCACHESW 8 +#define RCACHESW 6 { "rcache policy", 0 }, -#define WCACHESW 9 +#define WCACHESW 7 { "wcache policy", 0 }, -#define VERSIONSW 10 +#define VERSIONSW 8 { "version", 0 }, -#define HELPSW 11 +#define HELPSW 9 { "help", 0 }, -#define DEBUGSW 12 +#define DEBUGSW 10 { "debug", -5 }, { NULL, 0 } }; @@ -162,13 +157,6 @@ do_cache: } continue; - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - case PARTSW: if (!(cp = *argp++) || *cp == '-') adios(NULL, "missing argument to %s", diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 75633b7..2b69c19 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/uip/mhstore.c b/uip/mhstore.c index ea35f8e..950483b 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -24,25 +23,21 @@ static struct swit switches[] = { { "auto", 0 }, #define NAUTOSW 1 { "noauto", 0 }, -#define CHECKSW 2 - { "check", 0 }, -#define NCHECKSW 3 - { "nocheck", 0 }, -#define FILESW 4 /* interface from show */ +#define FILESW 2 /* interface from show */ { "file file", 0 }, -#define PARTSW 5 +#define PARTSW 3 { "part number", 0 }, -#define TYPESW 6 +#define TYPESW 4 { "type content", 0 }, -#define RCACHESW 7 +#define RCACHESW 5 { "rcache policy", 0 }, -#define WCACHESW 8 +#define WCACHESW 6 { "wcache policy", 0 }, -#define VERSIONSW 9 +#define VERSIONSW 7 { "version", 0 }, -#define HELPSW 10 +#define HELPSW 8 { "help", 0 }, -#define DEBUGSW 11 +#define DEBUGSW 9 { "debug", -5 }, { NULL, 0 } }; @@ -208,13 +203,6 @@ do_cache: } continue; - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - case PARTSW: if (!(cp = *argp++) || *cp == '-') adios(NULL, "missing argument to %s", diff --git a/uip/mhtest.c b/uip/mhtest.c index 164d390..c7afd66 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -19,31 +18,27 @@ #include static struct swit switches[] = { -#define CHECKSW 0 - { "check", 0 }, -#define NCHECKSW 1 - { "nocheck", 0 }, -#define VERBSW 2 +#define VERBSW 0 { "verbose", 0 }, -#define NVERBSW 3 +#define NVERBSW 1 { "noverbose", 0 }, -#define FILESW 4 +#define FILESW 2 { "file file", 0 }, -#define OUTFILESW 5 +#define OUTFILESW 3 { "outfile file", 0 }, -#define PARTSW 6 +#define PARTSW 4 { "part number", 0 }, -#define TYPESW 7 +#define TYPESW 5 { "type content", 0 }, -#define RCACHESW 8 +#define RCACHESW 6 { "rcache policy", 0 }, -#define WCACHESW 9 +#define WCACHESW 7 { "wcache policy", 0 }, -#define VERSIONSW 10 +#define VERSIONSW 8 { "version", 0 }, -#define HELPSW 11 +#define HELPSW 9 { "help", 0 }, -#define DEBUGSW 12 +#define DEBUGSW 10 { "debug", -5 }, { NULL, 0 } }; @@ -166,13 +161,6 @@ do_cache: } continue; - case CHECKSW: - checksw++; - continue; - case NCHECKSW: - checksw = 0; - continue; - case PARTSW: if (!(cp = *argp++) || *cp == '-') adios(NULL, "missing argument to %s", argp[-2]);