summaryrefslogtreecommitdiffstats
path: root/crypto/engine
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2015-09-12 17:17:33 +0100
committerBen Laurie <ben@links.org>2015-12-11 18:38:38 +0000
commit94d61512360c4d16762a13e27fcad39ca4f5e506 (patch)
tree73f8502889654d1c575272a923a884cfd4657cb6 /crypto/engine
parentea11c6e92090078319e606d5639b7a81bdd57897 (diff)
Make no-dh work, plus other no-dh problems found by Richard.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/engine')
-rw-r--r--crypto/engine/eng_cryptodev.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
index d1c0029d35..dede52df44 100644
--- a/crypto/engine/eng_cryptodev.c
+++ b/crypto/engine/eng_cryptodev.c
@@ -55,7 +55,9 @@
# include <errno.h>
# include <string.h>
#endif
-#include <openssl/dh.h>
+#ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+#endif
#include <openssl/dsa.h>
#include <openssl/err.h>
#include <openssl/rsa.h>
@@ -125,11 +127,13 @@ static DSA_SIG *cryptodev_dsa_do_sign(const unsigned char *dgst, int dlen,
DSA *dsa);
static int cryptodev_dsa_verify(const unsigned char *dgst, int dgst_len,
DSA_SIG *sig, DSA *dsa);
+#ifndef OPENSSL_NO_DH
static int cryptodev_mod_exp_dh(const DH *dh, BIGNUM *r, const BIGNUM *a,
const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *m_ctx);
static int cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key,
DH *dh);
+#endif
static int cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p,
void (*f) (void));
void ENGINE_load_cryptodev(void);
@@ -1364,6 +1368,7 @@ static DSA_METHOD cryptodev_dsa = {
NULL /* app_data */
};
+#ifndef OPENSSL_NO_DH
static int
cryptodev_mod_exp_dh(const DH *dh, BIGNUM *r, const BIGNUM *a,
const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
@@ -1425,6 +1430,8 @@ static DH_METHOD cryptodev_dh = {
NULL /* app_data */
};
+#endif /* ndef OPENSSL_NO_DH */
+
/*
* ctrl right now is just a wrapper that doesn't do much
* but I expect we'll want some options soon.
@@ -1512,6 +1519,7 @@ void ENGINE_load_cryptodev(void)
cryptodev_dsa.dsa_do_verify = cryptodev_dsa_verify;
}
+#ifndef OPENSSL_NO_DH
if (ENGINE_set_DH(engine, &cryptodev_dh)) {
const DH_METHOD *dh_meth = DH_OpenSSL();
@@ -1524,6 +1532,7 @@ void ENGINE_load_cryptodev(void)
cryptodev_dh.compute_key = cryptodev_dh_compute_key;
}
}
+#endif
ENGINE_add(engine);
ENGINE_free(engine);