From 3aeedcf092e3cc0de2a728c5b9415652cb540d24 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Wed, 1 Apr 2015 16:19:29 +0900 Subject: [PATCH 1/7] fixed --enable-debug issue on Intel MULX, asm.c --- wolfcrypt/src/asm.c | 66 ++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index fef35cd1c..a5ee7d1ba 100755 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -1232,54 +1232,60 @@ __asm__( \ /* anything you need at the end */ #define COMBA_FINI -#define MULADD_MULX(b0, c0, c1)\ - __asm__ volatile ( \ +#define MULADD_MULX(b0, c0, c1, rdx)\ + __asm__ volatile ( \ + "movq %3, %%rdx\n\t" \ "mulx %2,%%r9, %%r8 \n\t" \ "adoxq %%r9,%0 \n\t" \ "adcxq %%r8,%1 \n\t" \ - :"+r"(c0),"+r"(c1):"r"(b0):"%r8","%r9","%r10","%rdx"\ + :"+r"(c0),"+r"(c1):"r"(b0), "r"(rdx):"%r8","%r9","%r10","%rdx"\ ) #define MULADD_MULX_ADD_CARRY(c0, c1)\ __asm__ volatile(\ "mov $0, %%r10\n\t"\ - "movq %1, %%r8\n\t" \ + "movq %1, %%r8\n\t"\ "adox %%r10, %0\n\t"\ "adcx %%r10, %1\n\t"\ :"+r"(c0),"+r"(c1)::"%r8","%r9","%r10","%rdx") ; #define MULADD_SET_A(a0)\ - __asm__ volatile("add $0, %%r8\n\t" \ - "movq %0,%%rdx\n\t"::"r"(a0):"%r8","%r9","%r10","%rdx") ; \ + __asm__ volatile("add $0, %%r8\n\t" \ + "movq %0,%%rdx\n\t" \ + ::"r"(a0):"%r8","%r9","%r10","%rdx") ; #define MULADD_BODY(a,b,c)\ - cp = &(c->dp[iz]) ;\ - c0 = cp[0] ; c1 = cp[1];\ - MULADD_SET_A(a->dp[ix]) ;\ - MULADD_MULX(b0, c0, c1) ;\ - cp[0]=c0; c0=cp[2]; cp++ ;\ - MULADD_MULX(b1, c1, c0) ;\ - cp[0]=c1; c1=cp[2]; cp++ ; \ - MULADD_MULX(b2, c0, c1) ;\ - cp[0]=c0; c0=cp[2]; cp++ ; \ - MULADD_MULX(b3, c1, c0) ;\ - cp[0]=c1; c1=cp[2]; cp++ ; \ - MULADD_MULX_ADD_CARRY(c0, c1) ;\ - cp[0]=c0; cp[1]=c1; + { word64 rdx = a->dp[ix] ; \ + cp = &(c->dp[iz]) ; \ + c0 = cp[0] ; c1 = cp[1]; \ + MULADD_SET_A(rdx) ; \ + MULADD_MULX(b0, c0, c1, rdx) ;\ + cp[0]=c0; c0=cp[2]; \ + MULADD_MULX(b1, c1, c0, rdx) ;\ + cp[1]=c1; c1=cp[3]; \ + MULADD_MULX(b2, c0, c1, rdx) ;\ + cp[2]=c0; c0=cp[4]; \ + MULADD_MULX(b3, c1, c0, rdx) ;\ + cp[3]=c1; c1=cp[5]; \ + MULADD_MULX_ADD_CARRY(c0, c1);\ + cp[4]=c0; cp[5]=c1; \ + } #define TFM_INTEL_MUL_COMBA(a, b, c)\ - for(ix=0; ixdp[ix]=0 ;\ - for(iy=0; (iyused); iy+=4) {\ - fp_digit *bp ;\ - bp = &(b->dp[iy+0]) ; \ - fp_digit b0 = bp[0] , b1= bp[1], b2= bp[2], b3= bp[3];\ - ix=0, iz=iy;\ - while(ixused) {\ - fp_digit c0, c1; \ - fp_digit *cp ;\ - MULADD_BODY(a,b,c); ix++ ; iz++ ; \ - }\ + for(ix=0; ixdp[ix]=0 ; \ + for(iy=0; (iyused); iy+=4) { \ + fp_digit *bp ; \ + bp = &(b->dp[iy+0]) ; \ + fp_digit b0 = bp[0] , b1= bp[1], \ + b2= bp[2], b3= bp[3]; \ + ix=0, iz=iy; \ + while(ixused) { \ + fp_digit c0, c1; \ + fp_digit *cp ; \ + MULADD_BODY(a,b,c); \ + ix++ ; iz++ ; \ + } \ }; #elif defined(TFM_X86_64) From b9aa7621e716267f310aec0010c5240270b75cce Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Thu, 2 Apr 2015 15:42:38 +0900 Subject: [PATCH 2/7] Intel MULX run time check in tfm.c --- wolfcrypt/src/asm.c | 53 ++++---------- wolfcrypt/src/tfm.c | 173 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 180 insertions(+), 46 deletions(-) diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index a5ee7d1ba..9dbf9a15a 100755 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -87,7 +87,7 @@ __asm__( \ :"0"(_c[LO]), "1"(cy), "r"(mu), "r"(*tmpm++) \ : "%rax", "%rdx", "cc") -#ifdef HAVE_INTEL_MULX +#if defined(HAVE_INTEL_MULX) #define MULX_INIT(a0, c0, cy)\ __asm__ volatile( \ "xorq %%r10, %%r10\n\t" \ @@ -1208,7 +1208,8 @@ __asm__( \ "adcl $0,%2 \n\t" \ :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","cc"); -#elif defined(HAVE_INTEL_MULX) +#elif defined(TFM_X86_64) +/* x86-64 optimized */ /* anything you need at the start */ #define COMBA_START @@ -1232,6 +1233,18 @@ __asm__( \ /* anything you need at the end */ #define COMBA_FINI +/* this should multiply i and j */ +#define MULADD(i, j) \ +__asm__ ( \ + "movq %6,%%rax \n\t" \ + "mulq %7 \n\t" \ + "addq %%rax,%0 \n\t" \ + "adcq %%rdx,%1 \n\t" \ + "adcq $0,%2 \n\t" \ + :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","cc"); + + +#if defined(HAVE_INTEL_MULX) #define MULADD_MULX(b0, c0, c1, rdx)\ __asm__ volatile ( \ "movq %3, %%rdx\n\t" \ @@ -1287,41 +1300,7 @@ __asm__( \ ix++ ; iz++ ; \ } \ }; - -#elif defined(TFM_X86_64) -/* x86-64 optimized */ - -/* anything you need at the start */ -#define COMBA_START - -/* clear the chaining variables */ -#define COMBA_CLEAR \ - c0 = c1 = c2 = 0; - -/* forward the carry to the next digit */ -#define COMBA_FORWARD \ - do { c0 = c1; c1 = c2; c2 = 0; } while (0); - -/* store the first sum */ -#define COMBA_STORE(x) \ - x = c0; - -/* store the second sum [carry] */ -#define COMBA_STORE2(x) \ - x = c1; - -/* anything you need at the end */ -#define COMBA_FINI - -/* this should multiply i and j */ -#define MULADD(i, j) \ -__asm__ ( \ - "movq %6,%%rax \n\t" \ - "mulq %7 \n\t" \ - "addq %%rax,%0 \n\t" \ - "adcq %%rdx,%1 \n\t" \ - "adcq $0,%2 \n\t" \ - :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) :"%rax","%rdx","cc"); +#endif #elif defined(TFM_SSE2) /* use SSE2 optimizations */ diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index e479f8c4d..132898962 100755 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -402,7 +402,74 @@ void fp_mul_2d(fp_int *a, int b, fp_int *c) /* generic PxQ multiplier */ #if defined(HAVE_INTEL_MULX) -void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) + +/* Each platform needs to query info type 1 from cpuid to see if aesni is + * supported. Also, let's setup a macro for proper linkage w/o ABI conflicts + */ + +#ifndef _MSC_VER + #define cpuid(reg, leaf, sub)\ + __asm__ __volatile__ ("cpuid":\ + "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), "=d" (reg[3]) :\ + "a" (leaf), "c"(sub)); + + #define XASM_LINK(f) asm(f) +#else + + #include + #define cpuid(a,b) __cpuid((int*)a,b) + + #define XASM_LINK(f) + +#endif /* _MSC_VER */ + +#define EAX 0 +#define EBX 1 +#define ECX 2 +#define EDX 3 + +#define CPUID_AVX1 0x1 +#define CPUID_AVX2 0x2 +#define CPUID_RDRAND 0x4 +#define CPUID_RDSEED 0x8 + +#define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) +#define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) +#define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) +#define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) +#define SET_FLAGS if(cpuid_check==0)set_cpuid_flags() + +static word32 cpuid_check = 0 ; +static word32 cpuid_flags = 0 ; + +static word32 cpuid_flag(word32 leaf, word32 sub, word32 num, word32 bit) { + int got_intel_cpu=0; + unsigned int reg[5]; + + reg[4] = '\0' ; + cpuid(reg, 0, 0); + if(memcmp((char *)&(reg[EBX]), "Genu", 4) == 0 && + memcmp((char *)&(reg[EDX]), "ineI", 4) == 0 && + memcmp((char *)&(reg[ECX]), "ntel", 4) == 0) { + got_intel_cpu = 1; + } + if (got_intel_cpu) { + cpuid(reg, leaf, sub); + return((reg[num]>>bit)&0x1) ; + } + return 0 ; +} + +INLINE static int set_cpuid_flags(void) { + if(cpuid_check == 0) { + if(cpuid_flag(7, 0, EBX, 5)){ cpuid_flags |= CPUID_AVX2 ; } + cpuid_check = 1 ; + return 0 ; + } + return 1 ; +} + +INLINE static void fp_mul_comba_mulx(fp_int *A, fp_int *B, fp_int *C) { int ix, iy, iz, pa; @@ -430,13 +497,22 @@ void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) fp_copy(dst, C); } -#else +#endif + void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) { int ix, iy, iz, tx, ty, pa; fp_digit c0, c1, c2, *tmpx, *tmpy; fp_int tmp, *dst; + #if defined(HAVE_INTEL_MULX) + SET_FLAGS ; + if(IS_INTEL_AVX2) { + fp_mul_comba_mulx(A, B, C) ; + return ; + } + #endif + COMBA_START; COMBA_CLEAR; @@ -485,7 +561,6 @@ void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) fp_clamp(dst); fp_copy(dst, C); } -#endif /* a/b => cb + d == a */ int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d) @@ -1567,10 +1642,9 @@ static inline void innermul8_mulx(fp_digit *c_mulx, fp_digit *cy_mulx, fp_digit c_mulx[0]=_c0; c_mulx[1]=_c1; c_mulx[2]=_c2; c_mulx[3]=_c3; c_mulx[4]=_c4; c_mulx[5]=_c5; c_mulx[6]=_c6; c_mulx[7]=_c7; *cy_mulx = cy ; } -#endif /* computes x/R == x (mod N) via Montgomery Reduction */ -void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) +static void fp_montgomery_reduce_mulx(fp_int *a, fp_int *m, fp_digit mp) { fp_digit c[FP_SIZE], *_c, *tmpm, mu = 0; int oldused, x, y, pa; @@ -1589,6 +1663,91 @@ void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) #endif + /* now zero the buff */ + XMEMSET(c, 0, sizeof c); + pa = m->used; + + /* copy the input */ + oldused = a->used; + for (x = 0; x < oldused; x++) { + c[x] = a->dp[x]; + } + MONT_START; + + for (x = 0; x < pa; x++) { + fp_digit cy = 0; + /* get Mu for this round */ + LOOP_START; + _c = c + x; + tmpm = m->dp; + y = 0; + for (; y < (pa & ~7); y += 8) { + innermul8_mulx(_c, &cy, tmpm, mu) ; + _c += 8; + tmpm += 8; + } + for (; y < pa; y++) { + INNERMUL; + ++_c; + } + LOOP_END; + while (cy) { + PROPCARRY; + ++_c; + } + } + + /* now copy out */ + _c = c + pa; + tmpm = a->dp; + for (x = 0; x < pa+1; x++) { + *tmpm++ = *_c++; + } + + for (; x < oldused; x++) { + *tmpm++ = 0; + } + + MONT_FINI; + + a->used = pa+1; + fp_clamp(a); + + /* if A >= m then A = A - m */ + if (fp_cmp_mag (a, m) != FP_LT) { + s_fp_sub (a, m, a); + } +} +#endif + +/* computes x/R == x (mod N) via Montgomery Reduction */ +void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) +{ + fp_digit c[FP_SIZE], *_c, *tmpm, mu = 0; + int oldused, x, y, pa; + + #ifdef HAVE_INTEL_MULX + SET_FLAGS ; + if(IS_INTEL_AVX2) { + fp_montgomery_reduce_mulx(a, m, mp) ; + return ; + } + #endif + + /* bail if too large */ + if (m->used > (FP_SIZE/2)) { + (void)mu; /* shut up compiler */ + return; + } + +#ifdef TFM_SMALL_MONT_SET + if (m->used <= 16) { + fp_montgomery_reduce_small(a, m, mp); + return; + } +#endif + + /* now zero the buff */ XMEMSET(c, 0, sizeof c); pa = m->used; @@ -1609,11 +1768,7 @@ void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) y = 0; #if (defined(TFM_SSE2) || defined(TFM_X86_64)) for (; y < (pa & ~7); y += 8) { - #ifdef HAVE_INTEL_MULX - innermul8_mulx(_c, &cy, tmpm, mu) ; - #else INNERMUL8 ; - #endif _c += 8; tmpm += 8; } From d8a6d9cffc52d77776cf8529f1af08939bdd8120 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Mon, 6 Apr 2015 10:34:07 +0900 Subject: [PATCH 3/7] runtime cpuflag for Intel MULX, cleaned in tfm.c --- wolfcrypt/src/asm.c | 78 ++++++++++++++++++++++++++++++++++++++++ wolfcrypt/src/tfm.c | 87 +++------------------------------------------ 2 files changed, 82 insertions(+), 83 deletions(-) diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index 9dbf9a15a..016225df1 100755 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -33,6 +33,84 @@ /******************************************************************/ /* fp_montgomery_reduce.c asm or generic */ + + +/* Each platform needs to query info type 1 from cpuid to see if aesni is + * supported. Also, let's setup a macro for proper linkage w/o ABI conflicts + */ + +#if defined(HAVE_INTEL_MULX) +#ifndef _MSC_VER + #define cpuid(reg, leaf, sub)\ + __asm__ __volatile__ ("cpuid":\ + "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), "=d" (reg[3]) :\ + "a" (leaf), "c"(sub)); + + #define XASM_LINK(f) asm(f) +#else + + #include + #define cpuid(a,b) __cpuid((int*)a,b) + + #define XASM_LINK(f) + +#endif /* _MSC_VER */ + +#define EAX 0 +#define EBX 1 +#define ECX 2 +#define EDX 3 + +#define CPUID_AVX1 0x1 +#define CPUID_AVX2 0x2 +#define CPUID_RDRAND 0x4 +#define CPUID_RDSEED 0x8 + +#define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) +#define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) +#define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) +#define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) +#define SET_FLAGS + +static word32 cpuid_check = 0 ; +static word32 cpuid_flags = 0 ; + +static word32 cpuid_flag(word32 leaf, word32 sub, word32 num, word32 bit) { + int got_intel_cpu=0; + unsigned int reg[5]; + + reg[4] = '\0' ; + cpuid(reg, 0, 0); + if(memcmp((char *)&(reg[EBX]), "Genu", 4) == 0 && + memcmp((char *)&(reg[EDX]), "ineI", 4) == 0 && + memcmp((char *)&(reg[ECX]), "ntel", 4) == 0) { + got_intel_cpu = 1; + } + if (got_intel_cpu) { + cpuid(reg, leaf, sub); + return((reg[num]>>bit)&0x1) ; + } + return 0 ; +} + +INLINE static int set_cpuid_flags(void) { + if(cpuid_check == 0) { + if(cpuid_flag(7, 0, EBX, 5)){ cpuid_flags |= CPUID_AVX2 ; } + cpuid_check = 1 ; + return 0 ; + } + return 1 ; +} + +#define RETURN return +#define IF_HAVE_INTEL_MULX(func, ret) \ + if(cpuid_check==0)set_cpuid_flags() ; \ + if(IS_INTEL_AVX2){ func; ret ; } + +#else + #define IF_HAVE_INTEL_MULX(func, ret) +#endif + #if defined(TFM_X86) && !defined(TFM_SSE2) /* x86-32 code */ diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 132898962..994fcc9ae 100755 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -403,72 +403,6 @@ void fp_mul_2d(fp_int *a, int b, fp_int *c) /* generic PxQ multiplier */ #if defined(HAVE_INTEL_MULX) -/* Each platform needs to query info type 1 from cpuid to see if aesni is - * supported. Also, let's setup a macro for proper linkage w/o ABI conflicts - */ - -#ifndef _MSC_VER - #define cpuid(reg, leaf, sub)\ - __asm__ __volatile__ ("cpuid":\ - "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), "=d" (reg[3]) :\ - "a" (leaf), "c"(sub)); - - #define XASM_LINK(f) asm(f) -#else - - #include - #define cpuid(a,b) __cpuid((int*)a,b) - - #define XASM_LINK(f) - -#endif /* _MSC_VER */ - -#define EAX 0 -#define EBX 1 -#define ECX 2 -#define EDX 3 - -#define CPUID_AVX1 0x1 -#define CPUID_AVX2 0x2 -#define CPUID_RDRAND 0x4 -#define CPUID_RDSEED 0x8 - -#define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) -#define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) -#define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) -#define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) -#define SET_FLAGS if(cpuid_check==0)set_cpuid_flags() - -static word32 cpuid_check = 0 ; -static word32 cpuid_flags = 0 ; - -static word32 cpuid_flag(word32 leaf, word32 sub, word32 num, word32 bit) { - int got_intel_cpu=0; - unsigned int reg[5]; - - reg[4] = '\0' ; - cpuid(reg, 0, 0); - if(memcmp((char *)&(reg[EBX]), "Genu", 4) == 0 && - memcmp((char *)&(reg[EDX]), "ineI", 4) == 0 && - memcmp((char *)&(reg[ECX]), "ntel", 4) == 0) { - got_intel_cpu = 1; - } - if (got_intel_cpu) { - cpuid(reg, leaf, sub); - return((reg[num]>>bit)&0x1) ; - } - return 0 ; -} - -INLINE static int set_cpuid_flags(void) { - if(cpuid_check == 0) { - if(cpuid_flag(7, 0, EBX, 5)){ cpuid_flags |= CPUID_AVX2 ; } - cpuid_check = 1 ; - return 0 ; - } - return 1 ; -} - INLINE static void fp_mul_comba_mulx(fp_int *A, fp_int *B, fp_int *C) { @@ -496,7 +430,6 @@ INLINE static void fp_mul_comba_mulx(fp_int *A, fp_int *B, fp_int *C) fp_clamp(dst); fp_copy(dst, C); } - #endif void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) @@ -505,13 +438,7 @@ void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) fp_digit c0, c1, c2, *tmpx, *tmpy; fp_int tmp, *dst; - #if defined(HAVE_INTEL_MULX) - SET_FLAGS ; - if(IS_INTEL_AVX2) { - fp_mul_comba_mulx(A, B, C) ; - return ; - } - #endif + IF_HAVE_INTEL_MULX(fp_mul_comba_mulx(A, B, C), return) ; COMBA_START; COMBA_CLEAR; @@ -1725,15 +1652,9 @@ void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) { fp_digit c[FP_SIZE], *_c, *tmpm, mu = 0; int oldused, x, y, pa; - - #ifdef HAVE_INTEL_MULX - SET_FLAGS ; - if(IS_INTEL_AVX2) { - fp_montgomery_reduce_mulx(a, m, mp) ; - return ; - } - #endif - + + IF_HAVE_INTEL_MULX(fp_montgomery_reduce_mulx(a, m, mp), return) ; + /* bail if too large */ if (m->used > (FP_SIZE/2)) { (void)mu; /* shut up compiler */ From 015b68e6fb797b0ee728bb6dc5cba67fecf80e27 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Tue, 7 Apr 2015 10:21:26 +0900 Subject: [PATCH 4/7] cpuflag BMI2 for Intel MULX --- IDE/iOS/README.md | 12 +- .../wolfssl-FIPS.xcodeproj/project.pbxproj | 4 +- IDE/iOS/wolfssl.xcodeproj/project.pbxproj | 2 +- README | 15 +- README.md | 13 ++ configure.ac | 2 +- examples/client/client.vcxproj | 159 ++++++++++++++++- examples/echoclient/echoclient.vcxproj | 159 ++++++++++++++++- examples/echoserver/echoserver.vcxproj | 159 ++++++++++++++++- examples/server/server.vcxproj | 159 ++++++++++++++++- src/internal.c | 8 + sslSniffer/sslSniffer.vcxproj | 10 +- support/wolfssl.pc | 2 +- testsuite/testsuite.vcxproj | 159 ++++++++++++++++- wolfcrypt/src/asm.c | 6 +- wolfssl.vcxproj | 166 +++++++++++++++++- wolfssl/error-ssl.h | 1 + wolfssl/version.h | 4 +- wolfssl/wolfcrypt/visibility.h | 4 +- wolfssl64.sln | 58 +++++- 20 files changed, 1063 insertions(+), 39 deletions(-) diff --git a/IDE/iOS/README.md b/IDE/iOS/README.md index e9e781b49..519520e56 100644 --- a/IDE/iOS/README.md +++ b/IDE/iOS/README.md @@ -28,13 +28,10 @@ order. # Building libwolfssl.a -## Debug build - -## Release build - -A release build requires an Apple Developer account, as far as I can tell. I -have not tried this yet. +There are several options of builds. You can make a simulator build, or a +device build. Both are debug builds. +You can make an archive for a device, as well. That is a release build. # Installing libwolfssl.a @@ -67,6 +64,9 @@ for "Preprocessor Macros" and add the following under both `Release` and * `WOLFSSL_SHA512` * `WOLFSSL_SHA384` +The approved FIPS source files are from the CyaSSL project v3.4.8.fips. The FIPS +and FIPS-TEST files are from our FIPS project v3.4.8. For the wolfCAVP test +the wolfSSL version used is v3.4.8. # Using the FIPS library diff --git a/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj index 001bdf155..1f14345f9 100644 --- a/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj @@ -295,7 +295,7 @@ isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = include/wolfssl; - dstSubfolderSpec = 16; + dstSubfolderSpec = 7; files = ( 521646C41A8A7FE10062516A /* callbacks.h in CopyFiles */, 521646C51A8A7FE10062516A /* certs_test.h in CopyFiles */, @@ -917,6 +917,7 @@ $SRCROOT, $PROJECT_DIR/../.., ); + IPHONEOS_DEPLOYMENT_TARGET = 8.1; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = wolfssl; @@ -947,6 +948,7 @@ $SRCROOT, $PROJECT_DIR/../.., ); + IPHONEOS_DEPLOYMENT_TARGET = 8.1; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = wolfssl; diff --git a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj index 14fd4e4d6..0de405b73 100644 --- a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj @@ -283,7 +283,7 @@ isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = include/wolfssl; - dstSubfolderSpec = 16; + dstSubfolderSpec = 7; files = ( 521646C41A8A7FE10062516A /* callbacks.h in CopyFiles */, 521646C51A8A7FE10062516A /* certs_test.h in CopyFiles */, diff --git a/README b/README index d9e982f38..f5c77acc5 100644 --- a/README +++ b/README @@ -37,7 +37,20 @@ before calling wolfSSL_new(); Though it's not recommended. - GNU Binutils 2.24 ld has problems with some debug builds, to fix an ld error add -fdebug-types-section to C_EXTRA_FLAGS -wolfSSL (Formerly CyaSSL) Release 3.4.6 (03/30/2015) +wolfSSL (Formerly CyaSSL) Release 3.4.8 (04/06/2015) + +Release 3.4.8 of wolfSSL has bug fixes and new features including: + +- FIPS version submitted for iOS. +- Max Strength build that only allows TLSv1.2, AEAD ciphers, and PFS. +- Improvements to usage of time code. +- Improvements to VS solution files. + +See INSTALL file for build instructions. +More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html + + + *****************wolfSSL (Formerly CyaSSL) Release 3.4.6 (03/30/2015) Release 3.4.6 of wolfSSL has bug fixes and new features including: diff --git a/README.md b/README.md index 59c77e37c..a490ac2ff 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,19 @@ before calling wolfSSL_new(); Though it's not recommended. - GNU Binutils 2.24 ld has problems with some debug builds, to fix an ld error add -fdebug-types-section to C_EXTRA_FLAGS +#wolfSSL (Formerly CyaSSL) Release 3.4.8 (04/06/2015) + +##Release 3.4.8 of wolfSSL has bug fixes and new features including: + +- FIPS version submitted for iOS. +- Max Strength build that only allows TLSv1.2, AEAD ciphers, and PFS. +- Improvements to usage of time code. +- Improvements to VS solution files. + +See INSTALL file for build instructions. +More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html + + #wolfSSL (Formerly CyaSSL) Release 3.4.6 (03/30/2015) ##Release 3.4.6 of wolfSSL has bug fixes and new features including: diff --git a/configure.ac b/configure.ac index 45a687368..cdad2c153 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # # -AC_INIT([wolfssl],[3.4.7],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com]) +AC_INIT([wolfssl],[3.4.8],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/examples/client/client.vcxproj b/examples/client/client.vcxproj index 4442c56fd..dec191d7a 100644 --- a/examples/client/client.vcxproj +++ b/examples/client/client.vcxproj @@ -9,6 +9,22 @@ Debug x64 + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + Release Win32 @@ -30,56 +46,114 @@ Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode + + Application + v110 + Unicode + Application v110 Unicode + + Application + v110 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + true + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ true true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ false false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ @@ -101,6 +175,26 @@ false + + + Disabled + ../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + Disabled @@ -119,6 +213,24 @@ Console + + + Disabled + ../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + + MaxSpeed @@ -141,6 +253,28 @@ false + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + MaxSpeed @@ -162,6 +296,27 @@ true + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + + diff --git a/examples/echoclient/echoclient.vcxproj b/examples/echoclient/echoclient.vcxproj index 342bb9ca5..a3a60545a 100644 --- a/examples/echoclient/echoclient.vcxproj +++ b/examples/echoclient/echoclient.vcxproj @@ -9,6 +9,22 @@ Debug x64 + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + Release Win32 @@ -30,56 +46,114 @@ Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode + + Application + v110 + Unicode + Application v110 Unicode + + Application + v110 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + true + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ true true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ false false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ @@ -102,6 +176,26 @@ + + + Disabled + ../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + Disabled @@ -120,6 +214,24 @@ Console + + + Disabled + ../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + + MaxSpeed @@ -143,6 +255,28 @@ + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + MaxSpeed @@ -164,6 +298,27 @@ true + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + + diff --git a/examples/echoserver/echoserver.vcxproj b/examples/echoserver/echoserver.vcxproj index a9c210cbd..096ba75c6 100644 --- a/examples/echoserver/echoserver.vcxproj +++ b/examples/echoserver/echoserver.vcxproj @@ -9,6 +9,22 @@ Debug x64 + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + Release Win32 @@ -30,56 +46,114 @@ Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode + + Application + v110 + Unicode + Application v110 Unicode + + Application + v110 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + true + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ true true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ false false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ @@ -102,6 +176,26 @@ + + + Disabled + ../../;%(AdditionalIncludeDirectories) + USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + Disabled @@ -120,6 +214,24 @@ Console + + + Disabled + ../../;%(AdditionalIncludeDirectories) + USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + + MaxSpeed @@ -142,6 +254,28 @@ false + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + MaxSpeed @@ -163,6 +297,27 @@ true + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + + diff --git a/examples/server/server.vcxproj b/examples/server/server.vcxproj index dc31fd672..f6b53fc57 100644 --- a/examples/server/server.vcxproj +++ b/examples/server/server.vcxproj @@ -9,6 +9,22 @@ Debug x64 + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + Release Win32 @@ -30,56 +46,114 @@ Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode + + Application + v110 + Unicode + Application v110 Unicode + + Application + v110 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + true + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ true true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ false false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ @@ -102,6 +176,26 @@ + + + Disabled + ../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + Disabled @@ -120,6 +214,24 @@ Console + + + Disabled + ../../;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + + MaxSpeed @@ -143,6 +255,28 @@ + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + MaxSpeed @@ -164,6 +298,27 @@ true + + + MaxSpeed + true + ../../;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + + diff --git a/src/internal.c b/src/internal.c index 4f644fd2f..39e3beb90 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7589,6 +7589,8 @@ startScr: if (ssl->error == SOCKET_ERROR_E) { if (ssl->options.connReset || ssl->options.isClosed) { WOLFSSL_MSG("Peer reset or closed, connection done"); + ssl->error = SOCKET_PEER_CLOSED_E; + WOLFSSL_ERROR(ssl->error); return 0; /* peer reset or closed */ } } @@ -8002,6 +8004,12 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e) case DUPLICATE_MSG_E: return "Duplicate HandShake message Error"; + case SNI_UNSUPPORTED: + return "Protocol version does not support SNI Error"; + + case SOCKET_PEER_CLOSED_E: + return "Peer closed underlying transport Error"; + default : return "unknown error number"; } diff --git a/sslSniffer/sslSniffer.vcxproj b/sslSniffer/sslSniffer.vcxproj index 7419737c1..56404e997 100644 --- a/sslSniffer/sslSniffer.vcxproj +++ b/sslSniffer/sslSniffer.vcxproj @@ -67,19 +67,23 @@ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ true true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ false false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ @@ -166,7 +170,7 @@ - + diff --git a/support/wolfssl.pc b/support/wolfssl.pc index 1265e7ce0..c07ae3ea2 100644 --- a/support/wolfssl.pc +++ b/support/wolfssl.pc @@ -5,6 +5,6 @@ includedir=${prefix}/include Name: wolfssl Description: wolfssl C library. -Version: 3.4.7 +Version: 3.4.8 Libs: -L${libdir} -lwolfssl Cflags: -I${includedir} diff --git a/testsuite/testsuite.vcxproj b/testsuite/testsuite.vcxproj index f7d5f16b5..484a87584 100644 --- a/testsuite/testsuite.vcxproj +++ b/testsuite/testsuite.vcxproj @@ -9,6 +9,22 @@ Debug x64 + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + Release Win32 @@ -30,56 +46,114 @@ Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode true + + Application + v110 + Unicode + true + Application v110 Unicode + + Application + v110 + Unicode + Application v110 Unicode + + Application + v110 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + true + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ true true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ false false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ @@ -101,6 +175,26 @@ false + + + Disabled + ../;%(AdditionalIncludeDirectories) + NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + Disabled @@ -119,6 +213,24 @@ Console + + + Disabled + ../;%(AdditionalIncludeDirectories) + NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + + MaxSpeed @@ -141,6 +253,28 @@ false + + + MaxSpeed + true + ../;%(AdditionalIncludeDirectories) + NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + MaxSpeed @@ -162,6 +296,27 @@ true + + + MaxSpeed + true + ../;%(AdditionalIncludeDirectories) + NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + Ws2_32.lib;%(AdditionalDependencies) + true + Console + true + true + + diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index 016225df1..08dc21d16 100755 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -65,9 +65,11 @@ #define CPUID_AVX2 0x2 #define CPUID_RDRAND 0x4 #define CPUID_RDSEED 0x8 +#define CPUID_BMI2 0x10 #define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) #define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) +#define IS_INTEL_BMI2 (cpuid_flags&CPUID_BMI2) #define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) #define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) #define SET_FLAGS @@ -95,7 +97,7 @@ static word32 cpuid_flag(word32 leaf, word32 sub, word32 num, word32 bit) { INLINE static int set_cpuid_flags(void) { if(cpuid_check == 0) { - if(cpuid_flag(7, 0, EBX, 5)){ cpuid_flags |= CPUID_AVX2 ; } + if(cpuid_flag(7, 0, EBX, 8)){ cpuid_flags |= CPUID_BMI2 ; } cpuid_check = 1 ; return 0 ; } @@ -105,7 +107,7 @@ INLINE static int set_cpuid_flags(void) { #define RETURN return #define IF_HAVE_INTEL_MULX(func, ret) \ if(cpuid_check==0)set_cpuid_flags() ; \ - if(IS_INTEL_AVX2){ func; ret ; } + if(IS_INTEL_BMI2){ func; ret ; } #else #define IF_HAVE_INTEL_MULX(func, ret) diff --git a/wolfssl.vcxproj b/wolfssl.vcxproj index cf057198a..8a95297e1 100644 --- a/wolfssl.vcxproj +++ b/wolfssl.vcxproj @@ -9,6 +9,22 @@ Debug x64 + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + Release Win32 @@ -30,51 +46,104 @@ Unicode true + + DynamicLibrary + v110 + Unicode + true + StaticLibrary v110 Unicode true + + DynamicLibrary + v110 + Unicode + true + StaticLibrary v110 Unicode + + DynamicLibrary + v110 + Unicode + StaticLibrary v110 Unicode + + DynamicLibrary + v110 + Unicode + + + + + + + + + + + + + - - <_ProjectFileVersion>11.0.61030.0 + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ - - + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + $(SolutionDir)$(Configuration)\ - $(Configuration)\ + $(Configuration)\obj\ + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\obj\ + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\obj\ - Disabled @@ -89,6 +158,26 @@ 4206;4214;4706;%(DisableSpecificWarnings) + + + Disabled + ./;%(AdditionalIncludeDirectories) + OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + EditAndContinue + 4206;4214;4706;%(DisableSpecificWarnings) + + + ws2_32.lib;%(AdditionalDependencies) + false + true + + Disabled @@ -103,6 +192,25 @@ 4206;4214;4706;%(DisableSpecificWarnings) + + + Disabled + ./;%(AdditionalIncludeDirectories) + OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + 4206;4214;4706;%(DisableSpecificWarnings) + + + ws2_32.lib;%(AdditionalDependencies) + false + true + + MaxSpeed @@ -116,6 +224,24 @@ ProgramDatabase + + + MaxSpeed + true + ./;%(AdditionalIncludeDirectories) + OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + ws2_32.lib;%(AdditionalDependencies) + true + + MaxSpeed @@ -130,6 +256,24 @@ ProgramDatabase + + + MaxSpeed + true + ./;%(AdditionalIncludeDirectories) + OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + ws2_32.lib;%(AdditionalDependencies) + true + + @@ -169,14 +313,20 @@ false + false ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj false + false ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj - + \ No newline at end of file diff --git a/wolfssl/error-ssl.h b/wolfssl/error-ssl.h index 732240382..0df2edb6e 100644 --- a/wolfssl/error-ssl.h +++ b/wolfssl/error-ssl.h @@ -127,6 +127,7 @@ enum wolfSSL_ErrorCodes { SANITY_MSG_E = -394, /* Sanity check on msg order error */ DUPLICATE_MSG_E = -395, /* Duplicate message error */ SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */ + SOCKET_PEER_CLOSED_E = -397, /* Underlying transport closed */ /* add strings to SetErrorString !!!!! */ diff --git a/wolfssl/version.h b/wolfssl/version.h index 54e92ffc0..c76e07613 100644 --- a/wolfssl/version.h +++ b/wolfssl/version.h @@ -26,8 +26,8 @@ extern "C" { #endif -#define LIBWOLFSSL_VERSION_STRING "3.4.7" -#define LIBWOLFSSL_VERSION_HEX 0x03004007 +#define LIBWOLFSSL_VERSION_STRING "3.4.8" +#define LIBWOLFSSL_VERSION_HEX 0x03004008 #ifdef __cplusplus } diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 05fd4754b..6e41d238f 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -47,7 +47,7 @@ #define WOLFSSL_LOCAL __hidden #elif defined(_MSC_VER) #ifdef WOLFSSL_DLL - #define WOLFSSL_API extern __declspec(dllexport) + #define WOLFSSL_API __declspec(dllexport) #else #define WOLFSSL_API #endif @@ -59,7 +59,7 @@ #else /* BUILDING_WOLFSSL */ #if defined(_MSC_VER) #ifdef WOLFSSL_DLL - #define WOLFSSL_API extern __declspec(dllimport) + #define WOLFSSL_API __declspec(dllimport) #else #define WOLFSSL_API #endif diff --git a/wolfssl64.sln b/wolfssl64.sln index 223ad75da..5e17787dc 100644 --- a/wolfssl64.sln +++ b/wolfssl64.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2012 for Windows Desktop +# Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wolfssl", "wolfssl.vcxproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite.vcxproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}" @@ -19,6 +19,10 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + DLL Debug|Win32 = DLL Debug|Win32 + DLL Debug|x64 = DLL Debug|x64 + DLL Release|Win32 = DLL Release|Win32 + DLL Release|x64 = DLL Release|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection @@ -27,6 +31,14 @@ Global {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|x64.ActiveCfg = Debug|x64 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|x64.Build.0 = Debug|x64 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|x64.Build.0 = DLL Release|x64 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|x64.ActiveCfg = Release|x64 @@ -35,6 +47,14 @@ Global {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|x64.ActiveCfg = Debug|x64 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|x64.Build.0 = Debug|x64 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|x64.Build.0 = DLL Release|x64 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|x64.ActiveCfg = Release|x64 @@ -43,6 +63,10 @@ Global {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.Build.0 = Debug|Win32 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|x64.ActiveCfg = Debug|x64 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|x64.Build.0 = Debug|x64 + {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Debug|Win32.ActiveCfg = Debug|Win32 + {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Debug|x64.ActiveCfg = Debug|x64 + {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Release|Win32.ActiveCfg = Release|Win32 + {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Release|x64.ActiveCfg = Release|x64 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.ActiveCfg = Release|Win32 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.Build.0 = Release|Win32 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|x64.ActiveCfg = Release|x64 @@ -51,6 +75,14 @@ Global {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|x64.ActiveCfg = Debug|x64 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|x64.Build.0 = Debug|x64 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|x64.Build.0 = DLL Release|x64 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|x64.ActiveCfg = Release|x64 @@ -59,6 +91,14 @@ Global {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|x64.ActiveCfg = Debug|x64 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|x64.Build.0 = Debug|x64 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|x64.Build.0 = DLL Release|x64 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|x64.ActiveCfg = Release|x64 @@ -67,6 +107,14 @@ Global {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32 {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|x64.ActiveCfg = Debug|x64 {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|x64.Build.0 = Debug|x64 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|x64.Build.0 = DLL Release|x64 {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32 {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32 {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|x64.ActiveCfg = Release|x64 @@ -75,6 +123,14 @@ Global {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|x64.ActiveCfg = Debug|x64 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|x64.Build.0 = Debug|x64 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|x64.Build.0 = DLL Release|x64 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|x64.ActiveCfg = Release|x64 From 6728a18d7c6dc97c0872f4393c538a6ee7b9c5c2 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Wed, 8 Apr 2015 10:14:45 +0900 Subject: [PATCH 5/7] cpuflag ADX for Intel MULX in asm.c, BMI2 in sha256/512.c --- wolfcrypt/src/asm.c | 7 +++++-- wolfcrypt/src/sha256.c | 5 ++++- wolfcrypt/src/sha512.c | 7 +++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index 08dc21d16..9f8458588 100755 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -65,11 +65,13 @@ #define CPUID_AVX2 0x2 #define CPUID_RDRAND 0x4 #define CPUID_RDSEED 0x8 -#define CPUID_BMI2 0x10 +#define CPUID_BMI2 0x10 /* MULX, RORX */ +#define CPUID_ADX 0x20 /* ADCX, ADOX */ #define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) #define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) #define IS_INTEL_BMI2 (cpuid_flags&CPUID_BMI2) +#define IS_INTEL_ADX (cpuid_flags&CPUID_ADX) #define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) #define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) #define SET_FLAGS @@ -98,6 +100,7 @@ static word32 cpuid_flag(word32 leaf, word32 sub, word32 num, word32 bit) { INLINE static int set_cpuid_flags(void) { if(cpuid_check == 0) { if(cpuid_flag(7, 0, EBX, 8)){ cpuid_flags |= CPUID_BMI2 ; } + if(cpuid_flag(7, 0, EBX,19)){ cpuid_flags |= CPUID_ADX ; } cpuid_check = 1 ; return 0 ; } @@ -107,7 +110,7 @@ INLINE static int set_cpuid_flags(void) { #define RETURN return #define IF_HAVE_INTEL_MULX(func, ret) \ if(cpuid_check==0)set_cpuid_flags() ; \ - if(IS_INTEL_BMI2){ func; ret ; } + if(IS_INTEL_BMI2 && IS_INTEL_ADX){ func; ret ; } #else #define IF_HAVE_INTEL_MULX(func, ret) diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 9993dcc88..6ab516347 100755 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -176,9 +176,11 @@ int InitSha256(Sha256* sha256) { #define CPUID_AVX2 0x2 #define CPUID_RDRAND 0x4 #define CPUID_RDSEED 0x8 +#define CPUID_BMI2 0x10 /* MULX, RORX */ #define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) #define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) +#define IS_INTEL_BMI2 (cpuid_flags&CPUID_BMI2) #define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) #define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) @@ -207,6 +209,7 @@ static int set_cpuid_flags(void) { if(cpuid_check==0) { if(cpuid_flag(1, 0, ECX, 28)){ cpuid_flags |= CPUID_AVX1 ;} if(cpuid_flag(7, 0, EBX, 5)){ cpuid_flags |= CPUID_AVX2 ; } + if(cpuid_flag(7, 0, EBX, 8)) { cpuid_flags |= CPUID_BMI2 ; } if(cpuid_flag(1, 0, ECX, 30)){ cpuid_flags |= CPUID_RDRAND ; } if(cpuid_flag(7, 0, EBX, 18)){ cpuid_flags |= CPUID_RDSEED ; } cpuid_check = 1 ; @@ -235,7 +238,7 @@ static void set_Transform(void) { if(set_cpuid_flags())return ; #if defined(HAVE_INTEL_AVX2) - if(IS_INTEL_AVX2){ + if(IS_INTEL_AVX2 && IS_INTEL_BMI2){ Transform_p = Transform_AVX1_RORX; return ; Transform_p = Transform_AVX2 ; /* for avoiding warning,"not used" */ diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index f77c8a2cf..62457f891 100755 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -208,9 +208,11 @@ int InitSha512(Sha512* sha512) { #define CPUID_AVX2 0x2 #define CPUID_RDRAND 0x4 #define CPUID_RDSEED 0x8 +#define CPUID_BMI2 0x10 /* MULX, RORX */ #define IS_INTEL_AVX1 (cpuid_flags&CPUID_AVX1) #define IS_INTEL_AVX2 (cpuid_flags&CPUID_AVX2) +#define IS_INTEL_BMI2 (cpuid_flags&CPUID_BMI2) #define IS_INTEL_RDRAND (cpuid_flags&CPUID_RDRAND) #define IS_INTEL_RDSEED (cpuid_flags&CPUID_RDSEED) @@ -242,6 +244,7 @@ static int set_cpuid_flags(int sha) { if((cpuid_check & sha) ==0) { if(cpuid_flag(1, 0, ECX, 28)){ cpuid_flags |= CPUID_AVX1 ;} if(cpuid_flag(7, 0, EBX, 5)){ cpuid_flags |= CPUID_AVX2 ; } + if(cpuid_flag(7, 0, EBX, 8)) { cpuid_flags |= CPUID_BMI2 ; } if(cpuid_flag(1, 0, ECX, 30)){ cpuid_flags |= CPUID_RDRAND ; } if(cpuid_flag(7, 0, EBX, 18)){ cpuid_flags |= CPUID_RDSEED ; } cpuid_check |= sha ; @@ -276,7 +279,7 @@ static void set_Transform(void) { if(set_cpuid_flags(CHECK_SHA512)) return ; #if defined(HAVE_INTEL_AVX2) - if(IS_INTEL_AVX2){ + if(IS_INTEL_AVX2 && IS_INTEL_BMI2){ Transform_p = Transform_AVX1_RORX; return ; Transform_p = Transform_AVX2 ; /* for avoiding warning,"not used" */ @@ -1352,7 +1355,7 @@ static void set_Transform384(void) { Transform384_p = ((IS_INTEL_AVX1) ? Transform384_AVX1 : _Transform384) ; #elif defined(HAVE_INTEL_AVX2) #if defined(HAVE_INTEL_AVX1) && defined(HAVE_INTEL_RORX) - if(IS_INTEL_AVX2) { Transform384_p = Transform384_AVX1_RORX ; return ; } + if(IS_INTEL_AVX2 && IS_INTEL_BMI2) { Transform384_p = Transform384_AVX1_RORX ; return ; } #endif if(IS_INTEL_AVX2) { Transform384_p = Transform384_AVX2 ; return ; } #if defined(HAVE_INTEL_AVX1) From 079c9908a39797dc5e484d651dbe7beff5ae2ecf Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Wed, 8 Apr 2015 11:09:57 +0900 Subject: [PATCH 6/7] Merged with 3.4.8 --- .../wolfssl-FIPS.xcodeproj/project.pbxproj | 12 +- src/internal.c | 194 +++++++++++++----- wolfcrypt/src/asn.c | 5 +- 3 files changed, 153 insertions(+), 58 deletions(-) diff --git a/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj index 1f14345f9..06011aecd 100644 --- a/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj @@ -865,7 +865,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; USER_HEADER_SEARCH_PATHS = "wolfssl/wolfcrypt wolfssl include"; @@ -888,7 +888,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; SDKROOT = iphoneos; USER_HEADER_SEARCH_PATHS = "wolfssl/wolfcrypt wolfssl include"; VALIDATE_PRODUCT = NO; @@ -911,6 +911,10 @@ HAVE_AESGCM, WOLFSSL_SHA512, WOLFSSL_SHA384, + NO_MD4, + NO_HC128, + NO_RABBIT, + NO_DSA, NO_PWDBASED, ); HEADER_SEARCH_PATHS = ( @@ -942,6 +946,10 @@ HAVE_AESGCM, WOLFSSL_SHA512, WOLFSSL_SHA384, + NO_MD4, + NO_HC128, + NO_RABBIT, + NO_DSA, NO_PWDBASED, ); HEADER_SEARCH_PATHS = ( diff --git a/src/internal.c b/src/internal.c index 39e3beb90..ab13a56a5 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9977,6 +9977,20 @@ static void PickHashSigAlgo(WOLFSSL* ssl, byte sigAlgo = ssl->specs.sig_algo; word16 verifySz = (word16) (*inOutIdx - begin); +#ifndef NO_OLD_TLS + byte doMd5 = 0; + byte doSha = 0; +#endif +#ifndef NO_SHA256 + byte doSha256 = 0; +#endif +#ifdef WOLFSSL_SHA384 + byte doSha384 = 0; +#endif +#ifdef WOLFSSL_SHA512 + byte doSha512 = 0; +#endif + (void)hash; (void)sigAlgo; (void)hashAlgo; @@ -9995,11 +10009,60 @@ static void PickHashSigAlgo(WOLFSSL* ssl, XMEMCPY(messageVerify, input + begin, verifySz); if (IsAtLeastTLSv1_2(ssl)) { + byte setHash = 0; if ((*inOutIdx - begin) + ENUM_LEN + ENUM_LEN > size) ERROR_OUT(BUFFER_ERROR, done); hashAlgo = input[(*inOutIdx)++]; sigAlgo = input[(*inOutIdx)++]; + + switch (hashAlgo) { + case sha512_mac: + #ifdef WOLFSSL_SHA512 + doSha512 = 1; + setHash = 1; + #endif + break; + + case sha384_mac: + #ifdef WOLFSSL_SHA384 + doSha384 = 1; + setHash = 1; + #endif + break; + + case sha256_mac: + #ifndef NO_SHA256 + doSha256 = 1; + setHash = 1; + #endif + break; + + case sha_mac: + #ifndef NO_OLD_TLS + doSha = 1; + setHash = 1; + #endif + break; + + default: + ERROR_OUT(ALGO_ID_E, done); + } + + if (setHash == 0) { + ERROR_OUT(ALGO_ID_E, done); + } + + } else { + /* only using sha and md5 for rsa */ + #ifndef NO_OLD_TLS + doSha = 1; + if (sigAlgo == rsa_sa_algo) { + doMd5 = 1; + } + #else + ERROR_OUT(ALGO_ID_E, done); + #endif } /* signature */ @@ -10024,83 +10087,104 @@ static void PickHashSigAlgo(WOLFSSL* ssl, #ifndef NO_OLD_TLS /* md5 */ #ifdef WOLFSSL_SMALL_STACK - md5 = (Md5*)XMALLOC(sizeof(Md5), NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (md5 == NULL) - ERROR_OUT(MEMORY_E, done); + if (doMd5) { + md5 = (Md5*)XMALLOC(sizeof(Md5), NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (md5 == NULL) + ERROR_OUT(MEMORY_E, done); + } #endif - wc_InitMd5(md5); - wc_Md5Update(md5, ssl->arrays->clientRandom, RAN_LEN); - wc_Md5Update(md5, ssl->arrays->serverRandom, RAN_LEN); - wc_Md5Update(md5, messageVerify, verifySz); - wc_Md5Final(md5, hash); - + if (doMd5) { + wc_InitMd5(md5); + wc_Md5Update(md5, ssl->arrays->clientRandom, RAN_LEN); + wc_Md5Update(md5, ssl->arrays->serverRandom, RAN_LEN); + wc_Md5Update(md5, messageVerify, verifySz); + wc_Md5Final(md5, hash); + } /* sha */ #ifdef WOLFSSL_SMALL_STACK - sha = (Sha*)XMALLOC(sizeof(Sha), NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (sha == NULL) - ERROR_OUT(MEMORY_E, done); + if (doSha) { + sha = (Sha*)XMALLOC(sizeof(Sha), NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (sha == NULL) + ERROR_OUT(MEMORY_E, done); + } #endif - ret = wc_InitSha(sha); - if (ret != 0) - goto done; - wc_ShaUpdate(sha, ssl->arrays->clientRandom, RAN_LEN); - wc_ShaUpdate(sha, ssl->arrays->serverRandom, RAN_LEN); - wc_ShaUpdate(sha, messageVerify, verifySz); - wc_ShaFinal(sha, hash + MD5_DIGEST_SIZE); + if (doSha) { + ret = wc_InitSha(sha); + if (ret != 0) goto done; + wc_ShaUpdate(sha, ssl->arrays->clientRandom, RAN_LEN); + wc_ShaUpdate(sha, ssl->arrays->serverRandom, RAN_LEN); + wc_ShaUpdate(sha, messageVerify, verifySz); + wc_ShaFinal(sha, hash + MD5_DIGEST_SIZE); + } #endif #ifndef NO_SHA256 #ifdef WOLFSSL_SMALL_STACK - sha256 = (Sha256*)XMALLOC(sizeof(Sha256), NULL, + if (doSha256) { + sha256 = (Sha256*)XMALLOC(sizeof(Sha256), NULL, DYNAMIC_TYPE_TMP_BUFFER); - hash256 = (byte*)XMALLOC(SHA256_DIGEST_SIZE, NULL, + hash256 = (byte*)XMALLOC(SHA256_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (sha256 == NULL || hash256 == NULL) - ERROR_OUT(MEMORY_E, done); + if (sha256 == NULL || hash256 == NULL) + ERROR_OUT(MEMORY_E, done); + } #endif - if (!(ret = wc_InitSha256(sha256)) - && !(ret = wc_Sha256Update(sha256, ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha256Update(sha256, ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha256Update(sha256, messageVerify, verifySz))) - ret = wc_Sha256Final(sha256, hash256); - if (ret != 0) - goto done; + if (doSha256) { + if (!(ret = wc_InitSha256(sha256)) + && !(ret = wc_Sha256Update(sha256, ssl->arrays->clientRandom, + RAN_LEN)) + && !(ret = wc_Sha256Update(sha256, ssl->arrays->serverRandom, + RAN_LEN)) + && !(ret = wc_Sha256Update(sha256, messageVerify, verifySz))) + ret = wc_Sha256Final(sha256, hash256); + if (ret != 0) goto done; + } #endif #ifdef WOLFSSL_SHA384 #ifdef WOLFSSL_SMALL_STACK - sha384 = (Sha384*)XMALLOC(sizeof(Sha384), NULL, + if (doSha384) { + sha384 = (Sha384*)XMALLOC(sizeof(Sha384), NULL, DYNAMIC_TYPE_TMP_BUFFER); - hash384 = (byte*)XMALLOC(SHA384_DIGEST_SIZE, NULL, + hash384 = (byte*)XMALLOC(SHA384_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (sha384 == NULL || hash384 == NULL) - ERROR_OUT(MEMORY_E, done); + if (sha384 == NULL || hash384 == NULL) + ERROR_OUT(MEMORY_E, done); + } #endif - if (!(ret = wc_InitSha384(sha384)) - && !(ret = wc_Sha384Update(sha384, ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha384Update(sha384, ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha384Update(sha384, messageVerify, verifySz))) - ret = wc_Sha384Final(sha384, hash384); - if (ret != 0) - goto done; + if (doSha384) { + if (!(ret = wc_InitSha384(sha384)) + && !(ret = wc_Sha384Update(sha384, ssl->arrays->clientRandom, + RAN_LEN)) + && !(ret = wc_Sha384Update(sha384, ssl->arrays->serverRandom, + RAN_LEN)) + && !(ret = wc_Sha384Update(sha384, messageVerify, verifySz))) + ret = wc_Sha384Final(sha384, hash384); + if (ret != 0) goto done; + } #endif #ifdef WOLFSSL_SHA512 #ifdef WOLFSSL_SMALL_STACK - sha512 = (Sha512*)XMALLOC(sizeof(Sha512), NULL, + if (doSha512) { + sha512 = (Sha512*)XMALLOC(sizeof(Sha512), NULL, DYNAMIC_TYPE_TMP_BUFFER); - hash512 = (byte*)XMALLOC(SHA512_DIGEST_SIZE, NULL, + hash512 = (byte*)XMALLOC(SHA512_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER); - if (sha512 == NULL || hash512 == NULL) - ERROR_OUT(MEMORY_E, done); + if (sha512 == NULL || hash512 == NULL) + ERROR_OUT(MEMORY_E, done); + } #endif - if (!(ret = wc_InitSha512(sha512)) - && !(ret = wc_Sha512Update(sha512, ssl->arrays->clientRandom, RAN_LEN)) - && !(ret = wc_Sha512Update(sha512, ssl->arrays->serverRandom, RAN_LEN)) - && !(ret = wc_Sha512Update(sha512, messageVerify, verifySz))) - ret = wc_Sha512Final(sha512, hash512); - if (ret != 0) - goto done; + if (doSha512) { + if (!(ret = wc_InitSha512(sha512)) + && !(ret = wc_Sha512Update(sha512, ssl->arrays->clientRandom, + RAN_LEN)) + && !(ret = wc_Sha512Update(sha512, ssl->arrays->serverRandom, + RAN_LEN)) + && !(ret = wc_Sha512Update(sha512, messageVerify, verifySz))) + ret = wc_Sha512Final(sha512, hash512); + if (ret != 0) goto done; + } #endif #ifndef NO_RSA @@ -10186,8 +10270,10 @@ static void PickHashSigAlgo(WOLFSSL* ssl, ERROR_OUT(MEMORY_E, done); #endif - encSigSz = wc_EncodeSignature(encodedSig, digest, digestSz, typeH); - + if (digest == NULL) + ERROR_OUT(ALGO_ID_E, done); + encSigSz = wc_EncodeSignature(encodedSig, digest, digestSz, + typeH); if (encSigSz != verifiedSz || !out || XMEMCMP(out, encodedSig, min(encSigSz, MAX_ENCODED_SIG_SZ)) != 0) ret = VERIFY_SIGN_ERROR; diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 399753ab3..634623bee 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -2931,12 +2931,13 @@ WOLFSSL_LOCAL word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz) } -word32 wc_EncodeSignature(byte* out, const byte* digest, word32 digSz, int hashOID) +word32 wc_EncodeSignature(byte* out, const byte* digest, word32 digSz, + int hashOID) { byte digArray[MAX_ENCODED_DIG_SZ]; byte algoArray[MAX_ALGO_SZ]; byte seqArray[MAX_SEQ_SZ]; - word32 encDigSz, algoSz, seqSz; + word32 encDigSz, algoSz, seqSz; encDigSz = SetDigest(digest, digSz, digArray); algoSz = SetAlgoID(hashOID, algoArray, hashType, 0); From 3ff5e5402550aee9c4faae2d158ba2bdb9bfef80 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Wed, 8 Apr 2015 13:46:27 +0900 Subject: [PATCH 7/7] rollback files --- IDE/iOS/README.md | 12 +- .../wolfssl-FIPS.xcodeproj/project.pbxproj | 4 +- IDE/iOS/wolfssl.xcodeproj/project.pbxproj | 2 +- README | 15 +- README.md | 13 -- configure.ac | 2 +- examples/client/client.vcxproj | 159 +---------------- examples/echoclient/echoclient.vcxproj | 159 +---------------- examples/echoserver/echoserver.vcxproj | 159 +---------------- examples/server/server.vcxproj | 159 +---------------- src/internal.c | 8 - sslSniffer/sslSniffer.vcxproj | 10 +- support/wolfssl.pc | 2 +- testsuite/testsuite.vcxproj | 159 +---------------- wolfssl.vcxproj | 166 +----------------- wolfssl/error-ssl.h | 1 - wolfssl/version.h | 4 +- wolfssl/wolfcrypt/visibility.h | 4 +- wolfssl64.sln | 58 +----- 19 files changed, 37 insertions(+), 1059 deletions(-) diff --git a/IDE/iOS/README.md b/IDE/iOS/README.md index 519520e56..e9e781b49 100644 --- a/IDE/iOS/README.md +++ b/IDE/iOS/README.md @@ -28,10 +28,13 @@ order. # Building libwolfssl.a -There are several options of builds. You can make a simulator build, or a -device build. Both are debug builds. +## Debug build + +## Release build + +A release build requires an Apple Developer account, as far as I can tell. I +have not tried this yet. -You can make an archive for a device, as well. That is a release build. # Installing libwolfssl.a @@ -64,9 +67,6 @@ for "Preprocessor Macros" and add the following under both `Release` and * `WOLFSSL_SHA512` * `WOLFSSL_SHA384` -The approved FIPS source files are from the CyaSSL project v3.4.8.fips. The FIPS -and FIPS-TEST files are from our FIPS project v3.4.8. For the wolfCAVP test -the wolfSSL version used is v3.4.8. # Using the FIPS library diff --git a/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj index 1f14345f9..001bdf155 100644 --- a/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl-FIPS.xcodeproj/project.pbxproj @@ -295,7 +295,7 @@ isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = include/wolfssl; - dstSubfolderSpec = 7; + dstSubfolderSpec = 16; files = ( 521646C41A8A7FE10062516A /* callbacks.h in CopyFiles */, 521646C51A8A7FE10062516A /* certs_test.h in CopyFiles */, @@ -917,7 +917,6 @@ $SRCROOT, $PROJECT_DIR/../.., ); - IPHONEOS_DEPLOYMENT_TARGET = 8.1; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = wolfssl; @@ -948,7 +947,6 @@ $SRCROOT, $PROJECT_DIR/../.., ); - IPHONEOS_DEPLOYMENT_TARGET = 8.1; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = wolfssl; diff --git a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj index 0de405b73..14fd4e4d6 100644 --- a/IDE/iOS/wolfssl.xcodeproj/project.pbxproj +++ b/IDE/iOS/wolfssl.xcodeproj/project.pbxproj @@ -283,7 +283,7 @@ isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = include/wolfssl; - dstSubfolderSpec = 7; + dstSubfolderSpec = 16; files = ( 521646C41A8A7FE10062516A /* callbacks.h in CopyFiles */, 521646C51A8A7FE10062516A /* certs_test.h in CopyFiles */, diff --git a/README b/README index f5c77acc5..d9e982f38 100644 --- a/README +++ b/README @@ -37,20 +37,7 @@ before calling wolfSSL_new(); Though it's not recommended. - GNU Binutils 2.24 ld has problems with some debug builds, to fix an ld error add -fdebug-types-section to C_EXTRA_FLAGS -wolfSSL (Formerly CyaSSL) Release 3.4.8 (04/06/2015) - -Release 3.4.8 of wolfSSL has bug fixes and new features including: - -- FIPS version submitted for iOS. -- Max Strength build that only allows TLSv1.2, AEAD ciphers, and PFS. -- Improvements to usage of time code. -- Improvements to VS solution files. - -See INSTALL file for build instructions. -More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html - - - *****************wolfSSL (Formerly CyaSSL) Release 3.4.6 (03/30/2015) +wolfSSL (Formerly CyaSSL) Release 3.4.6 (03/30/2015) Release 3.4.6 of wolfSSL has bug fixes and new features including: diff --git a/README.md b/README.md index a490ac2ff..59c77e37c 100644 --- a/README.md +++ b/README.md @@ -38,19 +38,6 @@ before calling wolfSSL_new(); Though it's not recommended. - GNU Binutils 2.24 ld has problems with some debug builds, to fix an ld error add -fdebug-types-section to C_EXTRA_FLAGS -#wolfSSL (Formerly CyaSSL) Release 3.4.8 (04/06/2015) - -##Release 3.4.8 of wolfSSL has bug fixes and new features including: - -- FIPS version submitted for iOS. -- Max Strength build that only allows TLSv1.2, AEAD ciphers, and PFS. -- Improvements to usage of time code. -- Improvements to VS solution files. - -See INSTALL file for build instructions. -More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html - - #wolfSSL (Formerly CyaSSL) Release 3.4.6 (03/30/2015) ##Release 3.4.6 of wolfSSL has bug fixes and new features including: diff --git a/configure.ac b/configure.ac index cdad2c153..45a687368 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # # -AC_INIT([wolfssl],[3.4.8],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com]) +AC_INIT([wolfssl],[3.4.7],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/examples/client/client.vcxproj b/examples/client/client.vcxproj index dec191d7a..4442c56fd 100644 --- a/examples/client/client.vcxproj +++ b/examples/client/client.vcxproj @@ -9,22 +9,6 @@ Debug x64 - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - Release Win32 @@ -46,114 +30,56 @@ Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode - - Application - v110 - Unicode - Application v110 Unicode - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - true - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ true true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - false - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ false false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ @@ -175,26 +101,6 @@ false - - - Disabled - ../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - MachineX86 - - Disabled @@ -213,24 +119,6 @@ Console - - - Disabled - ../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - - MaxSpeed @@ -253,28 +141,6 @@ false - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX86 - - MaxSpeed @@ -296,27 +162,6 @@ true - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - - diff --git a/examples/echoclient/echoclient.vcxproj b/examples/echoclient/echoclient.vcxproj index a3a60545a..342bb9ca5 100644 --- a/examples/echoclient/echoclient.vcxproj +++ b/examples/echoclient/echoclient.vcxproj @@ -9,22 +9,6 @@ Debug x64 - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - Release Win32 @@ -46,114 +30,56 @@ Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode - - Application - v110 - Unicode - Application v110 Unicode - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - true - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ true true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - false - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ false false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ @@ -176,26 +102,6 @@ - - - Disabled - ../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - MachineX86 - - Disabled @@ -214,24 +120,6 @@ Console - - - Disabled - ../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - - MaxSpeed @@ -255,28 +143,6 @@ - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX86 - - MaxSpeed @@ -298,27 +164,6 @@ true - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - - diff --git a/examples/echoserver/echoserver.vcxproj b/examples/echoserver/echoserver.vcxproj index 096ba75c6..a9c210cbd 100644 --- a/examples/echoserver/echoserver.vcxproj +++ b/examples/echoserver/echoserver.vcxproj @@ -9,22 +9,6 @@ Debug x64 - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - Release Win32 @@ -46,114 +30,56 @@ Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode - - Application - v110 - Unicode - Application v110 Unicode - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - true - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ true true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - false - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ false false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ @@ -176,26 +102,6 @@ - - - Disabled - ../../;%(AdditionalIncludeDirectories) - USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - MachineX86 - - Disabled @@ -214,24 +120,6 @@ Console - - - Disabled - ../../;%(AdditionalIncludeDirectories) - USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - - MaxSpeed @@ -254,28 +142,6 @@ false - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX86 - - MaxSpeed @@ -297,27 +163,6 @@ true - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - - diff --git a/examples/server/server.vcxproj b/examples/server/server.vcxproj index f6b53fc57..dc31fd672 100644 --- a/examples/server/server.vcxproj +++ b/examples/server/server.vcxproj @@ -9,22 +9,6 @@ Debug x64 - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - Release Win32 @@ -46,114 +30,56 @@ Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode - - Application - v110 - Unicode - Application v110 Unicode - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - true - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ true true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - false - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ false false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ @@ -176,26 +102,6 @@ - - - Disabled - ../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - MachineX86 - - Disabled @@ -214,24 +120,6 @@ Console - - - Disabled - ../../;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - - MaxSpeed @@ -255,28 +143,6 @@ - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX86 - - MaxSpeed @@ -298,27 +164,6 @@ true - - - MaxSpeed - true - ../../;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - - diff --git a/src/internal.c b/src/internal.c index 39e3beb90..4f644fd2f 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7589,8 +7589,6 @@ startScr: if (ssl->error == SOCKET_ERROR_E) { if (ssl->options.connReset || ssl->options.isClosed) { WOLFSSL_MSG("Peer reset or closed, connection done"); - ssl->error = SOCKET_PEER_CLOSED_E; - WOLFSSL_ERROR(ssl->error); return 0; /* peer reset or closed */ } } @@ -8004,12 +8002,6 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e) case DUPLICATE_MSG_E: return "Duplicate HandShake message Error"; - case SNI_UNSUPPORTED: - return "Protocol version does not support SNI Error"; - - case SOCKET_PEER_CLOSED_E: - return "Peer closed underlying transport Error"; - default : return "unknown error number"; } diff --git a/sslSniffer/sslSniffer.vcxproj b/sslSniffer/sslSniffer.vcxproj index 56404e997..7419737c1 100644 --- a/sslSniffer/sslSniffer.vcxproj +++ b/sslSniffer/sslSniffer.vcxproj @@ -67,23 +67,19 @@ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ true true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ false false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ @@ -170,7 +166,7 @@ - + diff --git a/support/wolfssl.pc b/support/wolfssl.pc index c07ae3ea2..1265e7ce0 100644 --- a/support/wolfssl.pc +++ b/support/wolfssl.pc @@ -5,6 +5,6 @@ includedir=${prefix}/include Name: wolfssl Description: wolfssl C library. -Version: 3.4.8 +Version: 3.4.7 Libs: -L${libdir} -lwolfssl Cflags: -I${includedir} diff --git a/testsuite/testsuite.vcxproj b/testsuite/testsuite.vcxproj index 484a87584..f7d5f16b5 100644 --- a/testsuite/testsuite.vcxproj +++ b/testsuite/testsuite.vcxproj @@ -9,22 +9,6 @@ Debug x64 - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - Release Win32 @@ -46,114 +30,56 @@ Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode true - - Application - v110 - Unicode - true - Application v110 Unicode - - Application - v110 - Unicode - Application v110 Unicode - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - true - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ true true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - false - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ false false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ @@ -175,26 +101,6 @@ false - - - Disabled - ../;%(AdditionalIncludeDirectories) - NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - MachineX86 - - Disabled @@ -213,24 +119,6 @@ Console - - - Disabled - ../;%(AdditionalIncludeDirectories) - NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - - MaxSpeed @@ -253,28 +141,6 @@ false - - - MaxSpeed - true - ../;%(AdditionalIncludeDirectories) - NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX86 - - MaxSpeed @@ -296,27 +162,6 @@ true - - - MaxSpeed - true - ../;%(AdditionalIncludeDirectories) - NO_MAIN_DRIVER;WOLFSSL_RIPEMD;WOLFSSL_SHA512;OPENSSL_EXTRA;NO_PSK;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Ws2_32.lib;%(AdditionalDependencies) - true - Console - true - true - - diff --git a/wolfssl.vcxproj b/wolfssl.vcxproj index 8a95297e1..cf057198a 100644 --- a/wolfssl.vcxproj +++ b/wolfssl.vcxproj @@ -9,22 +9,6 @@ Debug x64 - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - Release Win32 @@ -46,104 +30,51 @@ Unicode true - - DynamicLibrary - v110 - Unicode - true - StaticLibrary v110 Unicode true - - DynamicLibrary - v110 - Unicode - true - StaticLibrary v110 Unicode - - DynamicLibrary - v110 - Unicode - StaticLibrary v110 Unicode - - DynamicLibrary - v110 - Unicode - - - - - - - - - - - - - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ + + <_ProjectFileVersion>11.0.61030.0 $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - + + $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\obj\ - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\obj\ + $(Configuration)\ + Disabled @@ -158,26 +89,6 @@ 4206;4214;4706;%(DisableSpecificWarnings) - - - Disabled - ./;%(AdditionalIncludeDirectories) - OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - EditAndContinue - 4206;4214;4706;%(DisableSpecificWarnings) - - - ws2_32.lib;%(AdditionalDependencies) - false - true - - Disabled @@ -192,25 +103,6 @@ 4206;4214;4706;%(DisableSpecificWarnings) - - - Disabled - ./;%(AdditionalIncludeDirectories) - OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - 4206;4214;4706;%(DisableSpecificWarnings) - - - ws2_32.lib;%(AdditionalDependencies) - false - true - - MaxSpeed @@ -224,24 +116,6 @@ ProgramDatabase - - - MaxSpeed - true - ./;%(AdditionalIncludeDirectories) - OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - true - - MaxSpeed @@ -256,24 +130,6 @@ ProgramDatabase - - - MaxSpeed - true - ./;%(AdditionalIncludeDirectories) - OPENSSL_EXTRA;WOLFSSL_RIPEMD;WOLFSSL_SHA512;NO_PSK;BUILDING_WOLFSSL;WOLFSSL_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - true - - @@ -313,20 +169,14 @@ false - false ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj false - false ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - \ No newline at end of file + diff --git a/wolfssl/error-ssl.h b/wolfssl/error-ssl.h index 0df2edb6e..732240382 100644 --- a/wolfssl/error-ssl.h +++ b/wolfssl/error-ssl.h @@ -127,7 +127,6 @@ enum wolfSSL_ErrorCodes { SANITY_MSG_E = -394, /* Sanity check on msg order error */ DUPLICATE_MSG_E = -395, /* Duplicate message error */ SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */ - SOCKET_PEER_CLOSED_E = -397, /* Underlying transport closed */ /* add strings to SetErrorString !!!!! */ diff --git a/wolfssl/version.h b/wolfssl/version.h index c76e07613..54e92ffc0 100644 --- a/wolfssl/version.h +++ b/wolfssl/version.h @@ -26,8 +26,8 @@ extern "C" { #endif -#define LIBWOLFSSL_VERSION_STRING "3.4.8" -#define LIBWOLFSSL_VERSION_HEX 0x03004008 +#define LIBWOLFSSL_VERSION_STRING "3.4.7" +#define LIBWOLFSSL_VERSION_HEX 0x03004007 #ifdef __cplusplus } diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 6e41d238f..05fd4754b 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -47,7 +47,7 @@ #define WOLFSSL_LOCAL __hidden #elif defined(_MSC_VER) #ifdef WOLFSSL_DLL - #define WOLFSSL_API __declspec(dllexport) + #define WOLFSSL_API extern __declspec(dllexport) #else #define WOLFSSL_API #endif @@ -59,7 +59,7 @@ #else /* BUILDING_WOLFSSL */ #if defined(_MSC_VER) #ifdef WOLFSSL_DLL - #define WOLFSSL_API __declspec(dllimport) + #define WOLFSSL_API extern __declspec(dllimport) #else #define WOLFSSL_API #endif diff --git a/wolfssl64.sln b/wolfssl64.sln index 5e17787dc..223ad75da 100644 --- a/wolfssl64.sln +++ b/wolfssl64.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2010 +# Visual Studio Express 2012 for Windows Desktop Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wolfssl", "wolfssl.vcxproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite.vcxproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}" @@ -19,10 +19,6 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection @@ -31,14 +27,6 @@ Global {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|x64.ActiveCfg = Debug|x64 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|x64.Build.0 = Debug|x64 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {73973223-5EE8-41CA-8E88-1D60E89A237B}.DLL Release|x64.Build.0 = DLL Release|x64 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32 {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|x64.ActiveCfg = Release|x64 @@ -47,14 +35,6 @@ Global {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|x64.ActiveCfg = Debug|x64 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|x64.Build.0 = Debug|x64 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.DLL Release|x64.Build.0 = DLL Release|x64 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32 {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|x64.ActiveCfg = Release|x64 @@ -63,10 +43,6 @@ Global {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.Build.0 = Debug|Win32 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|x64.ActiveCfg = Debug|x64 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|x64.Build.0 = Debug|x64 - {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Debug|Win32.ActiveCfg = Debug|Win32 - {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Debug|x64.ActiveCfg = Debug|x64 - {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Release|Win32.ActiveCfg = Release|Win32 - {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.DLL Release|x64.ActiveCfg = Release|x64 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.ActiveCfg = Release|Win32 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.Build.0 = Release|Win32 {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|x64.ActiveCfg = Release|x64 @@ -75,14 +51,6 @@ Global {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|x64.ActiveCfg = Debug|x64 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|x64.Build.0 = Debug|x64 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {07D97C48-E08F-4E34-9F67-3064039FF2CB}.DLL Release|x64.Build.0 = DLL Release|x64 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32 {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|x64.ActiveCfg = Release|x64 @@ -91,14 +59,6 @@ Global {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|x64.ActiveCfg = Debug|x64 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|x64.Build.0 = Debug|x64 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {8362A816-C5DC-4E22-B5C5-9E6806387073}.DLL Release|x64.Build.0 = DLL Release|x64 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32 {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|x64.ActiveCfg = Release|x64 @@ -107,14 +67,6 @@ Global {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32 {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|x64.ActiveCfg = Debug|x64 {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|x64.Build.0 = Debug|x64 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {3ADE9549-582D-4D8E-9826-B172197A7959}.DLL Release|x64.Build.0 = DLL Release|x64 {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32 {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32 {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|x64.ActiveCfg = Release|x64 @@ -123,14 +75,6 @@ Global {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|x64.ActiveCfg = Debug|x64 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|x64.Build.0 = Debug|x64 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.DLL Release|x64.Build.0 = DLL Release|x64 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32 {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|x64.ActiveCfg = Release|x64