diff options
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_lib.c')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_lib.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c index 4171af24c6..da2cdfa3d6 100644 --- a/src/lib/libcrypto/dsa/dsa_lib.c +++ b/src/lib/libcrypto/dsa/dsa_lib.c | |||
@@ -63,9 +63,7 @@ | |||
63 | #include <openssl/bn.h> | 63 | #include <openssl/bn.h> |
64 | #include <openssl/dsa.h> | 64 | #include <openssl/dsa.h> |
65 | #include <openssl/asn1.h> | 65 | #include <openssl/asn1.h> |
66 | #ifndef OPENSSL_NO_ENGINE | ||
67 | #include <openssl/engine.h> | 66 | #include <openssl/engine.h> |
68 | #endif | ||
69 | 67 | ||
70 | const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT; | 68 | const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT; |
71 | 69 | ||
@@ -95,13 +93,11 @@ int DSA_set_method(DSA *dsa, const DSA_METHOD *meth) | |||
95 | const DSA_METHOD *mtmp; | 93 | const DSA_METHOD *mtmp; |
96 | mtmp = dsa->meth; | 94 | mtmp = dsa->meth; |
97 | if (mtmp->finish) mtmp->finish(dsa); | 95 | if (mtmp->finish) mtmp->finish(dsa); |
98 | #ifndef OPENSSL_NO_ENGINE | ||
99 | if (dsa->engine) | 96 | if (dsa->engine) |
100 | { | 97 | { |
101 | ENGINE_finish(dsa->engine); | 98 | ENGINE_finish(dsa->engine); |
102 | dsa->engine = NULL; | 99 | dsa->engine = NULL; |
103 | } | 100 | } |
104 | #endif | ||
105 | dsa->meth = meth; | 101 | dsa->meth = meth; |
106 | if (meth->init) meth->init(dsa); | 102 | if (meth->init) meth->init(dsa); |
107 | return 1; | 103 | return 1; |
@@ -118,7 +114,6 @@ DSA *DSA_new_method(ENGINE *engine) | |||
118 | return(NULL); | 114 | return(NULL); |
119 | } | 115 | } |
120 | ret->meth = DSA_get_default_method(); | 116 | ret->meth = DSA_get_default_method(); |
121 | #ifndef OPENSSL_NO_ENGINE | ||
122 | if (engine) | 117 | if (engine) |
123 | { | 118 | { |
124 | if (!ENGINE_init(engine)) | 119 | if (!ENGINE_init(engine)) |
@@ -143,7 +138,6 @@ DSA *DSA_new_method(ENGINE *engine) | |||
143 | return NULL; | 138 | return NULL; |
144 | } | 139 | } |
145 | } | 140 | } |
146 | #endif | ||
147 | 141 | ||
148 | ret->pad=0; | 142 | ret->pad=0; |
149 | ret->version=0; | 143 | ret->version=0; |
@@ -164,10 +158,8 @@ DSA *DSA_new_method(ENGINE *engine) | |||
164 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); | 158 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); |
165 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) | 159 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) |
166 | { | 160 | { |
167 | #ifndef OPENSSL_NO_ENGINE | ||
168 | if (ret->engine) | 161 | if (ret->engine) |
169 | ENGINE_finish(ret->engine); | 162 | ENGINE_finish(ret->engine); |
170 | #endif | ||
171 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); | 163 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); |
172 | OPENSSL_free(ret); | 164 | OPENSSL_free(ret); |
173 | ret=NULL; | 165 | ret=NULL; |
@@ -197,10 +189,8 @@ void DSA_free(DSA *r) | |||
197 | 189 | ||
198 | if(r->meth->finish) | 190 | if(r->meth->finish) |
199 | r->meth->finish(r); | 191 | r->meth->finish(r); |
200 | #ifndef OPENSSL_NO_ENGINE | ||
201 | if(r->engine) | 192 | if(r->engine) |
202 | ENGINE_finish(r->engine); | 193 | ENGINE_finish(r->engine); |
203 | #endif | ||
204 | 194 | ||
205 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data); | 195 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data); |
206 | 196 | ||
@@ -234,10 +224,7 @@ int DSA_size(const DSA *r) | |||
234 | { | 224 | { |
235 | int ret,i; | 225 | int ret,i; |
236 | ASN1_INTEGER bs; | 226 | ASN1_INTEGER bs; |
237 | unsigned char buf[4]; /* 4 bytes looks really small. | 227 | unsigned char buf[4]; |
238 | However, i2d_ASN1_INTEGER() will not look | ||
239 | beyond the first byte, as long as the second | ||
240 | parameter is NULL. */ | ||
241 | 228 | ||
242 | i=BN_num_bits(r->q); | 229 | i=BN_num_bits(r->q); |
243 | bs.length=(i+7)/8; | 230 | bs.length=(i+7)/8; |