diff options
author | djm <> | 2010-10-01 22:59:01 +0000 |
---|---|---|
committer | djm <> | 2010-10-01 22:59:01 +0000 |
commit | fe047d8b632246cb2db3234a0a4f32e5c318857b (patch) | |
tree | 939b752540947d33507b3acc48d76a8bfb7c3dc3 /src/lib/libcrypto/cast | |
parent | 2ea67f4aa254b09ded62e6e14fc893bbe6381579 (diff) | |
download | openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.gz openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.bz2 openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.zip |
resolve conflicts, fix local changes
Diffstat (limited to 'src/lib/libcrypto/cast')
-rw-r--r-- | src/lib/libcrypto/cast/Makefile.ssl | 120 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/asm/cast-586.pl | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/c_cfb64.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/c_ecb.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/c_enc.c | 13 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/c_ofb64.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/c_skey.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/cast/cast.h | 18 |
8 files changed, 21 insertions, 149 deletions
diff --git a/src/lib/libcrypto/cast/Makefile.ssl b/src/lib/libcrypto/cast/Makefile.ssl deleted file mode 100644 index 98393a37ba..0000000000 --- a/src/lib/libcrypto/cast/Makefile.ssl +++ /dev/null | |||
@@ -1,120 +0,0 @@ | |||
1 | # | ||
2 | # SSLeay/crypto/cast/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= cast | ||
6 | TOP= ../.. | ||
7 | CC= cc | ||
8 | CPP= $(CC) -E | ||
9 | INCLUDES= | ||
10 | CFLAG=-g | ||
11 | INSTALL_PREFIX= | ||
12 | OPENSSLDIR= /usr/local/ssl | ||
13 | INSTALLTOP=/usr/local/ssl | ||
14 | MAKE= make -f Makefile.ssl | ||
15 | MAKEDEPPROG= makedepend | ||
16 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
17 | MAKEFILE= Makefile.ssl | ||
18 | AR= ar r | ||
19 | |||
20 | CAST_ENC=c_enc.o | ||
21 | # or use | ||
22 | #CAST_ENC=asm/cx86-elf.o | ||
23 | #CAST_ENC=asm/cx86-out.o | ||
24 | #CAST_ENC=asm/cx86-sol.o | ||
25 | #CAST_ENC=asm/cx86bdsi.o | ||
26 | |||
27 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
28 | ASFLAGS= $(INCLUDES) $(ASFLAG) | ||
29 | |||
30 | GENERAL=Makefile | ||
31 | TEST=casttest.c | ||
32 | APPS= | ||
33 | |||
34 | LIB=$(TOP)/libcrypto.a | ||
35 | LIBSRC=c_skey.c c_ecb.c c_enc.c c_cfb64.c c_ofb64.c | ||
36 | LIBOBJ=c_skey.o c_ecb.o $(CAST_ENC) c_cfb64.o c_ofb64.o | ||
37 | |||
38 | SRC= $(LIBSRC) | ||
39 | |||
40 | EXHEADER= cast.h | ||
41 | HEADER= cast_s.h cast_lcl.h $(EXHEADER) | ||
42 | |||
43 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
44 | |||
45 | top: | ||
46 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
47 | |||
48 | all: lib | ||
49 | |||
50 | lib: $(LIBOBJ) | ||
51 | $(AR) $(LIB) $(LIBOBJ) | ||
52 | $(RANLIB) $(LIB) || echo Never mind. | ||
53 | @touch lib | ||
54 | |||
55 | # elf | ||
56 | asm/cx86-elf.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl | ||
57 | (cd asm; $(PERL) cast-586.pl elf $(CLAGS) $(PROCESSOR) > cx86-elf.s) | ||
58 | |||
59 | # a.out | ||
60 | asm/cx86-out.o: asm/cx86unix.cpp | ||
61 | $(CPP) -DOUT asm/cx86unix.cpp | as -o asm/cx86-out.o | ||
62 | |||
63 | # bsdi | ||
64 | asm/cx86bsdi.o: asm/cx86unix.cpp | ||
65 | $(CPP) -DBSDI asm/cx86unix.cpp | sed 's/ :/:/' | as -o asm/cx86bsdi.o | ||
66 | |||
67 | asm/cx86unix.cpp: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl | ||
68 | (cd asm; $(PERL) cast-586.pl cpp $(PROCESSOR) >cx86unix.cpp) | ||
69 | |||
70 | files: | ||
71 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
72 | |||
73 | links: | ||
74 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
75 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
76 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
77 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
78 | |||
79 | install: | ||
80 | @for i in $(EXHEADER) ; \ | ||
81 | do \ | ||
82 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
83 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
84 | done; | ||
85 | |||
86 | tags: | ||
87 | ctags $(SRC) | ||
88 | |||
89 | tests: | ||
90 | |||
91 | lint: | ||
92 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
93 | |||
94 | depend: | ||
95 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
96 | |||
97 | dclean: | ||
98 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
99 | mv -f Makefile.new $(MAKEFILE) | ||
100 | |||
101 | clean: | ||
102 | rm -f asm/cx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
103 | |||
104 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
105 | |||
106 | c_cfb64.o: ../../e_os.h ../../include/openssl/cast.h | ||
107 | c_cfb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
108 | c_cfb64.o: c_cfb64.c cast_lcl.h | ||
109 | c_ecb.o: ../../e_os.h ../../include/openssl/cast.h | ||
110 | c_ecb.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
111 | c_ecb.o: ../../include/openssl/opensslv.h c_ecb.c cast_lcl.h | ||
112 | c_enc.o: ../../e_os.h ../../include/openssl/cast.h | ||
113 | c_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
114 | c_enc.o: c_enc.c cast_lcl.h | ||
115 | c_ofb64.o: ../../e_os.h ../../include/openssl/cast.h | ||
116 | c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
117 | c_ofb64.o: c_ofb64.c cast_lcl.h | ||
118 | c_skey.o: ../../e_os.h ../../include/openssl/cast.h | ||
119 | c_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
120 | c_skey.o: c_skey.c cast_lcl.h cast_s.h | ||
diff --git a/src/lib/libcrypto/cast/asm/cast-586.pl b/src/lib/libcrypto/cast/asm/cast-586.pl index 0ed55d1905..7a0083ecb8 100644 --- a/src/lib/libcrypto/cast/asm/cast-586.pl +++ b/src/lib/libcrypto/cast/asm/cast-586.pl | |||
@@ -3,7 +3,8 @@ | |||
3 | # define for pentium pro friendly version | 3 | # define for pentium pro friendly version |
4 | $ppro=1; | 4 | $ppro=1; |
5 | 5 | ||
6 | push(@INC,"perlasm","../../perlasm"); | 6 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
7 | push(@INC,"${dir}","${dir}../../perlasm"); | ||
7 | require "x86asm.pl"; | 8 | require "x86asm.pl"; |
8 | require "cbc.pl"; | 9 | require "cbc.pl"; |
9 | 10 | ||
diff --git a/src/lib/libcrypto/cast/c_cfb64.c b/src/lib/libcrypto/cast/c_cfb64.c index 514c005c32..dcec13a201 100644 --- a/src/lib/libcrypto/cast/c_cfb64.c +++ b/src/lib/libcrypto/cast/c_cfb64.c | |||
@@ -65,7 +65,7 @@ | |||
65 | */ | 65 | */ |
66 | 66 | ||
67 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, | 67 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, |
68 | long length, CAST_KEY *schedule, unsigned char *ivec, | 68 | long length, const CAST_KEY *schedule, unsigned char *ivec, |
69 | int *num, int enc) | 69 | int *num, int enc) |
70 | { | 70 | { |
71 | register CAST_LONG v0,v1,t; | 71 | register CAST_LONG v0,v1,t; |
@@ -119,4 +119,3 @@ void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, | |||
119 | v0=v1=ti[0]=ti[1]=t=c=cc=0; | 119 | v0=v1=ti[0]=ti[1]=t=c=cc=0; |
120 | *num=n; | 120 | *num=n; |
121 | } | 121 | } |
122 | |||
diff --git a/src/lib/libcrypto/cast/c_ecb.c b/src/lib/libcrypto/cast/c_ecb.c index f2dc606226..b6a3b1fff9 100644 --- a/src/lib/libcrypto/cast/c_ecb.c +++ b/src/lib/libcrypto/cast/c_ecb.c | |||
@@ -63,7 +63,7 @@ | |||
63 | const char CAST_version[]="CAST" OPENSSL_VERSION_PTEXT; | 63 | const char CAST_version[]="CAST" OPENSSL_VERSION_PTEXT; |
64 | 64 | ||
65 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, | 65 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, |
66 | CAST_KEY *ks, int enc) | 66 | const CAST_KEY *ks, int enc) |
67 | { | 67 | { |
68 | CAST_LONG l,d[2]; | 68 | CAST_LONG l,d[2]; |
69 | 69 | ||
@@ -77,4 +77,3 @@ void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, | |||
77 | l=d[1]; l2n(l,out); | 77 | l=d[1]; l2n(l,out); |
78 | l=d[0]=d[1]=0; | 78 | l=d[0]=d[1]=0; |
79 | } | 79 | } |
80 | |||
diff --git a/src/lib/libcrypto/cast/c_enc.c b/src/lib/libcrypto/cast/c_enc.c index e80f65b698..2ae54f5cfb 100644 --- a/src/lib/libcrypto/cast/c_enc.c +++ b/src/lib/libcrypto/cast/c_enc.c | |||
@@ -60,9 +60,10 @@ | |||
60 | #include "cast_lcl.h" | 60 | #include "cast_lcl.h" |
61 | 61 | ||
62 | #ifndef OPENBSD_CAST_ASM | 62 | #ifndef OPENBSD_CAST_ASM |
63 | void CAST_encrypt(CAST_LONG *data, CAST_KEY *key) | 63 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key) |
64 | { | 64 | { |
65 | register CAST_LONG l,r,*k,t; | 65 | register CAST_LONG l,r,t; |
66 | const register CAST_LONG *k; | ||
66 | 67 | ||
67 | k= &(key->data[0]); | 68 | k= &(key->data[0]); |
68 | l=data[0]; | 69 | l=data[0]; |
@@ -92,9 +93,10 @@ void CAST_encrypt(CAST_LONG *data, CAST_KEY *key) | |||
92 | data[0]=r&0xffffffffL; | 93 | data[0]=r&0xffffffffL; |
93 | } | 94 | } |
94 | 95 | ||
95 | void CAST_decrypt(CAST_LONG *data, CAST_KEY *key) | 96 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key) |
96 | { | 97 | { |
97 | register CAST_LONG l,r,*k,t; | 98 | register CAST_LONG l,r,t; |
99 | const register CAST_LONG *k; | ||
98 | 100 | ||
99 | k= &(key->data[0]); | 101 | k= &(key->data[0]); |
100 | l=data[0]; | 102 | l=data[0]; |
@@ -126,7 +128,7 @@ void CAST_decrypt(CAST_LONG *data, CAST_KEY *key) | |||
126 | #endif | 128 | #endif |
127 | 129 | ||
128 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, | 130 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, |
129 | CAST_KEY *ks, unsigned char *iv, int enc) | 131 | const CAST_KEY *ks, unsigned char *iv, int enc) |
130 | { | 132 | { |
131 | register CAST_LONG tin0,tin1; | 133 | register CAST_LONG tin0,tin1; |
132 | register CAST_LONG tout0,tout1,xor0,xor1; | 134 | register CAST_LONG tout0,tout1,xor0,xor1; |
@@ -206,4 +208,3 @@ void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, | |||
206 | tin0=tin1=tout0=tout1=xor0=xor1=0; | 208 | tin0=tin1=tout0=tout1=xor0=xor1=0; |
207 | tin[0]=tin[1]=0; | 209 | tin[0]=tin[1]=0; |
208 | } | 210 | } |
209 | |||
diff --git a/src/lib/libcrypto/cast/c_ofb64.c b/src/lib/libcrypto/cast/c_ofb64.c index fd0469a62f..cb3222456c 100644 --- a/src/lib/libcrypto/cast/c_ofb64.c +++ b/src/lib/libcrypto/cast/c_ofb64.c | |||
@@ -64,7 +64,7 @@ | |||
64 | * 64bit block we have used is contained in *num; | 64 | * 64bit block we have used is contained in *num; |
65 | */ | 65 | */ |
66 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, | 66 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, |
67 | long length, CAST_KEY *schedule, unsigned char *ivec, | 67 | long length, const CAST_KEY *schedule, unsigned char *ivec, |
68 | int *num) | 68 | int *num) |
69 | { | 69 | { |
70 | register CAST_LONG v0,v1,t; | 70 | register CAST_LONG v0,v1,t; |
@@ -108,4 +108,3 @@ void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, | |||
108 | t=v0=v1=ti[0]=ti[1]=0; | 108 | t=v0=v1=ti[0]=ti[1]=0; |
109 | *num=n; | 109 | *num=n; |
110 | } | 110 | } |
111 | |||
diff --git a/src/lib/libcrypto/cast/c_skey.c b/src/lib/libcrypto/cast/c_skey.c index 68e690a60c..76e40005c9 100644 --- a/src/lib/libcrypto/cast/c_skey.c +++ b/src/lib/libcrypto/cast/c_skey.c | |||
@@ -57,11 +57,6 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/cast.h> | 59 | #include <openssl/cast.h> |
60 | #include <openssl/crypto.h> | ||
61 | #ifdef OPENSSL_FIPS | ||
62 | #include <openssl/fips.h> | ||
63 | #endif | ||
64 | |||
65 | #include "cast_lcl.h" | 60 | #include "cast_lcl.h" |
66 | #include "cast_s.h" | 61 | #include "cast_s.h" |
67 | 62 | ||
@@ -77,7 +72,7 @@ | |||
77 | #define S6 CAST_S_table6 | 72 | #define S6 CAST_S_table6 |
78 | #define S7 CAST_S_table7 | 73 | #define S7 CAST_S_table7 |
79 | 74 | ||
80 | FIPS_NON_FIPS_VCIPHER_Init(CAST) | 75 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data) |
81 | { | 76 | { |
82 | CAST_LONG x[16]; | 77 | CAST_LONG x[16]; |
83 | CAST_LONG z[16]; | 78 | CAST_LONG z[16]; |
diff --git a/src/lib/libcrypto/cast/cast.h b/src/lib/libcrypto/cast/cast.h index 1faf5806aa..1a264f8143 100644 --- a/src/lib/libcrypto/cast/cast.h +++ b/src/lib/libcrypto/cast/cast.h | |||
@@ -72,7 +72,7 @@ extern "C" { | |||
72 | #define CAST_ENCRYPT 1 | 72 | #define CAST_ENCRYPT 1 |
73 | #define CAST_DECRYPT 0 | 73 | #define CAST_DECRYPT 0 |
74 | 74 | ||
75 | #define CAST_LONG unsigned long | 75 | #define CAST_LONG unsigned int |
76 | 76 | ||
77 | #define CAST_BLOCK 8 | 77 | #define CAST_BLOCK 8 |
78 | #define CAST_KEY_LENGTH 16 | 78 | #define CAST_KEY_LENGTH 16 |
@@ -83,21 +83,19 @@ typedef struct cast_key_st | |||
83 | int short_key; /* Use reduced rounds for short key */ | 83 | int short_key; /* Use reduced rounds for short key */ |
84 | } CAST_KEY; | 84 | } CAST_KEY; |
85 | 85 | ||
86 | #ifdef OPENSSL_FIPS | 86 | |
87 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); | ||
88 | #endif | ||
89 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); | 87 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); |
90 | void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key, | 88 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key, |
91 | int enc); | 89 | int enc); |
92 | void CAST_encrypt(CAST_LONG *data,CAST_KEY *key); | 90 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); |
93 | void CAST_decrypt(CAST_LONG *data,CAST_KEY *key); | 91 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); |
94 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, | 92 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, |
95 | CAST_KEY *ks, unsigned char *iv, int enc); | 93 | const CAST_KEY *ks, unsigned char *iv, int enc); |
96 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, | 94 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, |
97 | long length, CAST_KEY *schedule, unsigned char *ivec, | 95 | long length, const CAST_KEY *schedule, unsigned char *ivec, |
98 | int *num, int enc); | 96 | int *num, int enc); |
99 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, | 97 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, |
100 | long length, CAST_KEY *schedule, unsigned char *ivec, | 98 | long length, const CAST_KEY *schedule, unsigned char *ivec, |
101 | int *num); | 99 | int *num); |
102 | 100 | ||
103 | #ifdef __cplusplus | 101 | #ifdef __cplusplus |