diff options
author | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 11:00:56 +0000 |
---|---|---|
committer | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 11:00:56 +0000 |
commit | dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c (patch) | |
tree | 2f74e0cfd76a9e092548a9bf52e579aef984299b /crypto/des | |
parent | 58964a492275ca9a59a0cd9c8155cb2491b4b909 (diff) | |
download | openssl-dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c.tar.gz |
Import of old SSLeay release: SSLeay 0.9.1b (unreleased)
Diffstat (limited to 'crypto/des')
-rw-r--r-- | crypto/des/Makefile.ssl | 4 | ||||
-rw-r--r-- | crypto/des/VERSION | 1 | ||||
-rw-r--r-- | crypto/des/asm/f.cpp | 6 | ||||
-rw-r--r-- | crypto/des/des.h | 2 | ||||
-rw-r--r-- | crypto/des/des.org | 2 | ||||
-rw-r--r-- | crypto/des/des_locl.h | 30 | ||||
-rw-r--r-- | crypto/des/des_locl.org | 30 | ||||
-rw-r--r-- | crypto/des/des_opts.c | 3 | ||||
-rw-r--r-- | crypto/des/destest.c | 17 | ||||
-rw-r--r-- | crypto/des/ecb_enc.c | 2 | ||||
-rw-r--r-- | crypto/des/fcrypt.c | 6 | ||||
-rw-r--r-- | crypto/des/set_key.c | 4 | ||||
-rw-r--r-- | crypto/des/speed.c | 3 |
13 files changed, 65 insertions, 45 deletions
diff --git a/crypto/des/Makefile.ssl b/crypto/des/Makefile.ssl index 78b5189ee3..9ca1b872be 100644 --- a/crypto/des/Makefile.ssl +++ b/crypto/des/Makefile.ssl @@ -83,10 +83,10 @@ asm/yx86-out.o: asm/yx86unix.cpp # bsdi asm/dx86bsdi.o: asm/dx86unix.cpp - $(CPP) -DBSDI asm/dx86unix.cpp | as -o asm/dx86bsdi.o + $(CPP) -DBSDI asm/dx86unix.cpp | sed 's/ :/:/' | as -o asm/dx86bsdi.o asm/yx86bsdi.o: asm/yx86unix.cpp - $(CPP) -DBSDI asm/yx86unix.cpp | as -o asm/yx86bsdi.o + $(CPP) -DBSDI asm/yx86unix.cpp | sed 's/ :/:/' | as -o asm/yx86bsdi.o asm/dx86unix.cpp: (cd asm; perl des-586.pl cpp >dx86unix.cpp) diff --git a/crypto/des/VERSION b/crypto/des/VERSION index f62d8bdac0..c7d01542bc 100644 --- a/crypto/des/VERSION +++ b/crypto/des/VERSION @@ -1,3 +1,4 @@ + Fixed the weak key values which were wrong :-( Defining SIGACTION causes sigaction() to be used instead of signal(). SIGUSR1/SIGUSR2 are no longer mapped in the read tty stuff because it can cause problems. This should hopefully not affect normal diff --git a/crypto/des/asm/f.cpp b/crypto/des/asm/f.cpp new file mode 100644 index 0000000000..4fa46f2a54 --- /dev/null +++ b/crypto/des/asm/f.cpp @@ -0,0 +1,6 @@ +#define abc def +#define dbc: ghi: + + +abc +dbc: diff --git a/crypto/des/des.h b/crypto/des/des.h index a4cf5c8770..4d7610c8ed 100644 --- a/crypto/des/des.h +++ b/crypto/des/des.h @@ -90,6 +90,7 @@ typedef struct des_ks_struct } ks; #undef _ #define _ ks._ + int weak_key; } des_key_schedule[16]; #define DES_KEY_SZ (sizeof(des_cblock)) @@ -140,6 +141,7 @@ typedef des_key_schedule bit_64; extern int des_check_key; /* defaults to false */ extern int des_rw_mode; /* defaults to DES_PCBC_MODE */ +extern int des_set_weak_key_flag; /* set the weak key flag */ /* The next line is used to disable full ANSI prototypes, if your * compiler has problems with the prototypes, make sure this line always diff --git a/crypto/des/des.org b/crypto/des/des.org index a4cf5c8770..4d7610c8ed 100644 --- a/crypto/des/des.org +++ b/crypto/des/des.org @@ -90,6 +90,7 @@ typedef struct des_ks_struct } ks; #undef _ #define _ ks._ + int weak_key; } des_key_schedule[16]; #define DES_KEY_SZ (sizeof(des_cblock)) @@ -140,6 +141,7 @@ typedef des_key_schedule bit_64; extern int des_check_key; /* defaults to false */ extern int des_rw_mode; /* defaults to DES_PCBC_MODE */ +extern int des_set_weak_key_flag; /* set the weak key flag */ /* The next line is used to disable full ANSI prototypes, if your * compiler has problems with the prototypes, make sure this line always diff --git a/crypto/des/des_locl.h b/crypto/des/des_locl.h index e2e503cbed..67ef3e7900 100644 --- a/crypto/des/des_locl.h +++ b/crypto/des/des_locl.h @@ -119,16 +119,16 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! there's no way to tell at compile time what it is you're running on */ #if defined( sun ) /* Newer Sparc's */ - #define DES_PTR - #define DES_RISC1 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL #elif defined( __ultrix ) /* Older MIPS */ - #define DES_PTR - #define DES_RISC2 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL #elif defined( __osf1__ ) /* Alpha */ - #define DES_PTR - #define DES_RISC2 +# define DES_PTR +# define DES_RISC2 #elif defined ( _AIX ) /* RS6000 */ /* Unknown */ #elif defined( __hpux ) /* HP-PA */ @@ -136,15 +136,15 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! #elif defined( __aux ) /* 68K */ /* Unknown */ #elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ - #define DES_UNROLL +# define DES_UNROLL #elif defined( __sgi ) /* Newer MIPS */ - #define DES_PTR - #define DES_RISC2 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL #elif defined( i386 ) /* x86 boxes, should be gcc */ - #define DES_PTR - #define DES_RISC1 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL #endif /* Systems-specific speed defines */ #endif diff --git a/crypto/des/des_locl.org b/crypto/des/des_locl.org index e2e503cbed..67ef3e7900 100644 --- a/crypto/des/des_locl.org +++ b/crypto/des/des_locl.org @@ -119,16 +119,16 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! there's no way to tell at compile time what it is you're running on */ #if defined( sun ) /* Newer Sparc's */ - #define DES_PTR - #define DES_RISC1 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL #elif defined( __ultrix ) /* Older MIPS */ - #define DES_PTR - #define DES_RISC2 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL #elif defined( __osf1__ ) /* Alpha */ - #define DES_PTR - #define DES_RISC2 +# define DES_PTR +# define DES_RISC2 #elif defined ( _AIX ) /* RS6000 */ /* Unknown */ #elif defined( __hpux ) /* HP-PA */ @@ -136,15 +136,15 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! #elif defined( __aux ) /* 68K */ /* Unknown */ #elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ - #define DES_UNROLL +# define DES_UNROLL #elif defined( __sgi ) /* Newer MIPS */ - #define DES_PTR - #define DES_RISC2 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL #elif defined( i386 ) /* x86 boxes, should be gcc */ - #define DES_PTR - #define DES_RISC1 - #define DES_UNROLL +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL #endif /* Systems-specific speed defines */ #endif diff --git a/crypto/des/des_opts.c b/crypto/des/des_opts.c index fdf0fbf461..29d9461d29 100644 --- a/crypto/des/des_opts.c +++ b/crypto/des/des_opts.c @@ -92,7 +92,8 @@ struct tms { #include <sys/timeb.h> #endif -#ifdef sun +#if defined(sun) || defined(__ultrix) +#define _POSIX_SOURCE #include <limits.h> #include <sys/param.h> #endif diff --git a/crypto/des/destest.c b/crypto/des/destest.c index 620c13ba6f..5700608b9b 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -72,6 +72,10 @@ #include <string.h> #include "des.h" +#if defined(PERL5) || defined(__FreeBSD__) +#define crypt(c,s) (des_crypt((c),(s))) +#endif + /* tisk tisk - the test keys don't all have odd parity :-( */ /* test data */ #define NUM_TESTS 34 @@ -660,17 +664,20 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); printf("Doing quad_cksum\n"); cs=quad_cksum((C_Block *)cbc_data,(C_Block *)qret, (long)strlen(cbc_data),2,(C_Block *)cbc_iv); + + { /* Big-endian fix */ + static DES_LONG l=1; + static unsigned char *c=(unsigned char *)&l; + DES_LONG ll; + j=sizeof(lqret[0])-4; for (i=0; i<4; i++) { lqret[i]=0; memcpy(&(lqret[i]),&(qret[i][0]),4); - if (j > 0) lqret[i]=lqret[i]>>(j*8); /* For Cray */ + if (!c[0] && (j > 0)) + lqret[i]=lqret[i]>>(j*8); /* For Cray */ } - { /* Big-endian fix */ - static DES_LONG l=1; - static unsigned char *c=(unsigned char *)&l; - DES_LONG ll; if (!c[0]) { diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c index acf23fdd00..2f99ae5ddc 100644 --- a/crypto/des/ecb_enc.c +++ b/crypto/des/ecb_enc.c @@ -60,7 +60,7 @@ #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_version="DES part of SSLeay 0.9.1a 06-Jul-1998"; char *des_options() { diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c index 129beb27da..645e66a9ae 100644 --- a/crypto/des/fcrypt.c +++ b/crypto/des/fcrypt.c @@ -55,21 +55,21 @@ static unsigned const char cov_2char[64]={ void fcrypt_body(DES_LONG *out,des_key_schedule ks, DES_LONG Eswap0, DES_LONG Eswap1); -#if defined(PERL5) || defined(FreeBSD) +#if defined(PERL5) || defined(__FreeBSD__) char *des_crypt(const char *buf,const char *salt); #else char *crypt(const char *buf,const char *salt); #endif #else void fcrypt_body(); -#ifdef PERL5 +#if defined(PERL5) || defined(__FreeBSD__) char *des_crypt(); #else char *crypt(); #endif #endif -#if defined(PERL5) || defined(FreeBSD) +#if defined(PERL5) || defined(__FreeBSD__) char *des_crypt(buf,salt) #else char *crypt(buf,salt) diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index c3bcd7ee2b..fe966fd255 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -111,8 +111,8 @@ static des_cblock weak_keys[NUM_WEAK_KEY]={ /* weak keys */ {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, {0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE}, - {0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}, - {0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0}, + {0x1F,0x1F,0x1F,0x1F,0x0E,0x0E,0x0E,0x0E}, + {0xE0,0xE0,0xE0,0xE0,0xF1,0xF1,0xF1,0xF1}, /* semi-weak keys */ {0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE}, {0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01}, diff --git a/crypto/des/speed.c b/crypto/des/speed.c index 5bbe8b01d6..bac078e054 100644 --- a/crypto/des/speed.c +++ b/crypto/des/speed.c @@ -92,7 +92,8 @@ struct tms { #include <sys/timeb.h> #endif -#ifdef sun +#if defined(sun) || defined(__ultrix) +#define _POSIX_SOURCE #include <limits.h> #include <sys/param.h> #endif |