diff options
author | Harin Vadodaria <harin.vadodaria@oracle.com> | 2014-08-23 08:59:03 +0530 |
---|---|---|
committer | Harin Vadodaria <harin.vadodaria@oracle.com> | 2014-08-23 08:59:03 +0530 |
commit | b9f2b1c1354342424f26c276c6e1e9556fa7576a (patch) | |
tree | 7e692646b16ed1d7255c950ef60f3400cf29cb9a /extra/yassl/taocrypt/src | |
parent | ab727cec049d20a86e1ca8ab2860d73dc476b73a (diff) | |
download | mariadb-git-b9f2b1c1354342424f26c276c6e1e9556fa7576a.tar.gz |
Bug#19370676 : YASSL PRE-AUTH BUFFER OVERFLOW WHEN CLIENT
LIES ABOUT SUITE_LEN_
and
Bug#19355577 : YASSL PRE-AUTH BUFFER OVERFLOW WHEN CLIENT
LIES ABOUT COMP_LEN_
Description : Updating yaSSL to version 2.3.4.
Diffstat (limited to 'extra/yassl/taocrypt/src')
-rw-r--r-- | extra/yassl/taocrypt/src/aes.cpp | 19 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/algebra.cpp | 8 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/arc4.cpp | 11 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/asn.cpp | 48 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/blowfish.cpp | 8 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/des.cpp | 11 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/integer.cpp | 31 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/md5.cpp | 10 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/misc.cpp | 22 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/rabbit.cpp | 10 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/random.cpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/ripemd.cpp | 13 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/sha.cpp | 11 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/twofish.cpp | 13 |
14 files changed, 119 insertions, 99 deletions
diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp index d04ef69c19f..ee4c7a6e8a1 100644 --- a/extra/yassl/taocrypt/src/aes.cpp +++ b/extra/yassl/taocrypt/src/aes.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,7 +66,7 @@ void AES::Process(byte* out, const byte* in, word32 sz) in += BLOCK_SIZE; } } - else { + else { while (blocks--) { AsmDecrypt(in, out, (void*)Td0); @@ -79,8 +79,8 @@ void AES::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - } - } + } + } } #endif // DO_AES_ASM @@ -466,14 +466,13 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock, "movd mm7, ebp;" \ "movd mm4, eax;" \ "mov ebp, edx;" \ - "sub esp, 4;" - + "sub esp, 4;" #define EPILOG() \ "add esp, 4;" \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "c" (this), "S" (inBlock), "d" (boxes), "a" (outBlock) \ : "%edi", "memory", "cc" \ @@ -834,9 +833,9 @@ void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const #ifdef _MSC_VER - __declspec(naked) + __declspec(naked) #else - __attribute__ ((noinline)) + __attribute__ ((noinline)) #endif void AES::AsmDecrypt(const byte* inBlock, byte* outBlock, void* boxes) const { diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp index b4086522124..ef59bfbbc56 100644 --- a/extra/yassl/taocrypt/src/algebra.cpp +++ b/extra/yassl/taocrypt/src/algebra.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x, struct WindowSlider { - WindowSlider(const Integer &expIn, bool fastNegateIn, + WindowSlider(const Integer &exp, bool fastNegate, unsigned int windowSizeIn=0) - : exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn), - windowBegin(0), fastNegate(fastNegateIn), firstTime(true), + : exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn), + windowBegin(0), fastNegate(fastNegate), firstTime(true), finished(false) { if (windowSize == 0) diff --git a/extra/yassl/taocrypt/src/arc4.cpp b/extra/yassl/taocrypt/src/arc4.cpp index f5794ec2566..10a3a7d6ffc 100644 --- a/extra/yassl/taocrypt/src/arc4.cpp +++ b/extra/yassl/taocrypt/src/arc4.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -121,12 +121,11 @@ void ARC4::AsmProcess(byte* out, const byte* in, word32 length) "push ebx;" \ "push ebp;" \ "mov ebp, eax;" - #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "c" (this), "D" (out), "S" (in), "a" (length) \ : "%edx", "memory", "cc" \ @@ -180,7 +179,7 @@ void ARC4::AsmProcess(byte* out, const byte* in, word32 length) #ifdef _MSC_VER AS1( loopStart: ) // loopStart #else - AS1( 0: ) // loopStart for some gas (need numeric for jump back + AS1( 0: ) // loopStart for some gas (need numeric for jump back #endif // y = (y+a) & 0xff; @@ -232,7 +231,7 @@ void ARC4::AsmProcess(byte* out, const byte* in, word32 length) AS1( nothing: ) - // inline adjust + // inline adjust AS2( add esp, 4 ) // fix room on stack EPILOG() diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index ad054809879..544e9518da8 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -1,6 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. - Use is subject to license terms. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -761,7 +760,7 @@ void CertDecoder::GetName(NameType nt) while (source_.get_index() < length) { GetSet(); if (source_.GetError().What() == SET_E) { - source_.SetError(NO_ERROR_E); // extensions may only have sequence + source_.SetError(NO_ERROR_E); // extensions may only have sequence source_.prev(); } GetSequence(); @@ -832,10 +831,8 @@ void CertDecoder::GetName(NameType nt) if (source_.IsLeft(length) == false) return; if (email) { - if (!(ptr = AddTag(ptr, buf_end, "/emailAddress=", 14, length))) { - source_.SetError(CONTENT_E); - return; - } + if (!(ptr = AddTag(ptr, buf_end, "/emailAddress=", 14, length))) + return; } source_.advance(length); @@ -972,12 +969,26 @@ bool CertDecoder::ConfirmSignature(Source& pub) hasher.reset(NEW_TC SHA); ht = SHAh; } + else if (signatureOID_ == SHA256wRSA || signatureOID_ == SHA256wDSA) { + hasher.reset(NEW_TC SHA256); + ht = SHA256h; + } +#ifdef WORD64_AVAILABLE + else if (signatureOID_ == SHA384wRSA) { + hasher.reset(NEW_TC SHA384); + ht = SHA384h; + } + else if (signatureOID_ == SHA512wRSA) { + hasher.reset(NEW_TC SHA512); + ht = SHA512h; + } +#endif else { source_.SetError(UNKOWN_SIG_E); return false; } - byte digest[SHA::DIGEST_SIZE]; // largest size + byte digest[MAX_SHA2_DIGEST_SIZE]; // largest size hasher->Update(source_.get_buffer() + certBegin_, sigIndex_ - certBegin_); hasher->Final(digest); @@ -1050,6 +1061,12 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) 0x02, 0x05, 0x05, 0x00 }; static const byte md2AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02, 0x05, 0x00}; + static const byte sha256AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x01, 0x05, 0x00 }; + static const byte sha384AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x02, 0x05, 0x00 }; + static const byte sha512AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, + 0x04, 0x02, 0x03, 0x05, 0x00 }; int algoSz = 0; const byte* algoName = 0; @@ -1060,6 +1077,21 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) algoName = shaAlgoID; break; + case SHA256h: + algoSz = sizeof(sha256AlgoID); + algoName = sha256AlgoID; + break; + + case SHA384h: + algoSz = sizeof(sha384AlgoID); + algoName = sha384AlgoID; + break; + + case SHA512h: + algoSz = sizeof(sha512AlgoID); + algoName = sha512AlgoID; + break; + case MD2h: algoSz = sizeof(md2AlgoID); algoName = md2AlgoID; diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp index 5cfd81e369c..9491c93040e 100644 --- a/extra/yassl/taocrypt/src/blowfish.cpp +++ b/extra/yassl/taocrypt/src/blowfish.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -237,8 +237,8 @@ void Blowfish::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "c" (this), "S" (inBlock), "a" (outBlock) \ : "%edi", "%edx", "memory", "cc" \ @@ -291,7 +291,7 @@ void Blowfish::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) #ifdef _MSC_VER - __declspec(naked) + __declspec(naked) #else __attribute__ ((noinline)) #endif diff --git a/extra/yassl/taocrypt/src/des.cpp b/extra/yassl/taocrypt/src/des.cpp index b52a83a38c6..673c21ed207 100644 --- a/extra/yassl/taocrypt/src/des.cpp +++ b/extra/yassl/taocrypt/src/des.cpp @@ -1,6 +1,5 @@ /* - Copyright (C) 2000-2007 MySQL AB - Use is subject to license terms + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -642,9 +641,9 @@ void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, #ifdef _MSC_VER - __declspec(naked) + __declspec(naked) #else - __attribute__ ((noinline)) + __attribute__ ((noinline)) #endif void DES_EDE3::AsmProcess(const byte* in, byte* out, void* box) const { @@ -664,8 +663,8 @@ void DES_EDE3::AsmProcess(const byte* in, byte* out, void* box) const #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "d" (this), "S" (in), "a" (box), "c" (out) \ : "%edi", "memory", "cc" \ diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index c981b1bf786..2d85ee01a3f 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,9 +56,8 @@ #endif #elif defined(_MSC_VER) && defined(_M_IX86) /* #pragma message("You do not seem to have the Visual C++ Processor Pack ") - #pragma message("installed, so use of SSE2 intrinsics will be disabled.") -*/ #pragma message("installed, so use of SSE2 intrinsics will be disabled.") +*/ #elif defined(__GNUC__) && defined(__i386__) /* #warning You do not have GCC 3.3 or later, or did not specify the -msse2 \ compiler option. Use of SSE2 intrinsics will be disabled. @@ -282,7 +281,12 @@ DWord() {} word GetHighHalfAsBorrow() const {return 0-halfs_.high;} private: - struct dword_struct + union + { + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + dword whole_; + #endif + struct { #ifdef LITTLE_ENDIAN_ORDER word low; @@ -291,14 +295,7 @@ private: word high; word low; #endif - }; - - union - { - #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE - dword whole_; - #endif - struct dword_struct halfs_; + } halfs_; }; }; @@ -1201,24 +1198,20 @@ public: #define AS1(x) #x ";" #define AS2(x, y) #x ", " #y ";" #define AddPrologue \ - word res; \ __asm__ __volatile__ \ ( \ "push %%ebx;" /* save this manually, in case of -fPIC */ \ - "mov %3, %%ebx;" \ + "mov %2, %%ebx;" \ ".intel_syntax noprefix;" \ "push ebp;" #define AddEpilogue \ "pop ebp;" \ ".att_syntax prefix;" \ "pop %%ebx;" \ - "mov %%eax, %0;" \ - : "=g" (res) \ + : \ : "c" (C), "d" (A), "m" (B), "S" (N) \ : "%edi", "memory", "cc" \ - ); \ - return res; - + ); #define MulPrologue \ __asm__ __volatile__ \ ( \ diff --git a/extra/yassl/taocrypt/src/md5.cpp b/extra/yassl/taocrypt/src/md5.cpp index e9a9e8fe517..45cfa8a3322 100644 --- a/extra/yassl/taocrypt/src/md5.cpp +++ b/extra/yassl/taocrypt/src/md5.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -223,7 +223,7 @@ void MD5::Update(const byte* data, word32 len) #ifdef _MSC_VER - __declspec(naked) + __declspec(naked) #else __attribute__ ((noinline)) #endif @@ -242,8 +242,8 @@ void MD5::AsmTransform(const byte* data, word32 times) #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "c" (this), "D" (data), "a" (times) \ : "%esi", "%edx", "memory", "cc" \ @@ -297,7 +297,7 @@ void MD5::AsmTransform(const byte* data, word32 times) #ifdef _MSC_VER AS1( loopStart: ) // loopStart #else - AS1( 0: ) // loopStart for some gas (need numeric for jump back + AS1( 0: ) // loopStart for some gas (need numeric for jump back #endif // set up diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index b576d3d59d2..fd9e8b92c1d 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -84,17 +84,7 @@ namespace STL = STL_NAMESPACE; } -#ifdef __sun - -// Handler for pure virtual functions -namespace __Crun { - void pure_error() { - } -} - -#endif - -#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2) +#if defined(__ICC) || defined(__INTEL_COMPILER) extern "C" { @@ -175,6 +165,14 @@ word Crop(word value, unsigned int size) #ifdef TAOCRYPT_X86ASM_AVAILABLE +#ifndef _MSC_VER + static jmp_buf s_env; + static void SigIllHandler(int) + { + longjmp(s_env, 1); + } +#endif + bool HaveCpuId() { diff --git a/extra/yassl/taocrypt/src/rabbit.cpp b/extra/yassl/taocrypt/src/rabbit.cpp index 89e6a207a1b..5e32f383493 100644 --- a/extra/yassl/taocrypt/src/rabbit.cpp +++ b/extra/yassl/taocrypt/src/rabbit.cpp @@ -1,15 +1,15 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. - + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, @@ -236,7 +236,7 @@ void Rabbit::Process(byte* output, const byte* input, word32 msglen) NextState(Work); /* Generate 16 bytes of pseudo-random data */ - tmp[0] = LITTLE32(workCtx_.x[0] ^ + tmp[0] = LITTLE32(workCtx_.x[0] ^ (workCtx_.x[5]>>16) ^ U32V(workCtx_.x[3]<<16)); tmp[1] = LITTLE32(workCtx_.x[2] ^ (workCtx_.x[7]>>16) ^ U32V(workCtx_.x[5]<<16)); diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp index 084871c5447..4b89b5b32c5 100644 --- a/extra/yassl/taocrypt/src/random.cpp +++ b/extra/yassl/taocrypt/src/random.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include <time.h> #if defined(_WIN32) + #define _WIN32_WINNT 0x0400 #include <windows.h> #include <wincrypt.h> #else diff --git a/extra/yassl/taocrypt/src/ripemd.cpp b/extra/yassl/taocrypt/src/ripemd.cpp index b670a9eca86..5d03dc61cd6 100644 --- a/extra/yassl/taocrypt/src/ripemd.cpp +++ b/extra/yassl/taocrypt/src/ripemd.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -507,6 +507,8 @@ void RIPEMD160::Transform() #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void RIPEMD160::AsmTransform(const byte* data, word32 times) { @@ -520,12 +522,11 @@ void RIPEMD160::AsmTransform(const byte* data, word32 times) ".intel_syntax noprefix;" \ "push ebx;" \ "push ebp;" - #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "c" (this), "D" (data), "d" (times) \ : "%esi", "%eax", "memory", "cc" \ @@ -571,7 +572,7 @@ void RIPEMD160::AsmTransform(const byte* data, word32 times) #ifdef _MSC_VER AS1( loopStart: ) // loopStart #else - AS1( 0: ) // loopStart for some gas (need numeric for jump back + AS1( 0: ) // loopStart for some gas (need numeric for jump back #endif AS2( movd mm2, edx ) // store times_ @@ -830,7 +831,7 @@ void RIPEMD160::AsmTransform(const byte* data, word32 times) AS1( jnz 0b ) // loopStart #endif - // inline adjust + // inline adjust AS2( add esp, 24 ) // fix room on stack EPILOG() diff --git a/extra/yassl/taocrypt/src/sha.cpp b/extra/yassl/taocrypt/src/sha.cpp index 0d3491eb83d..4206f7f64ea 100644 --- a/extra/yassl/taocrypt/src/sha.cpp +++ b/extra/yassl/taocrypt/src/sha.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -776,12 +776,11 @@ void SHA::AsmTransform(const byte* data, word32 times) ".intel_syntax noprefix;" \ "push ebx;" \ "push ebp;" - #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "c" (this), "D" (data), "a" (times) \ : "%esi", "%edx", "memory", "cc" \ @@ -830,7 +829,7 @@ void SHA::AsmTransform(const byte* data, word32 times) #ifdef _MSC_VER AS1( loopStart: ) // loopStart #else - AS1( 0: ) // loopStart for some gas (need numeric for jump back + AS1( 0: ) // loopStart for some gas (need numeric for jump back #endif // byte reverse 16 words of input, 4 at a time, put on stack for W[] @@ -1022,7 +1021,7 @@ void SHA::AsmTransform(const byte* data, word32 times) AS1( jnz 0b ) // loopStart #endif - // inline adjust + // inline adjust AS2( add esp, 68 ) // fix room on stack EPILOG() diff --git a/extra/yassl/taocrypt/src/twofish.cpp b/extra/yassl/taocrypt/src/twofish.cpp index 3a93ac11476..3051af21513 100644 --- a/extra/yassl/taocrypt/src/twofish.cpp +++ b/extra/yassl/taocrypt/src/twofish.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -285,12 +285,11 @@ void Twofish::decrypt(const byte* inBlock, const byte* xorBlock, "push ebp;" \ "movd mm3, eax;" \ "movd mm6, ebp;" - #define EPILOG() \ "pop ebp;" \ "pop ebx;" \ - "emms;" \ - ".att_syntax;" \ + "emms;" \ + ".att_syntax;" \ : \ : "D" (this), "S" (inBlock), "a" (outBlock) \ : "%ecx", "%edx", "memory", "cc" \ @@ -479,7 +478,7 @@ void Twofish::AsmEncrypt(const byte* inBlock, byte* outBlock) const AS2( movd ebp, mm6 ) AS2( movd esi, mm0 ) // k_ #ifdef __GNUC__ - AS2( movd edi, mm3 ) // outBlock + AS2( movd edi, mm3 ) // outBlock #else AS2( mov edi, [ebp + 12] ) // outBlock #endif @@ -500,7 +499,7 @@ void Twofish::AsmEncrypt(const byte* inBlock, byte* outBlock) const #ifdef _MSC_VER - __declspec(naked) + __declspec(naked) #else __attribute__ ((noinline)) #endif @@ -551,7 +550,7 @@ void Twofish::AsmDecrypt(const byte* inBlock, byte* outBlock) const AS2( movd ebp, mm6 ) AS2( movd esi, mm0 ) // k_ #ifdef __GNUC__ - AS2( movd edi, mm3 ) // outBlock + AS2( movd edi, mm3 ) // outBlock #else AS2( mov edi, [ebp + 12] ) // outBlock #endif |