summaryrefslogtreecommitdiffstats
path: root/crypto/ecdh
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/ecdh
parent5b0f1f7d1375c31280a68b51d5737f4d95df06bf (diff)
Update ECDSA and ECDH for OPENSSL_NO_ENGINE.
Reported by: Maxim Masiutin Submitted by: Nils Larsch
Diffstat (limited to 'crypto/ecdh')
-rw-r--r--crypto/ecdh/ech_key.c2
-rw-r--r--crypto/ecdh/ech_lib.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/crypto/ecdh/ech_key.c b/crypto/ecdh/ech_key.c
index 923a7e9dd9..7d1bb32ae0 100644
--- a/crypto/ecdh/ech_key.c
+++ b/crypto/ecdh/ech_key.c
@@ -68,7 +68,9 @@
*/
#include "ecdh.h"
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *eckey,
void *(*KDF)(void *in, size_t inlen, void *out, size_t outlen))
diff --git a/crypto/ecdh/ech_lib.c b/crypto/ecdh/ech_lib.c
index a0e4ef45f0..f2abfed510 100644
--- a/crypto/ecdh/ech_lib.c
+++ b/crypto/ecdh/ech_lib.c
@@ -69,7 +69,9 @@
#include "ecdh.h"
#include <string.h>
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
#include <openssl/err.h>
const char *ECDH_version="ECDH" OPENSSL_VERSION_PTEXT;
@@ -105,11 +107,13 @@ int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
if (mtmp->finish)
mtmp->finish(eckey);
#endif
+#ifndef OPENSSL_NO_ENGINE
if (ecdh->engine)
{
ENGINE_finish(ecdh->engine);
ecdh->engine = NULL;
}
+#endif
ecdh->meth = meth;
#if 0
if (meth->init)
@@ -139,6 +143,7 @@ ECDH_DATA *ECDH_DATA_new_method(ENGINE *engine)
ret->meth = ECDH_get_default_method();
ret->engine = engine;
+#ifndef OPENSSL_NO_ENGINE
if (!ret->engine)
ret->engine = ENGINE_get_default_ECDH();
if (ret->engine)
@@ -152,6 +157,7 @@ ECDH_DATA *ECDH_DATA_new_method(ENGINE *engine)
return NULL;
}
}
+#endif
ret->flags = ret->meth->flags;
CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ECDH, ret, &ret->ex_data);
@@ -172,8 +178,10 @@ void ECDH_DATA_free(ECDH_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_ECDH, r, &r->ex_data);