aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ecdsa
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2004-10-21 00:06:14 +0000
committerGeoff Thorpe <geoff@openssl.org>2004-10-21 00:06:14 +0000
commit58ae65cd1a18a68892b1eb8bb55b7f11a5cf6ea9 (patch)
tree58a798eadb289081909028ea96b66d44b09b324c /crypto/ecdsa
parent5b0f1f7d1375c31280a68b51d5737f4d95df06bf (diff)
downloadopenssl-58ae65cd1a18a68892b1eb8bb55b7f11a5cf6ea9.tar.gz
Update ECDSA and ECDH for OPENSSL_NO_ENGINE.
Reported by: Maxim Masiutin Submitted by: Nils Larsch
Diffstat (limited to 'crypto/ecdsa')
-rw-r--r--crypto/ecdsa/ecs_lib.c8
-rw-r--r--crypto/ecdsa/ecs_sign.c2
-rw-r--r--crypto/ecdsa/ecs_vrf.c2
3 files changed, 12 insertions, 0 deletions
diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c
index d553ea1cd6..e355a35698 100644
--- a/crypto/ecdsa/ecs_lib.c
+++ b/crypto/ecdsa/ecs_lib.c
@@ -55,7 +55,9 @@
#include <string.h>
#include "ecdsa.h"
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
#include <openssl/err.h>
#include <openssl/bn.h>
@@ -92,11 +94,13 @@ int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth)
if (mtmp->finish)
mtmp->finish(eckey);
#endif
+#ifndef OPENSSL_NO_ENGINE
if (ecdsa->engine)
{
ENGINE_finish(ecdsa->engine);
ecdsa->engine = NULL;
}
+#endif
ecdsa->meth = meth;
#if 0
if (meth->init)
@@ -129,6 +133,7 @@ ECDSA_DATA *ECDSA_DATA_new_method(ENGINE *engine)
ret->meth = ECDSA_get_default_method();
ret->engine = engine;
+#ifndef OPENSSL_NO_ENGINE
if (!ret->engine)
ret->engine = ENGINE_get_default_ECDSA();
if (ret->engine)
@@ -142,6 +147,7 @@ ECDSA_DATA *ECDSA_DATA_new_method(ENGINE *engine)
return NULL;
}
}
+#endif
ret->flags = ret->meth->flags;
CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ECDSA, ret, &ret->ex_data);
@@ -167,8 +173,10 @@ void ECDSA_DATA_free(ECDSA_DATA *r)
if (r->meth->finish)
r->meth->finish(r);
#endif
+#ifndef OPENSSL_NO_ENGINE
if (r->engine)
ENGINE_finish(r->engine);
+#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, r, &r->ex_data);
diff --git a/crypto/ecdsa/ecs_sign.c b/crypto/ecdsa/ecs_sign.c
index 215da1211a..4667c8cfcc 100644
--- a/crypto/ecdsa/ecs_sign.c
+++ b/crypto/ecdsa/ecs_sign.c
@@ -54,7 +54,9 @@
*/
#include "ecdsa.h"
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
ECDSA_SIG * ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
{
diff --git a/crypto/ecdsa/ecs_vrf.c b/crypto/ecdsa/ecs_vrf.c
index 269671bec8..15a6ab49f9 100644
--- a/crypto/ecdsa/ecs_vrf.c
+++ b/crypto/ecdsa/ecs_vrf.c
@@ -54,7 +54,9 @@
*/
#include "ecdsa.h"
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
/* returns
* 1: correct signature