diff options
author | Ben Laurie <ben@openssl.org> | 2002-01-22 22:29:58 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2002-01-22 22:29:58 +0000 |
commit | 0fc5cf0870c0c9e4240e118ee7a86e5d8b4a6891 (patch) | |
tree | a607373c3d631901191b83a22b04fa96b3e34a62 /crypto/engine | |
parent | f78d4a35f865d7678a8b8e7a496e72a19f3df014 (diff) |
Make no config file not an error. Move /dev/crypto config to ctrl.
Diffstat (limited to 'crypto/engine')
-rw-r--r-- | crypto/engine/hw_openbsd_dev_crypto.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/crypto/engine/hw_openbsd_dev_crypto.c b/crypto/engine/hw_openbsd_dev_crypto.c index 8085323ed1..f946389b8a 100644 --- a/crypto/engine/hw_openbsd_dev_crypto.c +++ b/crypto/engine/hw_openbsd_dev_crypto.c @@ -96,12 +96,25 @@ static const char dev_crypto_name[] = "OpenBSD /dev/crypto"; static long allow_misaligned; -static int init_conf(CONF_IMODULE *md,const CONF *conf) +#define DEV_CRYPTO_CMD_ALLOW_MISALIGNED ENGINE_CMD_BASE +static const ENGINE_CMD_DEFN dev_crypto_cmd_defns[]= { - if(!NCONF_get_number(conf,CONF_imodule_get_value(md),"allow_misaligned", - &allow_misaligned)) - return 0; - printf("allow misaligned=%ld\n",allow_misaligned); + { DEV_CRYPTO_CMD_ALLOW_MISALIGNED, + "allow_misaligned", + "Permit misaligned data to be used", + ENGINE_CMD_FLAG_NUMERIC }, + { 0, NULL, NULL, 0 } + }; + +static int dev_crypto_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()) + { + switch(cmd) + { + case DEV_CRYPTO_CMD_ALLOW_MISALIGNED: + allow_misaligned=i; + printf("allow misaligned=%ld\n",allow_misaligned); + break; + } return 1; } @@ -110,11 +123,12 @@ 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) || - !ENGINE_set_digests(engine, dev_crypto_digests)) + !ENGINE_set_name(engine, dev_crypto_name) || + !ENGINE_set_ciphers(engine, dev_crypto_ciphers) || + !ENGINE_set_digests(engine, dev_crypto_digests) || + !ENGINE_set_ctrl_function(engine, dev_crypto_ctrl) || + !ENGINE_set_cmd_defns(engine, dev_crypto_cmd_defns)) { ENGINE_free(engine); return NULL; |