This patch fixes - PKCS#1 padding attack - solaris-x86 config problem - cast asm problem - missing sha1 assember perl script - x86 assember code fixes To apply, cd into the SSLeay 0.9.0 directory and run patch -p1 -l < SSLeay-090-090b.patch diff -c -b -B -r -P SSLeay-0.9.0.old/Configure SSLeay-0.9.0/Configure *** SSLeay-0.9.0.old/Configure Thu Apr 9 22:19:33 1998 --- SSLeay-0.9.0/Configure Fri Jun 26 17:29:27 1998 *************** *** 55,61 **** $bits1="THIRTY_TWO_BIT "; $bits2="SIXTY_FOUR_BIT "; ! $x86_sol_asm="asm/bn86-sol.o:asm/dx86-sol.o:asm/yx86-sol.o:asm/bx86-sol.o:asm/mx86-sol.o:asm/sx86-sol.o:asm/cx86-sol.o:asm/rx86-sol.o:asm/rm86-sol.o:asm/r586-sol.o"; $x86_elf_asm="asm/bn86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o"; $x86_out_asm="asm/bn86-out.o:asm/dx86-out.o asm/yx86-out.o:asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o"; $x86_bsdi_asm="asm/bn86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:asm/bx86bsdi.o:asm/mx86bsdi.o:asm/sx86bsdi.o:asm/cx86bsdi.o:asm/rx86bsdi.o:asm/rm86bsdi.o:asm/r586bsdi.o"; --- 55,61 ---- $bits1="THIRTY_TWO_BIT "; $bits2="SIXTY_FOUR_BIT "; ! $x86_sol_asm="asm/bn86-sol.o:asm/dx86-sol.o asm/yx86-sol.o:asm/bx86-sol.o:asm/mx86-sol.o:asm/sx86-sol.o:asm/cx86-sol.o:asm/rx86-sol.o:asm/rm86-sol.o:asm/r586-sol.o"; $x86_elf_asm="asm/bn86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o"; $x86_out_asm="asm/bn86-out.o:asm/dx86-out.o asm/yx86-out.o:asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o"; $x86_bsdi_asm="asm/bn86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:asm/bx86bsdi.o:asm/mx86bsdi.o:asm/sx86bsdi.o:asm/cx86bsdi.o:asm/rx86bsdi.o:asm/rm86bsdi.o:asm/r586bsdi.o"; diff -c -b -B -r -P SSLeay-0.9.0.old/Makefile.ssl SSLeay-0.9.0/Makefile.ssl *** SSLeay-0.9.0.old/Makefile.ssl Fri Jun 26 17:11:50 1998 --- SSLeay-0.9.0/Makefile.ssl Fri Jun 26 17:11:36 1998 *************** *** 1,6 **** # # Makefile for all the SSL related library routines and utilities ! VERSION = 0.9.0 # # make install will install: # libraries into $INSTALLTOP/lib --- 1,6 ---- # # Makefile for all the SSL related library routines and utilities ! VERSION = 0.9.0b # # make install will install: # libraries into $INSTALLTOP/lib diff -c -b -B -r -P SSLeay-0.9.0.old/README SSLeay-0.9.0/README *** SSLeay-0.9.0.old/README Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/README Wed Jun 24 11:16:16 1998 *************** *** 1,4 **** ! SSLeay 0.9.0 10-Apr-1998 Copyright (c) 1997, Eric Young All rights reserved. --- 1,4 ---- ! SSLeay 0.9.0b 29-Jun-1998 Copyright (c) 1997, Eric Young All rights reserved. diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/asn1/asn1_lib.c SSLeay-0.9.0/crypto/asn1/asn1_lib.c *** SSLeay-0.9.0.old/crypto/asn1/asn1_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/asn1/asn1_lib.c Wed Jun 24 11:16:15 1998 *************** *** 69,75 **** static void asn1_put_length(); #endif ! char *ASN1_version="ASN1 part of SSLeay 0.9.0 10-Apr-1998"; int ASN1_check_infinite_end(p,len) unsigned char **p; --- 69,75 ---- static void asn1_put_length(); #endif ! char *ASN1_version="ASN1 part of SSLeay 0.9.0b 29-Jun-1998"; int ASN1_check_infinite_end(p,len) unsigned char **p; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/bf/asm/bx86unix.cpp SSLeay-0.9.0/crypto/bf/asm/bx86unix.cpp *** SSLeay-0.9.0.old/crypto/bf/asm/bx86unix.cpp Thu Apr 9 14:07:21 1998 --- SSLeay-0.9.0/crypto/bf/asm/bx86unix.cpp Wed Jun 24 11:43:19 1998 *************** *** 25,30 **** --- 25,32 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) *************** *** 793,807 **** movl 4(%esi), %edx xorl %ecx, %eax xorl %edx, %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, (%edi) movl %ebx, 4(%edi) addl $8, %esi --- 795,813 ---- movl 4(%esi), %edx xorl %ecx, %eax xorl %edx, %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, (%edi) movl %ebx, 4(%edi) addl $8, %esi *************** *** 836,850 **** .L009ejend: xorl %ecx, %eax xorl %edx, %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, (%edi) movl %ebx, 4(%edi) jmp .L003finish --- 842,860 ---- .L009ejend: xorl %ecx, %eax xorl %edx, %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, (%edi) movl %ebx, 4(%edi) jmp .L003finish *************** *** 857,871 **** .L014decrypt_loop: movl (%esi), %eax movl 4(%esi), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx --- 867,885 ---- .L014decrypt_loop: movl (%esi), %eax movl 4(%esi), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx *************** *** 886,900 **** jz .L003finish movl (%esi), %eax movl 4(%esi), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx --- 900,918 ---- jz .L003finish movl (%esi), %eax movl 4(%esi), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call BF_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/bf/bf_ecb.c SSLeay-0.9.0/crypto/bf/bf_ecb.c *** SSLeay-0.9.0.old/crypto/bf/bf_ecb.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/bf/bf_ecb.c Wed Jun 24 11:16:15 1998 *************** *** 64,70 **** * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993) */ ! char *BF_version="BlowFish part of SSLeay 0.9.0 10-Apr-1998"; char *BF_options() { --- 64,70 ---- * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993) */ ! char *BF_version="BlowFish part of SSLeay 0.9.0b 29-Jun-1998"; char *BF_options() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/bn/asm/bn86unix.cpp SSLeay-0.9.0/crypto/bn/asm/bn86unix.cpp *** SSLeay-0.9.0.old/crypto/bn/asm/bn86unix.cpp Thu Apr 9 14:07:22 1998 --- SSLeay-0.9.0/crypto/bn/asm/bn86unix.cpp Wed Jun 24 11:43:16 1998 *************** *** 27,32 **** --- 27,34 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/bn/bn_lib.c SSLeay-0.9.0/crypto/bn/bn_lib.c *** SSLeay-0.9.0.old/crypto/bn/bn_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/bn/bn_lib.c Wed Jun 24 11:16:15 1998 *************** *** 60,66 **** #include "cryptlib.h" #include "bn_lcl.h" ! char *BN_version="Big Number part of SSLeay 0.9.0 10-Apr-1998"; BIGNUM *BN_value_one() { --- 60,66 ---- #include "cryptlib.h" #include "bn_lcl.h" ! char *BN_version="Big Number part of SSLeay 0.9.0b 29-Jun-1998"; BIGNUM *BN_value_one() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/cast/asm/cx86unix.cpp SSLeay-0.9.0/crypto/cast/asm/cx86unix.cpp *** SSLeay-0.9.0.old/crypto/cast/asm/cx86unix.cpp Thu Apr 9 14:07:22 1998 --- SSLeay-0.9.0/crypto/cast/asm/cx86unix.cpp Wed Jun 24 11:43:20 1998 *************** *** 9,15 **** --- 9,23 ---- #define SIZE(a,b) .size a,b #if defined(OUT) || defined(BSDI) + #define CAST_S_table0 _CAST_S_table0 + #define CAST_S_table1 _CAST_S_table1 + #define CAST_S_table2 _CAST_S_table2 + #define CAST_S_table3 _CAST_S_table3 #define CAST_encrypt _CAST_encrypt + #define CAST_S_table0 _CAST_S_table0 + #define CAST_S_table1 _CAST_S_table1 + #define CAST_S_table2 _CAST_S_table2 + #define CAST_S_table3 _CAST_S_table3 #define CAST_decrypt _CAST_decrypt #define CAST_cbc_encrypt _CAST_cbc_encrypt *************** *** 25,30 **** --- 33,40 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) *************** *** 817,831 **** movl 4(%esi), %edx xorl %ecx, %eax xorl %edx, %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, (%edi) movl %ebx, 4(%edi) addl $8, %esi --- 827,845 ---- movl 4(%esi), %edx xorl %ecx, %eax xorl %edx, %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, (%edi) movl %ebx, 4(%edi) addl $8, %esi *************** *** 862,876 **** .L009ejend: xorl %ecx, %eax xorl %edx, %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, (%edi) movl %ebx, 4(%edi) jmp .L003finish --- 876,894 ---- .L009ejend: xorl %ecx, %eax xorl %edx, %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_encrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, (%edi) movl %ebx, 4(%edi) jmp .L003finish *************** *** 883,897 **** .L014decrypt_loop: movl (%esi), %eax movl 4(%esi), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx --- 901,919 ---- .L014decrypt_loop: movl (%esi), %eax movl 4(%esi), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx *************** *** 912,926 **** jz .L003finish movl (%esi), %eax movl 4(%esi), %ebx ! bswapl %eax ! bswapl %ebx movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! bswapl %eax ! bswapl %ebx movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx --- 934,952 ---- jz .L003finish movl (%esi), %eax movl 4(%esi), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl %eax, 8(%esp) movl %ebx, 12(%esp) call CAST_decrypt movl 8(%esp), %eax movl 12(%esp), %ebx ! .byte 15 ! .byte 200 /* bswapl %eax */ ! .byte 15 ! .byte 203 /* bswapl %ebx */ movl 16(%esp), %ecx movl 20(%esp), %edx xorl %eax, %ecx diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/cast/c_ecb.c SSLeay-0.9.0/crypto/cast/c_ecb.c *** SSLeay-0.9.0.old/crypto/cast/c_ecb.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/cast/c_ecb.c Wed Jun 24 11:16:15 1998 *************** *** 59,65 **** #include "cast.h" #include "cast_lcl.h" ! char *CAST_version="CAST part of SSLeay 0.9.0 10-Apr-1998"; void CAST_ecb_encrypt(in, out, ks, encrypt) unsigned char *in; --- 59,65 ---- #include "cast.h" #include "cast_lcl.h" ! char *CAST_version="CAST part of SSLeay 0.9.0b 29-Jun-1998"; void CAST_ecb_encrypt(in, out, ks, encrypt) unsigned char *in; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/conf/conf.c SSLeay-0.9.0/crypto/conf/conf.c *** SSLeay-0.9.0.old/crypto/conf/conf.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/conf/conf.c Wed Jun 24 11:16:14 1998 *************** *** 95,101 **** #define scan_esc(p) ((*(++p) == '\0')?(p):(++p)) ! char *CONF_version="CONF part of SSLeay 0.9.0 10-Apr-1998"; LHASH *CONF_load(h,file,line) LHASH *h; --- 95,101 ---- #define scan_esc(p) ((*(++p) == '\0')?(p):(++p)) ! char *CONF_version="CONF part of SSLeay 0.9.0b 29-Jun-1998"; LHASH *CONF_load(h,file,line) LHASH *h; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/crypto.h SSLeay-0.9.0/crypto/crypto.h *** SSLeay-0.9.0.old/crypto/crypto.h Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/crypto.h Wed Jun 24 11:16:14 1998 *************** *** 67,73 **** /* This is more to be used to check the correct DLL is being used * in the MS world. */ ! #define SSLEAY_VERSION_NUMBER 0x0900 /* Version 0.5.1c would be 0513 */ #define SSLEAY_VERSION 0 /* #define SSLEAY_OPTIONS 1 no longer supported */ --- 67,73 ---- /* This is more to be used to check the correct DLL is being used * in the MS world. */ ! #define SSLEAY_VERSION_NUMBER 0x0902 /* Version 0.5.1c would be 0513 */ #define SSLEAY_VERSION 0 /* #define SSLEAY_OPTIONS 1 no longer supported */ diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/cversion.c SSLeay-0.9.0/crypto/cversion.c *** SSLeay-0.9.0.old/crypto/cversion.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/cversion.c Wed Jun 24 11:16:16 1998 *************** *** 66,72 **** int t; { if (t == SSLEAY_VERSION) ! return("SSLeay 0.9.0 10-Apr-1998"); if (t == SSLEAY_BUILT_ON) { #ifdef DATE --- 66,72 ---- int t; { if (t == SSLEAY_VERSION) ! return("SSLeay 0.9.0b 29-Jun-1998"); if (t == SSLEAY_BUILT_ON) { #ifdef DATE diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/des/asm/dx86unix.cpp SSLeay-0.9.0/crypto/des/asm/dx86unix.cpp *** SSLeay-0.9.0.old/crypto/des/asm/dx86unix.cpp Thu Apr 9 14:07:22 1998 --- SSLeay-0.9.0/crypto/des/asm/dx86unix.cpp Wed Jun 24 11:43:17 1998 *************** *** 29,34 **** --- 29,36 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/des/asm/yx86unix.cpp SSLeay-0.9.0/crypto/des/asm/yx86unix.cpp *** SSLeay-0.9.0.old/crypto/des/asm/yx86unix.cpp Thu Apr 9 14:07:22 1998 --- SSLeay-0.9.0/crypto/des/asm/yx86unix.cpp Wed Jun 24 11:43:18 1998 *************** *** 24,29 **** --- 24,31 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/des/ecb_enc.c SSLeay-0.9.0/crypto/des/ecb_enc.c *** SSLeay-0.9.0.old/crypto/des/ecb_enc.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/des/ecb_enc.c Wed Jun 24 11:16:14 1998 *************** *** 60,66 **** #include "spr.h" char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; ! char *DES_version="DES part of SSLeay 0.9.0 10-Apr-1998"; char *des_options() { --- 60,66 ---- #include "spr.h" char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; ! char *DES_version="DES part of SSLeay 0.9.0b 29-Jun-1998"; char *des_options() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/dh/dh_lib.c SSLeay-0.9.0/crypto/dh/dh_lib.c *** SSLeay-0.9.0.old/crypto/dh/dh_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/dh/dh_lib.c Wed Jun 24 11:16:15 1998 *************** *** 61,67 **** #include "bn.h" #include "dh.h" ! char *DH_version="Diffie-Hellman part of SSLeay 0.9.0 10-Apr-1998"; DH *DH_new() { --- 61,67 ---- #include "bn.h" #include "dh.h" ! char *DH_version="Diffie-Hellman part of SSLeay 0.9.0b 29-Jun-1998"; DH *DH_new() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/dsa/dsa_lib.c SSLeay-0.9.0/crypto/dsa/dsa_lib.c *** SSLeay-0.9.0.old/crypto/dsa/dsa_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/dsa/dsa_lib.c Wed Jun 24 11:16:15 1998 *************** *** 64,70 **** #include "dsa.h" #include "asn1.h" ! char *DSA_version="\0DSA part of SSLeay 0.9.0 10-Apr-1998"; DSA *DSA_new() { --- 64,70 ---- #include "dsa.h" #include "asn1.h" ! char *DSA_version="\0DSA part of SSLeay 0.9.0b 29-Jun-1998"; DSA *DSA_new() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/evp/evp_enc.c SSLeay-0.9.0/crypto/evp/evp_enc.c *** SSLeay-0.9.0.old/crypto/evp/evp_enc.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/evp/evp_enc.c Wed Jun 24 11:16:16 1998 *************** *** 60,66 **** #include "cryptlib.h" #include "evp.h" ! char *EVP_version="EVP part of SSLeay 0.9.0 10-Apr-1998"; void EVP_CIPHER_CTX_init(ctx) EVP_CIPHER_CTX *ctx; --- 60,66 ---- #include "cryptlib.h" #include "evp.h" ! char *EVP_version="EVP part of SSLeay 0.9.0b 29-Jun-1998"; void EVP_CIPHER_CTX_init(ctx) EVP_CIPHER_CTX *ctx; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/idea/i_ecb.c SSLeay-0.9.0/crypto/idea/i_ecb.c *** SSLeay-0.9.0.old/crypto/idea/i_ecb.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/idea/i_ecb.c Wed Jun 24 11:16:14 1998 *************** *** 59,65 **** #include "idea.h" #include "idea_lcl.h" ! char *IDEA_version="IDEA part of SSLeay 0.9.0 10-Apr-1998"; char *idea_options() { --- 59,65 ---- #include "idea.h" #include "idea_lcl.h" ! char *IDEA_version="IDEA part of SSLeay 0.9.0b 29-Jun-1998"; char *idea_options() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/lhash/lhash.c SSLeay-0.9.0/crypto/lhash/lhash.c *** SSLeay-0.9.0.old/crypto/lhash/lhash.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/lhash/lhash.c Wed Jun 24 11:16:14 1998 *************** *** 56,62 **** * [including the GNU Public Licence.] */ ! char *lh_version="lhash part of SSLeay 0.9.0 10-Apr-1998"; /* Code for dynamic hash table routines * Author - Eric Young v 2.0 --- 56,62 ---- * [including the GNU Public Licence.] */ ! char *lh_version="lhash part of SSLeay 0.9.0b 29-Jun-1998"; /* Code for dynamic hash table routines * Author - Eric Young v 2.0 diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/md2/md2_dgst.c SSLeay-0.9.0/crypto/md2/md2_dgst.c *** SSLeay-0.9.0.old/crypto/md2/md2_dgst.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/md2/md2_dgst.c Wed Jun 24 11:16:14 1998 *************** *** 61,67 **** #include #include "md2.h" ! char *MD2_version="MD2 part of SSLeay 0.9.0 10-Apr-1998"; /* Implemented from RFC1319 The MD2 Message-Digest Algorithm */ --- 61,67 ---- #include #include "md2.h" ! char *MD2_version="MD2 part of SSLeay 0.9.0b 29-Jun-1998"; /* Implemented from RFC1319 The MD2 Message-Digest Algorithm */ diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/md5/asm/mx86unix.cpp SSLeay-0.9.0/crypto/md5/asm/mx86unix.cpp *** SSLeay-0.9.0.old/crypto/md5/asm/mx86unix.cpp Thu Apr 9 14:07:23 1998 --- SSLeay-0.9.0/crypto/md5/asm/mx86unix.cpp Wed Jun 24 11:43:21 1998 *************** *** 23,28 **** --- 23,30 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/md5/md5_dgst.c SSLeay-0.9.0/crypto/md5/md5_dgst.c *** SSLeay-0.9.0.old/crypto/md5/md5_dgst.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/md5/md5_dgst.c Wed Jun 24 11:16:14 1998 *************** *** 59,65 **** #include #include "md5_locl.h" ! char *MD5_version="MD5 part of SSLeay 0.9.0 10-Apr-1998"; /* Implemented from RFC1321 The MD5 Message-Digest Algorithm */ --- 59,65 ---- #include #include "md5_locl.h" ! char *MD5_version="MD5 part of SSLeay 0.9.0b 29-Jun-1998"; /* Implemented from RFC1321 The MD5 Message-Digest Algorithm */ diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/pem/pem_lib.c SSLeay-0.9.0/crypto/pem/pem_lib.c *** SSLeay-0.9.0.old/crypto/pem/pem_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/pem/pem_lib.c Wed Jun 24 11:16:15 1998 *************** *** 68,74 **** #include "des.h" #endif ! char *PEM_version="PEM part of SSLeay 0.9.0 10-Apr-1998"; #define MIN_LENGTH 4 --- 68,74 ---- #include "des.h" #endif ! char *PEM_version="PEM part of SSLeay 0.9.0b 29-Jun-1998"; #define MIN_LENGTH 4 diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/perlasm/x86asm.pl SSLeay-0.9.0/crypto/perlasm/x86asm.pl *** SSLeay-0.9.0.old/crypto/perlasm/x86asm.pl Thu Apr 9 14:07:24 1998 --- SSLeay-0.9.0/crypto/perlasm/x86asm.pl Wed Jun 24 11:43:00 1998 *************** *** 89,94 **** --- 89,96 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/perlasm/x86unix.pl SSLeay-0.9.0/crypto/perlasm/x86unix.pl *** SSLeay-0.9.0.old/crypto/perlasm/x86unix.pl Thu Apr 9 14:07:24 1998 --- SSLeay-0.9.0/crypto/perlasm/x86unix.pl Wed Jun 24 11:43:00 1998 *************** *** 1,5 **** --- 1,11 ---- #!/usr/local/bin/perl + # Because the bswapl instruction is not supported for old assembers + # (it was a new instruction for the 486), I've added .byte xxxx code + # to put it in. + # eric 24-Apr-1998 + # + package x86unix; $label="L000"; *************** *** 190,195 **** --- 196,216 ---- { local($name,$p1)=@_; local($l,$t); + local(%special)=("bswapl",0x0FC8); + + if ((defined($special{$name})) && defined($regs{$p1})) + { + $op=$special{$name}|$reg_val{$p1}; + $tmp1=sprintf(".byte %d\n",($op>>8)&0xff); + $tmp2=sprintf(".byte %d\t",$op &0xff); + push(@out,$tmp1); + push(@out,$tmp2); + + $p2=&conv($p2); + $p1=&conv($p1); + &main'comment("$name $p2 $p1"); + return; + } push(@out,"\t$name\t".&conv($p1)."\n"); } diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rand/md_rand.c SSLeay-0.9.0/crypto/rand/md_rand.c *** SSLeay-0.9.0.old/crypto/rand/md_rand.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/rand/md_rand.c Wed Jun 24 11:16:16 1998 *************** *** 122,128 **** static unsigned char md[MD_DIGEST_LENGTH]; static int md_count=0; ! char *RAND_version="RAND part of SSLeay 0.9.0 10-Apr-1998"; void RAND_cleanup() { --- 122,128 ---- static unsigned char md[MD_DIGEST_LENGTH]; static int md_count=0; ! char *RAND_version="RAND part of SSLeay 0.9.0b 29-Jun-1998"; void RAND_cleanup() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rc2/rc2_ecb.c SSLeay-0.9.0/crypto/rc2/rc2_ecb.c *** SSLeay-0.9.0.old/crypto/rc2/rc2_ecb.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/rc2/rc2_ecb.c Wed Jun 24 11:16:15 1998 *************** *** 59,65 **** #include "rc2.h" #include "rc2_locl.h" ! char *RC2_version="RC2 part of SSLeay 0.9.0 10-Apr-1998"; /* RC2 as implemented frm a posting from * Newsgroups: sci.crypt --- 59,65 ---- #include "rc2.h" #include "rc2_locl.h" ! char *RC2_version="RC2 part of SSLeay 0.9.0b 29-Jun-1998"; /* RC2 as implemented frm a posting from * Newsgroups: sci.crypt diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rc4/asm/rx86unix.cpp SSLeay-0.9.0/crypto/rc4/asm/rx86unix.cpp *** SSLeay-0.9.0.old/crypto/rc4/asm/rx86unix.cpp Thu Apr 9 14:07:24 1998 --- SSLeay-0.9.0/crypto/rc4/asm/rx86unix.cpp Wed Jun 24 11:43:20 1998 *************** *** 23,28 **** --- 23,30 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rc4/rc4_skey.c SSLeay-0.9.0/crypto/rc4/rc4_skey.c *** SSLeay-0.9.0.old/crypto/rc4/rc4_skey.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/rc4/rc4_skey.c Wed Jun 24 11:16:15 1998 *************** *** 59,65 **** #include "rc4.h" #include "rc4_locl.h" ! char *RC4_version="RC4 part of SSLeay 0.9.0 10-Apr-1998"; char *RC4_options() { --- 59,65 ---- #include "rc4.h" #include "rc4_locl.h" ! char *RC4_version="RC4 part of SSLeay 0.9.0b 29-Jun-1998"; char *RC4_options() { diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rc5/asm/r586unix.cpp SSLeay-0.9.0/crypto/rc5/asm/r586unix.cpp *** SSLeay-0.9.0.old/crypto/rc5/asm/r586unix.cpp Thu Apr 9 14:07:25 1998 --- SSLeay-0.9.0/crypto/rc5/asm/r586unix.cpp Wed Jun 24 11:43:24 1998 *************** *** 25,30 **** --- 25,32 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rc5/rc5_ecb.c SSLeay-0.9.0/crypto/rc5/rc5_ecb.c *** SSLeay-0.9.0.old/crypto/rc5/rc5_ecb.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/rc5/rc5_ecb.c Wed Jun 24 11:16:15 1998 *************** *** 59,65 **** #include "rc5.h" #include "rc5_locl.h" ! char *RC5_version="RC5 part of SSLeay 0.9.0 10-Apr-1998"; void RC5_32_ecb_encrypt(in, out, ks, encrypt) unsigned char *in; --- 59,65 ---- #include "rc5.h" #include "rc5_locl.h" ! char *RC5_version="RC5 part of SSLeay 0.9.0b 29-Jun-1998"; void RC5_32_ecb_encrypt(in, out, ks, encrypt) unsigned char *in; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/ripemd/asm/rm86unix.cpp SSLeay-0.9.0/crypto/ripemd/asm/rm86unix.cpp *** SSLeay-0.9.0.old/crypto/ripemd/asm/rm86unix.cpp Thu Apr 9 14:07:25 1998 --- SSLeay-0.9.0/crypto/ripemd/asm/rm86unix.cpp Wed Jun 24 11:43:23 1998 *************** *** 23,28 **** --- 23,30 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/ripemd/rmd_dgst.c SSLeay-0.9.0/crypto/ripemd/rmd_dgst.c *** SSLeay-0.9.0.old/crypto/ripemd/rmd_dgst.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/ripemd/rmd_dgst.c Wed Jun 24 11:16:14 1998 *************** *** 59,65 **** #include #include "rmd_locl.h" ! char *RMD160_version="RIPEMD160 part of SSLeay 0.9.0 10-Apr-1998"; #ifndef NOPROTO # ifdef RMD160_ASM --- 59,65 ---- #include #include "rmd_locl.h" ! char *RMD160_version="RIPEMD160 part of SSLeay 0.9.0b 29-Jun-1998"; #ifndef NOPROTO # ifdef RMD160_ASM diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/rsa/rsa_lib.c SSLeay-0.9.0/crypto/rsa/rsa_lib.c *** SSLeay-0.9.0.old/crypto/rsa/rsa_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/rsa/rsa_lib.c Wed Jun 24 11:16:15 1998 *************** *** 63,69 **** #include "bn.h" #include "rsa.h" ! char *RSA_version="RSA part of SSLeay 0.9.0 10-Apr-1998"; static RSA_METHOD *default_RSA_meth=NULL; static int rsa_meth_num=0; --- 63,69 ---- #include "bn.h" #include "rsa.h" ! char *RSA_version="RSA part of SSLeay 0.9.0b 29-Jun-1998"; static RSA_METHOD *default_RSA_meth=NULL; static int rsa_meth_num=0; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/sha/asm/s1-win32.asm SSLeay-0.9.0/crypto/sha/asm/s1-win32.asm *** SSLeay-0.9.0.old/crypto/sha/asm/s1-win32.asm Thu Apr 9 14:07:25 1998 --- SSLeay-0.9.0/crypto/sha/asm/s1-win32.asm Wed Jun 24 11:43:22 1998 *************** *** 1642,1656 **** mov ecx, DWORD PTR 8[ebp] add ecx, esi mov DWORD PTR [ebp],eax - mov DWORD PTR 8[ebp],ecx mov esi, DWORD PTR 64[esp] ! mov DWORD PTR 16[ebp],edi add esi, 64 mov eax, DWORD PTR 68[esp] ! mov DWORD PTR 4[ebp],ebx cmp eax, esi mov eax, DWORD PTR [esi] ! jge L000start add esp, 72 pop edi pop ebx --- 1642,1658 ---- mov ecx, DWORD PTR 8[ebp] add ecx, esi mov DWORD PTR [ebp],eax mov esi, DWORD PTR 64[esp] ! mov DWORD PTR 8[ebp],ecx add esi, 64 mov eax, DWORD PTR 68[esp] ! mov DWORD PTR 16[ebp],edi cmp eax, esi + mov DWORD PTR 4[ebp],ebx + jl $L001end mov eax, DWORD PTR [esi] ! jmp L000start ! $L001end: add esp, 72 pop edi pop ebx diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/sha/asm/sha1-586.pl SSLeay-0.9.0/crypto/sha/asm/sha1-586.pl *** SSLeay-0.9.0.old/crypto/sha/asm/sha1-586.pl Thu Jan 1 10:00:00 1970 --- SSLeay-0.9.0/crypto/sha/asm/sha1-586.pl Wed Jun 24 11:41:06 1998 *************** *** 0 **** --- 1,491 ---- + #!/usr/local/bin/perl + + $normal=0; + + push(@INC,"perlasm","../../perlasm"); + require "x86asm.pl"; + + &asm_init($ARGV[0],"sha1-586.pl"); + + $A="eax"; + $B="ebx"; + $C="ecx"; + $D="edx"; + $E="edi"; + $T="esi"; + $tmp1="ebp"; + + $off=9*4; + + @K=(0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6); + + &sha1_block("sha1_block_x86"); + + &asm_finish(); + + sub Nn + { + local($p)=@_; + local(%n)=($A,$T,$B,$A,$C,$B,$D,$C,$E,$D,$T,$E); + return($n{$p}); + } + + sub Np + { + local($p)=@_; + local(%n)=($A,$T,$B,$A,$C,$B,$D,$C,$E,$D,$T,$E); + local(%n)=($A,$B,$B,$C,$C,$D,$D,$E,$E,$T,$T,$A); + return($n{$p}); + } + + sub Na + { + local($n)=@_; + return( (($n )&0x0f), + (($n+ 2)&0x0f), + (($n+ 8)&0x0f), + (($n+13)&0x0f), + (($n+ 1)&0x0f)); + } + + sub X_expand + { + local($in)=@_; + + &comment("First, load the words onto the stack in network byte order"); + for ($i=0; $i<16; $i++) + { + &mov("eax",&DWP(($i+0)*4,$in,"",0)) unless $i == 0; + &bswap("eax"); + &mov(&swtmp($i+0),"eax"); + } + + &comment("We now have the X array on the stack"); + &comment("starting at sp-4"); + } + + # Rules of engagement + # F is always trashable at the start, the running total. + # E becomes the next F so it can be trashed after it has been 'accumulated' + # F becomes A in the next round. We don't need to access it much. + # During the X update part, the result ends up in $X[$n0]. + + sub BODY_00_15 + { + local($pos,$K,$X,$n,$a,$b,$c,$d,$e,$f)=@_; + + return if $n & 1; + &comment("00_15 $n"); + + &mov($f,$c); + + &mov($tmp1,$a); + &xor($f,$d); # F2 + + &rotl($tmp1,5); # A2 + + &and($f,$b); # F3 + &add($tmp1,$e); + + &rotr($b,1); # B1 <- F + &mov($e,&swtmp($n)); # G1 + + &rotr($b,1); # B1 <- F + &xor($f,$d); # F4 + + &lea($tmp1,&DWP($K,$tmp1,$e,1)); + + ############################ + # &BODY_40_59( 0,$K[2],$X,42,$A,$B,$C,$D,$E,$T); + # &BODY_40_59( 0,$K[2],$X,43,$T,$A,$B,$C,$D,$E); + $n++; + local($n0,$n1,$n2,$n3,$np)=&Na($n); + ($b,$c,$d,$e,$f,$a)=($a,$b,$c,$d,$e,$f); + + &mov($f,$c); + + &add($a,$tmp1); # MOVED DOWN + &xor($f,$d); # F2 + + &mov($tmp1,$a); + &and($f,$b); # F3 + + &rotl($tmp1,5); # A2 + + &add($tmp1,$e); + &mov($e,&swtmp($n)); # G1 + + &rotr($b,1); # B1 <- F + &xor($f,$d); # F4 + + &rotr($b,1); # B1 <- F + &lea($tmp1,&DWP($K,$tmp1,$e,1)); + + &add($f,$tmp1); + } + + sub BODY_16_19 + { + local($pos,$K,$X,$n,$a,$b,$c,$d,$e,$f)=@_; + local($n0,$n1,$n2,$n3,$np)=&Na($n); + + return if $n & 1; + &comment("16_19 $n"); + + &nop() if ($pos < 0); + &mov($tmp1,&swtmp($n0)); # X1 + &mov($f,&swtmp($n1)); # X2 + &xor($f,$tmp1); # X3 + &mov($tmp1,&swtmp($n2)); # X4 + &xor($f,$tmp1); # X5 + &mov($tmp1,&swtmp($n3)); # X6 + &xor($f,$tmp1); # X7 - slot + &mov($tmp1,$c); # F1 + &rotl($f,1); # X8 - slot + &xor($tmp1,$d); # F2 + &mov(&swtmp($n0),$f); # X9 - anytime + &and($tmp1,$b); # F3 + &lea($f,&DWP($K,$f,$e,1)); # tot=X+K+e + &xor($tmp1,$d); # F4 + &mov($e,$a); # A1 + &add($f,$tmp1); # tot+=F(); + + &rotl($e,5); # A2 + + &rotr($b,1); # B1 <- F + &add($f,$e); # tot+=a + + ############################ + # &BODY_40_59( 0,$K[2],$X,42,$A,$B,$C,$D,$E,$T); + # &BODY_40_59( 0,$K[2],$X,43,$T,$A,$B,$C,$D,$E); + $n++; + local($n0,$n1,$n2,$n3,$np)=&Na($n); + ($b,$c,$d,$e,$f,$a)=($a,$b,$c,$d,$e,$f); + + + &mov($f,&swtmp($n0)); # X1 + &mov($tmp1,&swtmp($n1)); # X2 + &xor($f,$tmp1); # X3 + &mov($tmp1,&swtmp($n2)); # X4 + &xor($f,$tmp1); # X5 + &mov($tmp1,&swtmp($n3)); # X6 + &rotr($c,1); #&rotr($b,1); # B1 <- F # MOVED DOWN + &xor($f,$tmp1); # X7 - slot + &rotl($f,1); # X8 - slot + &mov($tmp1,$c); # F1 + &xor($tmp1,$d); # F2 + &mov(&swtmp($n0),$f); # X9 - anytime + &and($tmp1,$b); # F3 + &lea($f,&DWP($K,$f,$e,1)); # tot=X+K+e + + &xor($tmp1,$d); # F4 + &mov($e,$a); # A1 + + &rotl($e,5); # A2 + + &rotr($b,1); # B1 <- F + &add($f,$e); # tot+=a + + &rotr($b,1); # B1 <- F + &add($f,$tmp1); # tot+=F(); + + } + + sub BODY_20_39 + { + local($pos,$K,$X,$n,$a,$b,$c,$d,$e,$f)=@_; + + &comment("20_39 $n"); + local($n0,$n1,$n2,$n3,$np)=&Na($n); + + &mov($f,&swtmp($n0)); # X1 + &mov($tmp1,&swtmp($n1)); # X2 + &xor($f,$tmp1); # X3 + &mov($tmp1,&swtmp($n2)); # X4 + &xor($f,$tmp1); # X5 + &mov($tmp1,&swtmp($n3)); # X6 + &xor($f,$tmp1); # X7 - slot + &mov($tmp1,$b); # F1 + &rotl($f,1); # X8 - slot + &xor($tmp1,$c); # F2 + &mov(&swtmp($n0),$f); # X9 - anytime + &xor($tmp1,$d); # F3 + + &lea($f,&DWP($K,$f,$e,1)); # tot=X+K+e + &mov($e,$a); # A1 + + &rotl($e,5); # A2 + + if ($n != 79) # last loop + { + &rotr($b,1); # B1 <- F + &add($e,$tmp1); # tmp1=F()+a + + &rotr($b,1); # B2 <- F + &add($f,$e); # tot+=tmp1; + } + else + { + &add($e,$tmp1); # tmp1=F()+a + &mov($tmp1,&wparam(0)); + + &rotr($b,1); # B1 <- F + &add($f,$e); # tot+=tmp1; + + &rotr($b,1); # B2 <- F + } + } + + sub BODY_40_59 + { + local($pos,$K,$X,$n,$a,$b,$c,$d,$e,$f)=@_; + + &comment("40_59 $n"); + return if $n & 1; + local($n0,$n1,$n2,$n3,$np)=&Na($n); + + &mov($f,&swtmp($n0)); # X1 + &mov($tmp1,&swtmp($n1)); # X2 + &xor($f,$tmp1); # X3 + &mov($tmp1,&swtmp($n2)); # X4 + &xor($f,$tmp1); # X5 + &mov($tmp1,&swtmp($n3)); # X6 + &xor($f,$tmp1); # X7 - slot + &mov($tmp1,$b); # F1 + &rotl($f,1); # X8 - slot + &or($tmp1,$c); # F2 + &mov(&swtmp($n0),$f); # X9 - anytime + &and($tmp1,$d); # F3 + + &lea($f,&DWP($K,$f,$e,1)); # tot=X+K+e + &mov($e,$b); # F4 + + &rotr($b,1); # B1 <- F + &and($e,$c); # F5 + + &or($tmp1,$e); # F6 + &mov($e,$a); # A1 + + &rotl($e,5); # A2 + + &add($tmp1,$e); # tmp1=F()+a + + ############################ + # &BODY_40_59( 0,$K[2],$X,42,$A,$B,$C,$D,$E,$T); + # &BODY_40_59( 0,$K[2],$X,43,$T,$A,$B,$C,$D,$E); + $n++; + local($n0,$n1,$n2,$n3,$np)=&Na($n); + ($b,$c,$d,$e,$f,$a)=($a,$b,$c,$d,$e,$f); + + &mov($f,&swtmp($n0)); # X1 + &add($a,$tmp1); # tot+=tmp1; # moved was add f,tmp1 + &mov($tmp1,&swtmp($n1)); # X2 + &xor($f,$tmp1); # X3 + &mov($tmp1,&swtmp($n2)); # X4 + &xor($f,$tmp1); # X5 + &mov($tmp1,&swtmp($n3)); # X6 + &rotr($c,1); # B2 <- F # moved was rotr b,1 + &xor($f,$tmp1); # X7 - slot + &rotl($f,1); # X8 - slot + &mov($tmp1,$b); # F1 + &mov(&swtmp($n0),$f); # X9 - anytime + &or($tmp1,$c); # F2 + &lea($f,&DWP($K,$f,$e,1)); # tot=X+K+e + &mov($e,$b); # F4 + &and($tmp1,$d); # F3 + &and($e,$c); # F5 + + &or($tmp1,$e); # F6 + &mov($e,$a); # A1 + + &rotl($e,5); # A2 + + &rotr($b,1); # B1 <- F + &add($tmp1,$e); # tmp1=F()+a + + &rotr($b,1); # B2 <- F + &add($f,$tmp1); # tot+=tmp1; + } + + sub BODY_60_79 + { + &BODY_20_39(@_); + } + + sub sha1_block + { + local($name)=@_; + + &function_begin_B($name,""); + + # parameter 1 is the MD5_CTX structure. + # A 0 + # B 4 + # C 8 + # D 12 + # E 16 + + &push("esi"); + &push("ebp"); + &mov("eax", &wparam(2)); + &mov("esi", &wparam(1)); + &add("eax", "esi"); # offset to leave on + &mov("ebp", &wparam(0)); + &push("ebx"); + &sub("eax", 64); + &push("edi"); + &mov($B, &DWP( 4,"ebp","",0)); + &stack_push(18); + &mov($D, &DWP(12,"ebp","",0)); + &mov($E, &DWP(16,"ebp","",0)); + &mov($C, &DWP( 8,"ebp","",0)); + &mov(&swtmp(17),"eax"); + + &comment("First we need to setup the X array"); + &mov("eax",&DWP(0,"esi","",0)); # pulled out of X_expand + + &set_label("start") unless $normal; + + &X_expand("esi"); + &mov(&swtmp(16),"esi"); + + &comment(""); + &comment("Start processing"); + + # odd start + &mov($A, &DWP( 0,"ebp","",0)); + $X="esp"; + &BODY_00_15(-2,$K[0],$X, 0,$A,$B,$C,$D,$E,$T); + &BODY_00_15( 0,$K[0],$X, 1,$T,$A,$B,$C,$D,$E); + &BODY_00_15( 0,$K[0],$X, 2,$E,$T,$A,$B,$C,$D); + &BODY_00_15( 0,$K[0],$X, 3,$D,$E,$T,$A,$B,$C); + &BODY_00_15( 0,$K[0],$X, 4,$C,$D,$E,$T,$A,$B); + &BODY_00_15( 0,$K[0],$X, 5,$B,$C,$D,$E,$T,$A); + &BODY_00_15( 0,$K[0],$X, 6,$A,$B,$C,$D,$E,$T); + &BODY_00_15( 0,$K[0],$X, 7,$T,$A,$B,$C,$D,$E); + &BODY_00_15( 0,$K[0],$X, 8,$E,$T,$A,$B,$C,$D); + &BODY_00_15( 0,$K[0],$X, 9,$D,$E,$T,$A,$B,$C); + &BODY_00_15( 0,$K[0],$X,10,$C,$D,$E,$T,$A,$B); + &BODY_00_15( 0,$K[0],$X,11,$B,$C,$D,$E,$T,$A); + &BODY_00_15( 0,$K[0],$X,12,$A,$B,$C,$D,$E,$T); + &BODY_00_15( 0,$K[0],$X,13,$T,$A,$B,$C,$D,$E); + &BODY_00_15( 0,$K[0],$X,14,$E,$T,$A,$B,$C,$D); + &BODY_00_15( 1,$K[0],$X,15,$D,$E,$T,$A,$B,$C); + &BODY_16_19(-1,$K[0],$X,16,$C,$D,$E,$T,$A,$B); + &BODY_16_19( 0,$K[0],$X,17,$B,$C,$D,$E,$T,$A); + &BODY_16_19( 0,$K[0],$X,18,$A,$B,$C,$D,$E,$T); + &BODY_16_19( 1,$K[0],$X,19,$T,$A,$B,$C,$D,$E); + + &BODY_20_39(-1,$K[1],$X,20,$E,$T,$A,$B,$C,$D); + &BODY_20_39( 0,$K[1],$X,21,$D,$E,$T,$A,$B,$C); + &BODY_20_39( 0,$K[1],$X,22,$C,$D,$E,$T,$A,$B); + &BODY_20_39( 0,$K[1],$X,23,$B,$C,$D,$E,$T,$A); + &BODY_20_39( 0,$K[1],$X,24,$A,$B,$C,$D,$E,$T); + &BODY_20_39( 0,$K[1],$X,25,$T,$A,$B,$C,$D,$E); + &BODY_20_39( 0,$K[1],$X,26,$E,$T,$A,$B,$C,$D); + &BODY_20_39( 0,$K[1],$X,27,$D,$E,$T,$A,$B,$C); + &BODY_20_39( 0,$K[1],$X,28,$C,$D,$E,$T,$A,$B); + &BODY_20_39( 0,$K[1],$X,29,$B,$C,$D,$E,$T,$A); + &BODY_20_39( 0,$K[1],$X,30,$A,$B,$C,$D,$E,$T); + &BODY_20_39( 0,$K[1],$X,31,$T,$A,$B,$C,$D,$E); + &BODY_20_39( 0,$K[1],$X,32,$E,$T,$A,$B,$C,$D); + &BODY_20_39( 0,$K[1],$X,33,$D,$E,$T,$A,$B,$C); + &BODY_20_39( 0,$K[1],$X,34,$C,$D,$E,$T,$A,$B); + &BODY_20_39( 0,$K[1],$X,35,$B,$C,$D,$E,$T,$A); + &BODY_20_39( 0,$K[1],$X,36,$A,$B,$C,$D,$E,$T); + &BODY_20_39( 0,$K[1],$X,37,$T,$A,$B,$C,$D,$E); + &BODY_20_39( 0,$K[1],$X,38,$E,$T,$A,$B,$C,$D); + &BODY_20_39( 1,$K[1],$X,39,$D,$E,$T,$A,$B,$C); + + &BODY_40_59(-1,$K[2],$X,40,$C,$D,$E,$T,$A,$B); + &BODY_40_59( 0,$K[2],$X,41,$B,$C,$D,$E,$T,$A); + &BODY_40_59( 0,$K[2],$X,42,$A,$B,$C,$D,$E,$T); + &BODY_40_59( 0,$K[2],$X,43,$T,$A,$B,$C,$D,$E); + &BODY_40_59( 0,$K[2],$X,44,$E,$T,$A,$B,$C,$D); + &BODY_40_59( 0,$K[2],$X,45,$D,$E,$T,$A,$B,$C); + &BODY_40_59( 0,$K[2],$X,46,$C,$D,$E,$T,$A,$B); + &BODY_40_59( 0,$K[2],$X,47,$B,$C,$D,$E,$T,$A); + &BODY_40_59( 0,$K[2],$X,48,$A,$B,$C,$D,$E,$T); + &BODY_40_59( 0,$K[2],$X,49,$T,$A,$B,$C,$D,$E); + &BODY_40_59( 0,$K[2],$X,50,$E,$T,$A,$B,$C,$D); + &BODY_40_59( 0,$K[2],$X,51,$D,$E,$T,$A,$B,$C); + &BODY_40_59( 0,$K[2],$X,52,$C,$D,$E,$T,$A,$B); + &BODY_40_59( 0,$K[2],$X,53,$B,$C,$D,$E,$T,$A); + &BODY_40_59( 0,$K[2],$X,54,$A,$B,$C,$D,$E,$T); + &BODY_40_59( 0,$K[2],$X,55,$T,$A,$B,$C,$D,$E); + &BODY_40_59( 0,$K[2],$X,56,$E,$T,$A,$B,$C,$D); + &BODY_40_59( 0,$K[2],$X,57,$D,$E,$T,$A,$B,$C); + &BODY_40_59( 0,$K[2],$X,58,$C,$D,$E,$T,$A,$B); + &BODY_40_59( 1,$K[2],$X,59,$B,$C,$D,$E,$T,$A); + + &BODY_60_79(-1,$K[3],$X,60,$A,$B,$C,$D,$E,$T); + &BODY_60_79( 0,$K[3],$X,61,$T,$A,$B,$C,$D,$E); + &BODY_60_79( 0,$K[3],$X,62,$E,$T,$A,$B,$C,$D); + &BODY_60_79( 0,$K[3],$X,63,$D,$E,$T,$A,$B,$C); + &BODY_60_79( 0,$K[3],$X,64,$C,$D,$E,$T,$A,$B); + &BODY_60_79( 0,$K[3],$X,65,$B,$C,$D,$E,$T,$A); + &BODY_60_79( 0,$K[3],$X,66,$A,$B,$C,$D,$E,$T); + &BODY_60_79( 0,$K[3],$X,67,$T,$A,$B,$C,$D,$E); + &BODY_60_79( 0,$K[3],$X,68,$E,$T,$A,$B,$C,$D); + &BODY_60_79( 0,$K[3],$X,69,$D,$E,$T,$A,$B,$C); + &BODY_60_79( 0,$K[3],$X,70,$C,$D,$E,$T,$A,$B); + &BODY_60_79( 0,$K[3],$X,71,$B,$C,$D,$E,$T,$A); + &BODY_60_79( 0,$K[3],$X,72,$A,$B,$C,$D,$E,$T); + &BODY_60_79( 0,$K[3],$X,73,$T,$A,$B,$C,$D,$E); + &BODY_60_79( 0,$K[3],$X,74,$E,$T,$A,$B,$C,$D); + &BODY_60_79( 0,$K[3],$X,75,$D,$E,$T,$A,$B,$C); + &BODY_60_79( 0,$K[3],$X,76,$C,$D,$E,$T,$A,$B); + &BODY_60_79( 0,$K[3],$X,77,$B,$C,$D,$E,$T,$A); + &BODY_60_79( 0,$K[3],$X,78,$A,$B,$C,$D,$E,$T); + &BODY_60_79( 2,$K[3],$X,79,$T,$A,$B,$C,$D,$E); + + &comment("End processing"); + &comment(""); + # D is the tmp value + + # E -> A + # T -> B + # A -> C + # B -> D + # C -> E + # D -> T + + # The last 2 have been moved into the last loop + # &mov($tmp1,&wparam(0)); + + &mov($D, &DWP(12,$tmp1,"",0)); + &add($D,$B); + &mov($B, &DWP( 4,$tmp1,"",0)); + &add($B,$T); + &mov($T, $A); + &mov($A, &DWP( 0,$tmp1,"",0)); + &mov(&DWP(12,$tmp1,"",0),$D); + + &add($A,$E); + &mov($E, &DWP(16,$tmp1,"",0)); + &add($E,$C); + &mov($C, &DWP( 8,$tmp1,"",0)); + &add($C,$T); + + &mov(&DWP( 0,$tmp1,"",0),$A); + &mov("esi",&swtmp(16)); + &mov(&DWP( 8,$tmp1,"",0),$C); # This is for looping + &add("esi",64); + &mov("eax",&swtmp(17)); + &mov(&DWP(16,$tmp1,"",0),$E); + &cmp("eax","esi"); + &mov(&DWP( 4,$tmp1,"",0),$B); # This is for looping + &jl(&label("end")); + &mov("eax",&DWP(0,"esi","",0)); # Pulled down from + &jmp(&label("start")); + + &set_label("end"); + &stack_pop(18); + &pop("edi"); + &pop("ebx"); + &pop("ebp"); + &pop("esi"); + &ret(); + &function_end_B($name); + } + diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/sha/asm/sx86unix.cpp SSLeay-0.9.0/crypto/sha/asm/sx86unix.cpp *** SSLeay-0.9.0.old/crypto/sha/asm/sx86unix.cpp Thu Apr 9 14:07:25 1998 --- SSLeay-0.9.0/crypto/sha/asm/sx86unix.cpp Wed Jun 24 11:43:22 1998 *************** *** 23,28 **** --- 23,30 ---- #define ALIGN 4 #undef SIZE #undef TYPE + #define SIZE(a,b) + #define TYPE(a,b) #endif #if defined(ELF) || defined(SOL) *************** *** 72,123 **** movl (%esi), %eax .L000start: /* First, load the words onto the stack in network byte order */ ! bswapl %eax movl %eax, (%esp) movl 4(%esi), %eax ! bswapl %eax movl %eax, 4(%esp) movl 8(%esi), %eax ! bswapl %eax movl %eax, 8(%esp) movl 12(%esi), %eax ! bswapl %eax movl %eax, 12(%esp) movl 16(%esi), %eax ! bswapl %eax movl %eax, 16(%esp) movl 20(%esi), %eax ! bswapl %eax movl %eax, 20(%esp) movl 24(%esi), %eax ! bswapl %eax movl %eax, 24(%esp) movl 28(%esi), %eax ! bswapl %eax movl %eax, 28(%esp) movl 32(%esi), %eax ! bswapl %eax movl %eax, 32(%esp) movl 36(%esi), %eax ! bswapl %eax movl %eax, 36(%esp) movl 40(%esi), %eax ! bswapl %eax movl %eax, 40(%esp) movl 44(%esi), %eax ! bswapl %eax movl %eax, 44(%esp) movl 48(%esi), %eax ! bswapl %eax movl %eax, 48(%esp) movl 52(%esi), %eax ! bswapl %eax movl %eax, 52(%esp) movl 56(%esi), %eax ! bswapl %eax movl %eax, 56(%esp) movl 60(%esi), %eax ! bswapl %eax movl %eax, 60(%esp) /* We now have the X array on the stack */ /* starting at sp-4 */ --- 74,141 ---- movl (%esi), %eax .L000start: /* First, load the words onto the stack in network byte order */ ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, (%esp) movl 4(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 4(%esp) movl 8(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 8(%esp) movl 12(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 12(%esp) movl 16(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 16(%esp) movl 20(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 20(%esp) movl 24(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 24(%esp) movl 28(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 28(%esp) movl 32(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 32(%esp) movl 36(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 36(%esp) movl 40(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 40(%esp) movl 44(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 44(%esp) movl 48(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 48(%esp) movl 52(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 52(%esp) movl 56(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 56(%esp) movl 60(%esi), %eax ! .byte 15 ! .byte 200 /* bswapl %eax */ movl %eax, 60(%esp) /* We now have the X array on the stack */ /* starting at sp-4 */ *************** *** 1908,1922 **** movl 8(%ebp), %ecx addl %esi, %ecx movl %eax, (%ebp) - movl %ecx, 8(%ebp) movl 64(%esp), %esi ! movl %edi, 16(%ebp) addl $64, %esi movl 68(%esp), %eax ! movl %ebx, 4(%ebp) cmpl %esi, %eax movl (%esi), %eax ! jge .L000start addl $72, %esp popl %edi popl %ebx --- 1926,1942 ---- movl 8(%ebp), %ecx addl %esi, %ecx movl %eax, (%ebp) movl 64(%esp), %esi ! movl %ecx, 8(%ebp) addl $64, %esi movl 68(%esp), %eax ! movl %edi, 16(%ebp) cmpl %esi, %eax + movl %ebx, 4(%ebp) + jl .L001end movl (%esi), %eax ! jmp .L000start ! .L001end: addl $72, %esp popl %edi popl %ebx diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/sha/sha1dgst.c SSLeay-0.9.0/crypto/sha/sha1dgst.c *** SSLeay-0.9.0.old/crypto/sha/sha1dgst.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/sha/sha1dgst.c Wed Jun 24 11:16:15 1998 *************** *** 63,69 **** #include "sha.h" #include "sha_locl.h" ! char *SHA1_version="SHA1 part of SSLeay 0.9.0 10-Apr-1998"; /* Implemented from SHA-1 document - The Secure Hash Algorithm */ --- 63,69 ---- #include "sha.h" #include "sha_locl.h" ! char *SHA1_version="SHA1 part of SSLeay 0.9.0b 29-Jun-1998"; /* Implemented from SHA-1 document - The Secure Hash Algorithm */ diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/sha/sha_dgst.c SSLeay-0.9.0/crypto/sha/sha_dgst.c *** SSLeay-0.9.0.old/crypto/sha/sha_dgst.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/sha/sha_dgst.c Wed Jun 24 11:16:15 1998 *************** *** 63,69 **** #include "sha.h" #include "sha_locl.h" ! char *SHA_version="SHA part of SSLeay 0.9.0 10-Apr-1998"; /* Implemented from SHA-0 document - The Secure Hash Algorithm */ --- 63,69 ---- #include "sha.h" #include "sha_locl.h" ! char *SHA_version="SHA part of SSLeay 0.9.0b 29-Jun-1998"; /* Implemented from SHA-0 document - The Secure Hash Algorithm */ diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/stack/stack.c SSLeay-0.9.0/crypto/stack/stack.c *** SSLeay-0.9.0.old/crypto/stack/stack.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/stack/stack.c Wed Jun 24 11:16:16 1998 *************** *** 72,78 **** #undef MIN_NODES #define MIN_NODES 4 ! char *STACK_version="STACK part of SSLeay 0.9.0 10-Apr-1998"; #ifndef NOPROTO #define FP_ICC (int (*)(const void *,const void *)) --- 72,78 ---- #undef MIN_NODES #define MIN_NODES 4 ! char *STACK_version="STACK part of SSLeay 0.9.0b 29-Jun-1998"; #ifndef NOPROTO #define FP_ICC (int (*)(const void *,const void *)) diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/txt_db/txt_db.c SSLeay-0.9.0/crypto/txt_db/txt_db.c *** SSLeay-0.9.0.old/crypto/txt_db/txt_db.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/txt_db/txt_db.c Wed Jun 24 11:16:16 1998 *************** *** 66,72 **** #undef BUFSIZE #define BUFSIZE 512 ! char *TXT_DB_version="TXT_DB part of SSLeay 0.9.0 10-Apr-1998"; TXT_DB *TXT_DB_read(in,num) BIO *in; --- 66,72 ---- #undef BUFSIZE #define BUFSIZE 512 ! char *TXT_DB_version="TXT_DB part of SSLeay 0.9.0b 29-Jun-1998"; TXT_DB *TXT_DB_read(in,num) BIO *in; diff -c -b -B -r -P SSLeay-0.9.0.old/crypto/x509/x509_vfy.c SSLeay-0.9.0/crypto/x509/x509_vfy.c *** SSLeay-0.9.0.old/crypto/x509/x509_vfy.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/crypto/x509/x509_vfy.c Wed Jun 24 11:16:15 1998 *************** *** 80,86 **** static int internal_verify(); #endif ! char *X509_version="X509 part of SSLeay 0.9.0 10-Apr-1998"; static STACK *x509_store_ctx_method=NULL; static int x509_store_ctx_num=0; #if 0 --- 80,86 ---- static int internal_verify(); #endif ! char *X509_version="X509 part of SSLeay 0.9.0b 29-Jun-1998"; static STACK *x509_store_ctx_method=NULL; static int x509_store_ctx_num=0; #if 0 diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/s2_lib.c SSLeay-0.9.0/ssl/s2_lib.c *** SSLeay-0.9.0.old/ssl/s2_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/ssl/s2_lib.c Wed Jun 24 11:16:16 1998 *************** *** 69,75 **** static long ssl2_default_timeout(); #endif ! char *ssl2_version_str="SSLv2 part of SSLeay 0.9.0 10-Apr-1998"; #define SSL2_NUM_CIPHERS (sizeof(ssl2_ciphers)/sizeof(SSL_CIPHER)) --- 69,75 ---- static long ssl2_default_timeout(); #endif ! char *ssl2_version_str="SSLv2 part of SSLeay 0.9.0b 29-Jun-1998"; #define SSL2_NUM_CIPHERS (sizeof(ssl2_ciphers)/sizeof(SSL_CIPHER)) diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/s2_srvr.c SSLeay-0.9.0/ssl/s2_srvr.c *** SSLeay-0.9.0.old/ssl/s2_srvr.c Thu Apr 9 21:59:28 1998 --- SSLeay-0.9.0/ssl/s2_srvr.c Fri Jun 26 11:52:51 1998 *************** *** 306,318 **** if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1); goto end; ! BREAK; default: SSLerr(SSL_F_SSL2_ACCEPT,SSL_R_UNKNOWN_STATE); ret= -1; goto end; ! BREAK; } if ((cb != NULL) && (s->state != state)) --- 306,318 ---- if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1); goto end; ! /* BREAK; */ default: SSLerr(SSL_F_SSL2_ACCEPT,SSL_R_UNKNOWN_STATE); ret= -1; goto end; ! /* BREAK; */ } if ((cb != NULL) && (s->state != state)) *************** *** 415,420 **** --- 415,435 ---- ek=5; /* bad decrypt */ + #if 1 + /* If a bad decrypt, continue with protocol but with a + * dud master secret */ + if ((i < 0) || + ((!export && (i != EVP_CIPHER_key_length(c))) + || ( export && ((i != ek) || (s->s2->tmp.clear+i != + EVP_CIPHER_key_length(c)))))) + { + if (export) + i=ek; + else + i=EVP_CIPHER_key_length(c); + RAND_bytes(p,i); + } + #else if (i < 0) { error=1; *************** *** 433,438 **** --- 448,454 ---- ssl2_return_error(s,SSL2_PE_UNDEFINED_ERROR); return(-1); } + #endif if (export) i+=s->s2->tmp.clear; s->session->master_key_length=i; diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/s3_lib.c SSLeay-0.9.0/ssl/s3_lib.c *** SSLeay-0.9.0.old/ssl/s3_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/ssl/s3_lib.c Wed Jun 24 11:16:16 1998 *************** *** 60,66 **** #include "objects.h" #include "ssl_locl.h" ! char *ssl3_version_str="SSLv3 part of SSLeay 0.9.0 10-Apr-1998"; #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER)) --- 60,66 ---- #include "objects.h" #include "ssl_locl.h" ! char *ssl3_version_str="SSLv3 part of SSLeay 0.9.0b 29-Jun-1998"; #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER)) diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/s3_srvr.c SSLeay-0.9.0/ssl/s3_srvr.c *** SSLeay-0.9.0.old/ssl/s3_srvr.c Thu Apr 9 21:59:28 1998 --- SSLeay-0.9.0/ssl/s3_srvr.c Fri Jun 26 11:53:43 1998 *************** *** 250,256 **** s->state=SSL_ST_OK; ret=1; goto end; ! break; case SSL3_ST_SR_CLNT_HELLO_A: case SSL3_ST_SR_CLNT_HELLO_B: --- 250,256 ---- s->state=SSL_ST_OK; ret=1; goto end; ! /* break; */ case SSL3_ST_SR_CLNT_HELLO_A: case SSL3_ST_SR_CLNT_HELLO_B: *************** *** 499,511 **** if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1); goto end; ! break; default: SSLerr(SSL_F_SSL3_ACCEPT,SSL_R_UNKNOWN_STATE); ret= -1; goto end; ! break; } if (!s->s3->tmp.reuse_message && !skip) --- 499,511 ---- if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1); goto end; ! /* break; */ default: SSLerr(SSL_F_SSL3_ACCEPT,SSL_R_UNKNOWN_STATE); ret= -1; goto end; ! /* break; */ } if (!s->s3->tmp.reuse_message && !skip) *************** *** 1258,1263 **** --- 1258,1275 ---- i=RSA_private_decrypt((int)n,p,p,rsa,RSA_PKCS1_PADDING); + #if 1 + /* If a bad decrypt, use a dud master key */ + if ((i != SSL_MAX_MASTER_KEY_LENGTH) || + ((p[0] != (s->version>>8)) || + (p[1] != (s->version & 0xff)))) + { + p[0]=(s->version>>8); + p[1]=(s->version & 0xff); + RAND_bytes(&(p[2]),SSL_MAX_MASTER_KEY_LENGTH-2); + i=SSL_MAX_MASTER_KEY_LENGTH; + } + #else if (i != SSL_MAX_MASTER_KEY_LENGTH) { al=SSL_AD_DECODE_ERROR; *************** *** 1271,1276 **** --- 1283,1289 ---- SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER); goto f_err; } + #endif s->session->master_key_length= s->method->ssl3_enc->generate_master_secret(s, *************** *** 1351,1357 **** return(1); f_err: ssl3_send_alert(s,SSL3_AL_FATAL,al); ! #ifndef NO_DH err: #endif return(-1); --- 1364,1370 ---- return(1); f_err: ssl3_send_alert(s,SSL3_AL_FATAL,al); ! #if !defined(NO_DH) || !defined(NO_RSA) err: #endif return(-1); diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/ssl.h SSLeay-0.9.0/ssl/ssl.h *** SSLeay-0.9.0.old/ssl/ssl.h Thu Apr 9 23:21:57 1998 --- SSLeay-0.9.0/ssl/ssl.h Thu Jun 25 12:58:31 1998 *************** *** 262,267 **** --- 262,268 ---- #define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L #define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L #define SSL_OP_TLS_D5_BUG 0x00000100L + #define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L /* If set, only use tmp_dh parameters once */ #define SSL_OP_SINGLE_DH_USE 0x00100000L diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/ssl3.h SSLeay-0.9.0/ssl/ssl3.h *** SSLeay-0.9.0.old/ssl/ssl3.h Thu Apr 9 21:59:28 1998 --- SSLeay-0.9.0/ssl/ssl3.h Thu Jun 25 12:59:35 1998 *************** *** 236,241 **** --- 236,242 ---- #define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 #define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002 #define SSL3_FLAGS_POP_BUFFER 0x0004 + #define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 #if 0 #define AD_CLOSE_NOTIFY 0 diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/ssl_lib.c SSLeay-0.9.0/ssl/ssl_lib.c *** SSLeay-0.9.0.old/ssl/ssl_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/ssl/ssl_lib.c Wed Jun 24 11:16:16 1998 *************** *** 61,67 **** #include "lhash.h" #include "ssl_locl.h" ! char *SSL_version_str="SSLeay 0.9.0 10-Apr-1998"; static STACK *ssl_meth=NULL; static STACK *ssl_ctx_meth=NULL; --- 61,67 ---- #include "lhash.h" #include "ssl_locl.h" ! char *SSL_version_str="SSLeay 0.9.0b 29-Jun-1998"; static STACK *ssl_meth=NULL; static STACK *ssl_ctx_meth=NULL; diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/t1_enc.c SSLeay-0.9.0/ssl/t1_enc.c *** SSLeay-0.9.0.old/ssl/t1_enc.c Thu Apr 9 21:59:28 1998 --- SSLeay-0.9.0/ssl/t1_enc.c Thu Jun 25 12:59:59 1998 *************** *** 372,378 **** SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; unsigned long l; ! int bs,i,j,k,n=0; EVP_CIPHER *enc; SSL_COMPRESSION *comp; --- 372,378 ---- SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; unsigned long l; ! int bs,i,ii,j,k,n=0; EVP_CIPHER *enc; SSL_COMPRESSION *comp; *************** *** 416,430 **** l=rec->length; bs=EVP_CIPHER_block_size(ds->cipher); - /* This should be using (bs-1) and bs instead of 7 and 8 */ if ((bs != 1) && send) { i=bs-((int)l%bs); /* Add weird padding of upto 256 bytes */ ! /* we need to add 'i-1' padding bytes */ j=i-1; for (k=(int)l; k<(int)(l+i); k++) rec->input[k]=j; l+=i; --- 416,434 ---- l=rec->length; bs=EVP_CIPHER_block_size(ds->cipher); if ((bs != 1) && send) { i=bs-((int)l%bs); /* Add weird padding of upto 256 bytes */ ! /* we need to add 'i' padding bytes of value j */ j=i-1; + if (s->options & SSL_OP_TLS_BLOCK_PADDING_BUG) + { + if (s->s3->flags & TLS1_FLAGS_TLS_PADDING_BUG) + j++; + } for (k=(int)l; k<(int)(l+i); k++) rec->input[k]=j; l+=i; *************** *** 435,457 **** if ((bs != 1) && !send) { ! i=rec->data[l-1]; ! if ((i+1) > (int)rec->length) { SSLerr(SSL_F_TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); return(0); } ! for (j=(int)(l-1-i); j<(int)l; j++) { ! if (rec->data[j] != i) { SSLerr(SSL_F_TLS1_ENC,SSL_R_DECRYPTION_FAILED); ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); return(0); } } ! rec->length-=(i+1); } } return(1); --- 439,471 ---- if ((bs != 1) && !send) { ! ii=i=rec->data[l-1]; ! i++; ! if (s->options&SSL_OP_TLS_BLOCK_PADDING_BUG) ! { ! /* First packet is even in size, so check */ ! if ((memcmp(s->s3->read_sequence, ! "\0\0\0\0\0\0\0\0",8) == 0) && !(ii & 1)) ! s->s3->flags|=TLS1_FLAGS_TLS_PADDING_BUG; ! if (s->s3->flags & TLS1_FLAGS_TLS_PADDING_BUG) ! i--; ! } ! if (i > (int)rec->length) { SSLerr(SSL_F_TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); return(0); } ! for (j=(int)(l-i); j<(int)l; j++) { ! if (rec->data[j] != ii) { SSLerr(SSL_F_TLS1_ENC,SSL_R_DECRYPTION_FAILED); ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); return(0); } } ! rec->length-=i; } } return(1); diff -c -b -B -r -P SSLeay-0.9.0.old/ssl/t1_lib.c SSLeay-0.9.0/ssl/t1_lib.c *** SSLeay-0.9.0.old/ssl/t1_lib.c Fri Apr 10 01:47:14 1998 --- SSLeay-0.9.0/ssl/t1_lib.c Wed Jun 24 11:16:16 1998 *************** *** 60,66 **** #include "objects.h" #include "ssl_locl.h" ! char *tls1_version_str="TLSv1 part of SSLeay 0.9.0 10-Apr-1998"; #ifndef NO_PROTO static long tls1_default_timeout(void); --- 60,66 ---- #include "objects.h" #include "ssl_locl.h" ! char *tls1_version_str="TLSv1 part of SSLeay 0.9.0b 29-Jun-1998"; #ifndef NO_PROTO static long tls1_default_timeout(void);