summaryrefslogtreecommitdiffstats
path: root/crypto/engine
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2002-01-18 16:51:05 +0000
committerBen Laurie <ben@openssl.org>2002-01-18 16:51:05 +0000
commit9dd5ae65533ec43e66efe66e1bbcddce4cb05509 (patch)
tree7150828e2bcb1ac5c92435ddc3dee259facd72e7 /crypto/engine
parente1e876072d813ac55a4a0b2c17ff55a0b27d1689 (diff)
Constification, add config to /dev/crypto.
Diffstat (limited to 'crypto/engine')
-rw-r--r--crypto/engine/Makefile.ssl1
-rw-r--r--crypto/engine/hw_openbsd_dev_crypto.c16
2 files changed, 16 insertions, 1 deletions
diff --git a/crypto/engine/Makefile.ssl b/crypto/engine/Makefile.ssl
index 1c93e46d42..de82b08355 100644
--- a/crypto/engine/Makefile.ssl
+++ b/crypto/engine/Makefile.ssl
@@ -274,6 +274,7 @@ hw_nuron.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
hw_nuron.o: ../cryptlib.h hw_nuron.c
hw_openbsd_dev_crypto.o: ../../include/openssl/asn1.h
hw_openbsd_dev_crypto.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
+hw_openbsd_dev_crypto.o: ../../include/openssl/conf.h
hw_openbsd_dev_crypto.o: ../../include/openssl/crypto.h
hw_openbsd_dev_crypto.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_openbsd_dev_crypto.o: ../../include/openssl/e_os2.h
diff --git a/crypto/engine/hw_openbsd_dev_crypto.c b/crypto/engine/hw_openbsd_dev_crypto.c
index bf0b8ea161..8085323ed1 100644
--- a/crypto/engine/hw_openbsd_dev_crypto.c
+++ b/crypto/engine/hw_openbsd_dev_crypto.c
@@ -62,6 +62,7 @@
#else
#include "../evp/evp_locl.h"
#endif
+#include <openssl/conf.h>
#ifndef OPENSSL_OPENBSD_DEV_CRYPTO
@@ -93,10 +94,23 @@ static int dev_crypto_digests(ENGINE *e, const EVP_MD **digest,
static const char dev_crypto_id[] = "openbsd_dev_crypto";
static const char dev_crypto_name[] = "OpenBSD /dev/crypto";
+static long allow_misaligned;
+
+static int init_conf(CONF_IMODULE *md,const CONF *conf)
+ {
+ if(!NCONF_get_number(conf,CONF_imodule_get_value(md),"allow_misaligned",
+ &allow_misaligned))
+ return 0;
+ printf("allow misaligned=%ld\n",allow_misaligned);
+
+ return 1;
+ }
+
static ENGINE *engine_openbsd_dev_crypto(void)
{
ENGINE *engine=ENGINE_new();
+ CONF_module_add(dev_crypto_id,init_conf,NULL);
if(!ENGINE_set_id(engine, dev_crypto_id) ||
!ENGINE_set_name(engine, dev_crypto_name) ||
!ENGINE_set_ciphers(engine, dev_crypto_ciphers) ||
@@ -385,7 +399,7 @@ static int do_digest(int ses,unsigned char *md,const void *data,int len)
if(ioctl(fd, CIOCCRYPT, &cryp) == -1)
{
- if(errno == EINVAL) /* buffer is misaligned */
+ if(errno == EINVAL && allow_misaligned) /* buffer is misaligned */
{
char *dcopy;