Index: GNUmakefile =================================================================== RCS file: /cvsroot/cryptopp/src/GNUmakefile,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** GNUmakefile 3 Nov 2001 21:23:16 -0000 1.5 --- GNUmakefile 4 Oct 2002 00:38:40 -0000 1.6 *************** *** 1,5 **** ! # can't use -fno-rtti yet because it causes problems with exception ! # handling in GCC 2.95.2 CXXFLAGS = -g # uncomment the next two lines to do a release build # CXXFLAGS = -O2 -DNDEBUG -ffunction-sections -fdata-sections --- 1,4 ---- ! # can't use -fno-rtti yet because it causes problems with exception handling in GCC 2.95.2 CXXFLAGS = -g # uncomment the next two lines to do a release build # CXXFLAGS = -O2 -DNDEBUG -ffunction-sections -fdata-sections *************** *** 9,21 **** UNAME = $(shell uname) ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist ! CXXFLAGS := $(CXXFLAGS) -mbnu210 else ! CXXFLAGS := $(CXXFLAGS) -pipe endif ifeq ($(UNAME),SunOS) ! LDLIBS = -lnsl -lsocket endif ifeq ($(CXX),gcc) # for some reason CXX is gcc on cygwin 1.1.4 --- 8,27 ---- UNAME = $(shell uname) ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist ! CXXFLAGS += -mbnu210 else ! CXXFLAGS += -pipe ! endif ! ! ifeq ($(UNAME),Darwin) ! CXX = c++ ! CXXFLAGS += -D__pic__ -fno-coalesce-templates -fno-coalesce-static-vtables ! LDLIBS += -lstdc++ ! LDFLAGS += -flat_namespace -undefined suppress -m endif ifeq ($(UNAME),SunOS) ! LDLIBS += -lnsl -lsocket endif ifeq ($(CXX),gcc) # for some reason CXX is gcc on cygwin 1.1.4 *************** *** 24,30 **** SRCS = $(wildcard *.cpp) ! ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77 SRCS = $(shell ls *.cpp) endif --- 30,36 ---- SRCS = $(wildcard *.cpp) ! ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77 SRCS = $(shell ls *.cpp) endif Index: hmac.h =================================================================== RCS file: /cvsroot/cryptopp/src/hmac.h,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** hmac.h 5 Feb 2001 11:24:21 -0000 1.4 --- hmac.h 23 Apr 2002 21:05:34 -0000 1.5 *************** *** 72,81 **** template void HMAC::TruncatedFinal(byte *mac, unsigned int size) { ! hash.Final(mac); hash.Update(k_opad, T::BLOCKSIZE); ! hash.Update(mac, DIGESTSIZE); hash.TruncatedFinal(mac, size); Init(); } --- 72,82 ---- template void HMAC::TruncatedFinal(byte *mac, unsigned int size) { ! SecByteBlock innerHash(DIGESTSIZE); ! hash.Final(innerHash); hash.Update(k_opad, T::BLOCKSIZE); ! hash.Update(innerHash, DIGESTSIZE); hash.TruncatedFinal(mac, size); Init(); } Index: integer.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/integer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** integer.cpp 6 Nov 2001 09:50:46 -0000 1.6 --- integer.cpp 4 Oct 2002 00:38:40 -0000 1.7 *************** *** 125,133 **** } } ! #elif defined(__GNUC__) && defined(__i386__) ! __attribute__((regparm(4))) static word Add(word *C, const word *A, const word *B, unsigned int N) { assert (N%2 == 0); --- 125,133 ---- } } ! #elif defined(__GNUC__) && defined(__i386__) && !defined(__pic__) ! __attribute__((regparm(3))) static word Add(word *C, const word *A, const word *B, unsigned int N) { assert (N%2 == 0); *************** *** 165,171 **** return carry; } ! __attribute__((regparm(4))) static word Subtract(word *C, const word *A, const word *B, unsigned int N) { assert (N%2 == 0); --- 165,171 ---- return carry; } ! __attribute__((regparm(3))) static word Subtract(word *C, const word *A, const word *B, unsigned int N) { assert (N%2 == 0); Index: md2.h =================================================================== RCS file: /cvsroot/cryptopp/src/md2.h,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** md2.h 5 Apr 2001 20:35:33 -0000 1.4 --- md2.h 12 Dec 2002 01:30:28 -0000 1.5 *************** *** 16,22 **** void TruncatedFinal(byte *hash, unsigned int size); unsigned int DigestSize() const {return DIGESTSIZE;} ! enum {DIGESTSIZE = 16}; private: void Transform(); --- 16,22 ---- void TruncatedFinal(byte *hash, unsigned int size); unsigned int DigestSize() const {return DIGESTSIZE;} ! enum {DIGESTSIZE = 16, BLOCKSIZE = 16}; private: void Transform(); Index: mqueue.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/mqueue.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** mqueue.cpp 25 Jan 2001 07:45:54 -0000 1.3 --- mqueue.cpp 6 Nov 2002 19:20:24 -0000 1.4 *************** *** 6,12 **** NAMESPACE_BEGIN(CryptoPP) MessageQueue::MessageQueue(unsigned int nodeSize) ! : m_queue(nodeSize), m_lengths(1, 0) { } --- 6,12 ---- NAMESPACE_BEGIN(CryptoPP) MessageQueue::MessageQueue(unsigned int nodeSize) ! : m_queue(nodeSize), m_lengths(1, 0U) { } Index: pubkey.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/pubkey.cpp,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -c -r1.1.1.2 -r1.2 *** pubkey.cpp 27 Oct 2000 09:35:12 -0000 1.1.1.2 --- pubkey.cpp 20 Jun 2002 21:58:44 -0000 1.2 *************** *** 21,38 **** unsigned int DecryptorTemplate::Decrypt(const byte *cipherText, byte *plainText) { SecByteBlock paddedBlock(PaddedBlockByteLength()); ! f.CalculateInverse(Integer(cipherText, CipherTextLength())).Encode(paddedBlock, paddedBlock.size); return pad.Unpad(paddedBlock, PaddedBlockBitLength(), plainText); } template void EncryptorTemplate::Encrypt(RandomNumberGenerator &rng, const byte *plainText, unsigned int plainTextLength, byte *cipherText) { ! assert(plainTextLength <= MaxPlainTextLength()); SecByteBlock paddedBlock(PaddedBlockByteLength()); pad.Pad(rng, plainText, plainTextLength, paddedBlock, PaddedBlockBitLength()); ! f.ApplyFunction(Integer(paddedBlock, paddedBlock.size)).Encode(cipherText, CipherTextLength()); } template --- 21,38 ---- unsigned int DecryptorTemplate::Decrypt(const byte *cipherText, byte *plainText) { SecByteBlock paddedBlock(PaddedBlockByteLength()); ! f.CalculateInverse(Integer(cipherText, this->CipherTextLength())).Encode(paddedBlock, paddedBlock.size); return pad.Unpad(paddedBlock, PaddedBlockBitLength(), plainText); } template void EncryptorTemplate::Encrypt(RandomNumberGenerator &rng, const byte *plainText, unsigned int plainTextLength, byte *cipherText) { ! assert(plainTextLength <= this->MaxPlainTextLength()); SecByteBlock paddedBlock(PaddedBlockByteLength()); pad.Pad(rng, plainText, plainTextLength, paddedBlock, PaddedBlockBitLength()); ! f.ApplyFunction(Integer(paddedBlock, paddedBlock.size)).Encode(cipherText, this->CipherTextLength()); } template Index: pubkey.h =================================================================== RCS file: /cvsroot/cryptopp/src/pubkey.h,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** pubkey.h 10 Jan 2001 09:06:41 -0000 1.3 --- pubkey.h 20 Jun 2002 21:58:44 -0000 1.4 *************** *** 335,341 **** throw KeyTooShort(); SecByteBlock representative(PaddedBlockByteLength()); ma->Encode(rng, representative); ! f.CalculateInverse(Integer(representative, representative.size)).Encode(signature, SignatureLength()); } template --- 335,341 ---- throw KeyTooShort(); SecByteBlock representative(PaddedBlockByteLength()); ma->Encode(rng, representative); ! f.CalculateInverse(Integer(representative, representative.size)).Encode(signature, this->SignatureLength()); } template *************** *** 343,349 **** { std::auto_ptr ma(static_cast(messageAccumulator)); SecByteBlock representative(PaddedBlockByteLength()); ! f.ApplyFunction(Integer(signature, SignatureLength())).Encode(representative, representative.size); return ma->Verify(representative); } --- 343,349 ---- { std::auto_ptr ma(static_cast(messageAccumulator)); SecByteBlock representative(PaddedBlockByteLength()); ! f.ApplyFunction(Integer(signature, this->SignatureLength())).Encode(representative, representative.size); return ma->Verify(representative); } *************** *** 351,357 **** HashModule * VerifierWithRecoveryTemplate::NewLeftoverMessageAccumulator(const byte *signature) const { SecByteBlock representative(PaddedBlockByteLength()); ! f.ApplyFunction(Integer(signature, SignatureLength())).Encode(representative, representative.size); return new H(representative, PaddedBlockBitLength()); } --- 351,357 ---- HashModule * VerifierWithRecoveryTemplate::NewLeftoverMessageAccumulator(const byte *signature) const { SecByteBlock representative(PaddedBlockByteLength()); ! f.ApplyFunction(Integer(signature, this->SignatureLength())).Encode(representative, representative.size); return new H(representative, PaddedBlockBitLength()); } Index: rijndael.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/rijndael.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** rijndael.cpp 5 Jan 2001 06:32:46 -0000 1.2 --- rijndael.cpp 7 Jan 2002 20:58:09 -0000 1.3 *************** *** 46,52 **** switch(keylen) { case 16: ! for (;;) { temp = rk[3]; rk[4] = rk[0] ^ --- 46,52 ---- switch(keylen) { case 16: ! while (true) { temp = rk[3]; rk[4] = rk[0] ^ *************** *** 64,70 **** } case 24: ! for (;;) { temp = rk[ 5]; rk[ 6] = rk[ 0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ --- 64,71 ---- } case 24: ! while (true) ! { temp = rk[ 5]; rk[ 6] = rk[ 0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ *************** *** 83,89 **** } case 32: ! for (;;) { temp = rk[ 7]; rk[ 8] = rk[ 0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ --- 84,91 ---- } case 32: ! while (true) ! { temp = rk[ 7]; rk[ 8] = rk[ 0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ Index: rsa.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/rsa.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** rsa.cpp 10 Jan 2001 09:06:41 -0000 1.3 --- rsa.cpp 19 Sep 2002 23:27:24 -0000 1.4 *************** *** 29,35 **** { BERSequenceDecoder algorithm(subjectPublicKeyInfo); ASN1::rsaEncryption().BERDecodeAndCheck(algorithm); ! BERDecodeNull(algorithm); algorithm.MessageEnd(); BERSequenceDecoder subjectPublicKey(subjectPublicKeyInfo, BIT_STRING); --- 29,36 ---- { BERSequenceDecoder algorithm(subjectPublicKeyInfo); ASN1::rsaEncryption().BERDecodeAndCheck(algorithm); ! if (!algorithm.EndReached()) ! BERDecodeNull(algorithm); algorithm.MessageEnd(); BERSequenceDecoder subjectPublicKey(subjectPublicKeyInfo, BIT_STRING); Index: socketft.h =================================================================== RCS file: /cvsroot/cryptopp/src/socketft.h,v retrieving revision 1.6 diff -c -r1.6 socketft.h *** socketft.h 29 Oct 2001 08:32:40 -0000 1.6 --- socketft.h 5 Aug 2003 20:57:44 -0000 *************** *** 5,15 **** #ifndef NO_OS_DEPENDENCE ! #ifdef __GNUC__ ! #include <_G_config.h> ! #endif ! ! #if defined(_G_HAVE_SYS_SOCKET) && _G_HAVE_SYS_SOCKET #define HAS_BERKELEY_STYLE_SOCKETS #endif --- 5,11 ---- #ifndef NO_OS_DEPENDENCE ! #if defined(__unix__) || defined(__MACH__) #define HAS_BERKELEY_STYLE_SOCKETS #endif Index: winpipes.h =================================================================== RCS file: /cvsroot/cryptopp/src/winpipes.h,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** winpipes.h 10 Jan 2001 09:06:41 -0000 1.4 --- winpipes.h 1 Oct 2002 19:31:33 -0000 1.5 *************** *** 44,49 **** --- 44,50 ---- { public: Err(HANDLE h, const std::string& operation, int error); + ~Err() throw() {} HANDLE GetHandle() const {return m_h;} const std::string & GetOperation() const {return m_operation;} Index: zinflate.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/zinflate.cpp,v retrieving revision 1.3 retrieving revision 1.5 diff -c -r1.3 -r1.5 *** zinflate.cpp 25 Feb 2001 10:00:02 -0000 1.3 --- zinflate.cpp 10 Apr 2002 15:40:44 -0000 1.5 *************** *** 1,5 **** --- 1,10 ---- // zinflate.cpp - written and placed in the public domain by Wei Dai + // This is a complete reimplementation of the DEFLATE decompression algorithm. + // It should not be affected by any security vulnerabilities in the zlib + // compression library. In particular it is not affected by the double free bug + // (http://www.kb.cert.org/vuls/id/368819). + #include "pch.h" #include "zinflate.h" *************** *** 244,252 **** { while (true) { - if (m_inQueue.IsEmpty()) - return; - switch (m_state) { case PRE_STREAM: --- 249,254 ---- *************** *** 278,283 **** --- 280,287 ---- ProcessPoststreamTail(); m_state = m_repeat ? PRE_STREAM : AFTER_END; Filter::MessageEnd(GetAutoSignalPropagation()); + if (m_inQueue.IsEmpty()) + return; break; case AFTER_END: m_inQueue.TransferTo(*AttachedTransformation()); Index: zlib.cpp =================================================================== RCS file: /cvsroot/cryptopp/src/zlib.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** zlib.cpp 25 Feb 2001 10:00:02 -0000 1.3 --- zlib.cpp 10 Apr 2002 15:40:44 -0000 1.4 *************** *** 1,5 **** --- 1,10 ---- // zlib.cpp - written and placed in the public domain by Wei Dai + // "zlib" is the name of a well known C language compression library + // (http://www.zlib.org) and also the name of a compression format + // (RFC 1950) that the library implements. This file is part of a + // complete reimplementation of the zlib compression format. + #include "pch.h" #include "zlib.h" #include "zdeflate.h"