diff options
Diffstat (limited to 'src/lib/libcrypto/dh')
-rw-r--r-- | src/lib/libcrypto/dh/Makefile.ssl | 19 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_key.c | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dhtest.c | 14 |
4 files changed, 23 insertions, 21 deletions
diff --git a/src/lib/libcrypto/dh/Makefile.ssl b/src/lib/libcrypto/dh/Makefile.ssl index 5e1aaae160..e05fc01a12 100644 --- a/src/lib/libcrypto/dh/Makefile.ssl +++ b/src/lib/libcrypto/dh/Makefile.ssl | |||
@@ -68,7 +68,7 @@ lint: | |||
68 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 68 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
69 | 69 | ||
70 | depend: | 70 | depend: |
71 | $(MAKEDEPEND) $(CFLAG) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) | 71 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) |
72 | 72 | ||
73 | dclean: | 73 | dclean: |
74 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | 74 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new |
@@ -112,17 +112,14 @@ dh_gen.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | |||
112 | dh_gen.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 112 | dh_gen.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
113 | dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 113 | dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
114 | dh_gen.o: ../cryptlib.h dh_gen.c | 114 | dh_gen.o: ../cryptlib.h dh_gen.c |
115 | dh_key.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 115 | dh_key.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h |
116 | dh_key.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 116 | dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
117 | dh_key.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h | 117 | dh_key.o: ../../include/openssl/dh.h ../../include/openssl/e_os2.h |
118 | dh_key.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | 118 | dh_key.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
119 | dh_key.o: ../../include/openssl/engine.h ../../include/openssl/err.h | 119 | dh_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
120 | dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 120 | dh_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h |
121 | dh_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
122 | dh_key.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h | ||
123 | dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 121 | dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
124 | dh_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | 122 | dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_key.c |
125 | dh_key.o: ../cryptlib.h dh_key.c | ||
126 | dh_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 123 | dh_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
127 | dh_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 124 | dh_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
128 | dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h | 125 | dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c index 1a0efca2c4..77f2f50b51 100644 --- a/src/lib/libcrypto/dh/dh_key.c +++ b/src/lib/libcrypto/dh/dh_key.c | |||
@@ -61,7 +61,6 @@ | |||
61 | #include <openssl/bn.h> | 61 | #include <openssl/bn.h> |
62 | #include <openssl/rand.h> | 62 | #include <openssl/rand.h> |
63 | #include <openssl/dh.h> | 63 | #include <openssl/dh.h> |
64 | #include <openssl/engine.h> | ||
65 | 64 | ||
66 | static int generate_key(DH *dh); | 65 | static int generate_key(DH *dh); |
67 | static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); | 66 | static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); |
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index ba5fd41057..09965ee2ea 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
@@ -60,7 +60,9 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/bn.h> | 61 | #include <openssl/bn.h> |
62 | #include <openssl/dh.h> | 62 | #include <openssl/dh.h> |
63 | #ifndef OPENSSL_NO_ENGINE | ||
63 | #include <openssl/engine.h> | 64 | #include <openssl/engine.h> |
65 | #endif | ||
64 | 66 | ||
65 | const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT; | 67 | const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT; |
66 | 68 | ||
@@ -85,11 +87,13 @@ int DH_set_method(DH *dh, const DH_METHOD *meth) | |||
85 | const DH_METHOD *mtmp; | 87 | const DH_METHOD *mtmp; |
86 | mtmp = dh->meth; | 88 | mtmp = dh->meth; |
87 | if (mtmp->finish) mtmp->finish(dh); | 89 | if (mtmp->finish) mtmp->finish(dh); |
90 | #ifndef OPENSSL_NO_ENGINE | ||
88 | if (dh->engine) | 91 | if (dh->engine) |
89 | { | 92 | { |
90 | ENGINE_finish(dh->engine); | 93 | ENGINE_finish(dh->engine); |
91 | dh->engine = NULL; | 94 | dh->engine = NULL; |
92 | } | 95 | } |
96 | #endif | ||
93 | dh->meth = meth; | 97 | dh->meth = meth; |
94 | if (meth->init) meth->init(dh); | 98 | if (meth->init) meth->init(dh); |
95 | return 1; | 99 | return 1; |
@@ -112,6 +116,7 @@ DH *DH_new_method(ENGINE *engine) | |||
112 | } | 116 | } |
113 | 117 | ||
114 | ret->meth = DH_get_default_method(); | 118 | ret->meth = DH_get_default_method(); |
119 | #ifndef OPENSSL_NO_ENGINE | ||
115 | if (engine) | 120 | if (engine) |
116 | { | 121 | { |
117 | if (!ENGINE_init(engine)) | 122 | if (!ENGINE_init(engine)) |
@@ -135,6 +140,7 @@ DH *DH_new_method(ENGINE *engine) | |||
135 | return NULL; | 140 | return NULL; |
136 | } | 141 | } |
137 | } | 142 | } |
143 | #endif | ||
138 | 144 | ||
139 | ret->pad=0; | 145 | ret->pad=0; |
140 | ret->version=0; | 146 | ret->version=0; |
@@ -154,8 +160,10 @@ DH *DH_new_method(ENGINE *engine) | |||
154 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); | 160 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); |
155 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) | 161 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) |
156 | { | 162 | { |
163 | #ifndef OPENSSL_NO_ENGINE | ||
157 | if (ret->engine) | 164 | if (ret->engine) |
158 | ENGINE_finish(ret->engine); | 165 | ENGINE_finish(ret->engine); |
166 | #endif | ||
159 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); | 167 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); |
160 | OPENSSL_free(ret); | 168 | OPENSSL_free(ret); |
161 | ret=NULL; | 169 | ret=NULL; |
@@ -182,8 +190,10 @@ void DH_free(DH *r) | |||
182 | 190 | ||
183 | if (r->meth->finish) | 191 | if (r->meth->finish) |
184 | r->meth->finish(r); | 192 | r->meth->finish(r); |
193 | #ifndef OPENSSL_NO_ENGINE | ||
185 | if (r->engine) | 194 | if (r->engine) |
186 | ENGINE_finish(r->engine); | 195 | ENGINE_finish(r->engine); |
196 | #endif | ||
187 | 197 | ||
188 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data); | 198 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data); |
189 | 199 | ||
diff --git a/src/lib/libcrypto/dh/dhtest.c b/src/lib/libcrypto/dh/dhtest.c index 34894ced73..d75077f9fa 100644 --- a/src/lib/libcrypto/dh/dhtest.c +++ b/src/lib/libcrypto/dh/dhtest.c | |||
@@ -59,9 +59,9 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <stdlib.h> | 60 | #include <stdlib.h> |
61 | #include <string.h> | 61 | #include <string.h> |
62 | #ifdef OPENSSL_SYS_WINDOWS | 62 | |
63 | #include "../bio/bss_file.c" | 63 | #include "../e_os.h" |
64 | #endif | 64 | |
65 | #include <openssl/crypto.h> | 65 | #include <openssl/crypto.h> |
66 | #include <openssl/bio.h> | 66 | #include <openssl/bio.h> |
67 | #include <openssl/bn.h> | 67 | #include <openssl/bn.h> |
@@ -84,10 +84,6 @@ int main(int argc, char *argv[]) | |||
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | static void MS_CALLBACK cb(int p, int n, void *arg); | 86 | static void MS_CALLBACK cb(int p, int n, void *arg); |
87 | #ifdef OPENSSL_NO_STDIO | ||
88 | #define APPS_WIN16 | ||
89 | #include "bss_file.c" | ||
90 | #endif | ||
91 | 87 | ||
92 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | 88 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; |
93 | 89 | ||
@@ -111,7 +107,7 @@ int main(int argc, char *argv[]) | |||
111 | RAND_seed(rnd_seed, sizeof rnd_seed); | 107 | RAND_seed(rnd_seed, sizeof rnd_seed); |
112 | 108 | ||
113 | out=BIO_new(BIO_s_file()); | 109 | out=BIO_new(BIO_s_file()); |
114 | if (out == NULL) exit(1); | 110 | if (out == NULL) EXIT(1); |
115 | BIO_set_fp(out,stdout,BIO_NOCLOSE); | 111 | BIO_set_fp(out,stdout,BIO_NOCLOSE); |
116 | 112 | ||
117 | a=DH_generate_parameters(64,DH_GENERATOR_5,cb,out); | 113 | a=DH_generate_parameters(64,DH_GENERATOR_5,cb,out); |
@@ -195,7 +191,7 @@ err: | |||
195 | CRYPTO_cleanup_all_ex_data(); | 191 | CRYPTO_cleanup_all_ex_data(); |
196 | ERR_remove_state(0); | 192 | ERR_remove_state(0); |
197 | CRYPTO_mem_leaks_fp(stderr); | 193 | CRYPTO_mem_leaks_fp(stderr); |
198 | exit(ret); | 194 | EXIT(ret); |
199 | return(ret); | 195 | return(ret); |
200 | } | 196 | } |
201 | 197 | ||