"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::",
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::asm/bn86-elf.o asm/co86-elf.o",
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
+"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::::",
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
# DO NOT DELETE THIS LINE -- make depend depends on it.
-aes_cbc.o: ../../include/openssl/aes.h aes_cbc.c aes_locl.h
-aes_core.o: ../../include/openssl/aes.h aes_core.c aes_locl.h
-aes_ecb.o: ../../include/openssl/aes.h aes_ecb.c aes_locl.h
-aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/opensslv.h
-aes_misc.o: aes_locl.h aes_misc.c
+aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
+aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c aes_locl.h
+aes_core.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
+aes_core.o: ../../include/openssl/opensslconf.h aes_core.c aes_locl.h
+aes_ecb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
+aes_ecb.o: ../../include/openssl/opensslconf.h aes_ecb.c aes_locl.h
+aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
+aes_misc.o: ../../include/openssl/opensslconf.h
+aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
asn1_par.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn1_par.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
asn1_par.o: ../../include/openssl/symhacks.h ../cryptlib.h asn1_par.c
+asn_moid.o: ../../e_os.h ../../include/openssl/asn1.h
+asn_moid.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
+asn_moid.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
+asn_moid.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
+asn_moid.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
+asn_moid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
+asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
+asn_moid.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
+asn_moid.o: ../../include/openssl/opensslconf.h
+asn_moid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
+asn_moid.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
+asn_moid.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
+asn_moid.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+asn_moid.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
+asn_moid.o: ../cryptlib.h asn_moid.c
asn_pack.o: ../../e_os.h ../../include/openssl/asn1.h
asn_pack.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
asn_pack.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
/* Simple ASN1 OID module: add all objects in a given section */
/* NOTE: doesn't do anything other than print debug messages yet... */
-static int oid_module_init(CONF_IMODULE *md, CONF *cnf)
+static int oid_module_init(CONF_IMODULE *md, const CONF *cnf)
{
fprintf(stderr, "Called oid_module_init: name %s, value %s\n",
CONF_imodule_get_name(md), CONF_imodule_get_value(md));
int (*destroy)(CONF *conf);
int (*destroy_data)(CONF *conf);
int (*load_bio)(CONF *conf, BIO *bp, long *eline);
- int (*dump)(CONF *conf, BIO *bp);
- int (*is_number)(CONF *conf, char c);
- int (*to_int)(CONF *conf, char c);
+ int (*dump)(const CONF *conf, BIO *bp);
+ int (*is_number)(const CONF *conf, char c);
+ int (*to_int)(const CONF *conf, char c);
int (*load)(CONF *conf, const char *name, long *eline);
};
typedef struct conf_module_st CONF_MODULE;
/* DSO module function typedefs */
-typedef int conf_init_func(CONF_IMODULE *md, CONF *cnf);
+typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf);
typedef void conf_finish_func(CONF_IMODULE *md);
#define CONF_MFLAGS_IGNORE_ERRORS 0x1
LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
#endif
LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline);
-STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section);
-char *CONF_get_string(LHASH *conf,char *group,char *name);
-long CONF_get_number(LHASH *conf,char *group,char *name);
+STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section);
+char *CONF_get_string(LHASH *conf,const char *group,const char *name);
+long CONF_get_number(LHASH *conf,const char *group,const char *name);
void CONF_free(LHASH *conf);
int CONF_dump_fp(LHASH *conf, FILE *out);
int CONF_dump_bio(LHASH *conf, BIO *out);
int NCONF_load_fp(CONF *conf, FILE *fp,long *eline);
#endif
int NCONF_load_bio(CONF *conf, BIO *bp,long *eline);
-STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section);
-char *NCONF_get_string(CONF *conf,char *group,char *name);
-int NCONF_get_number_e(CONF *conf,char *group,char *name,long *result);
-int NCONF_dump_fp(CONF *conf, FILE *out);
-int NCONF_dump_bio(CONF *conf, BIO *out);
+STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section);
+char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
+int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
+ long *result);
+int NCONF_dump_fp(const CONF *conf, FILE *out);
+int NCONF_dump_bio(const CONF *conf, BIO *out);
#if 0 /* The following function has no error checking,
and should therefore be avoided */
/* Module functions */
-int CONF_modules_load(CONF *cnf, char *appname, unsigned long flags);
-int CONF_modules_load_file(char *filename, char *appname, unsigned long flags);
+int CONF_modules_load(const CONF *cnf, const char *appname,
+ unsigned long flags);
+int CONF_modules_load_file(const char *filename, const char *appname,
+ unsigned long flags);
void CONF_modules_unload(int all);
void CONF_modules_finish(void);
int CONF_module_add(const char *name, conf_init_func *ifunc,
conf_finish_func *ffunc);
-char *CONF_imodule_get_name(CONF_IMODULE *md);
-char *CONF_imodule_get_value(CONF_IMODULE *md);
-void *CONF_imodule_get_usr_data(CONF_IMODULE *md);
+const char *CONF_imodule_get_name(const CONF_IMODULE *md);
+const char *CONF_imodule_get_value(const CONF_IMODULE *md);
+void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
-CONF_MODULE *CONF_imodule_get_module(CONF_IMODULE *md);
-unsigned long CONF_imodule_get_flags(CONF_IMODULE *md);
+CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
+unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
void *CONF_module_get_usr_data(CONF_MODULE *pmod);
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
static int cmp_conf(const void *a_void,const void *b_void);
/* Up until OpenSSL 0.9.5a, this was get_section */
-CONF_VALUE *_CONF_get_section(CONF *conf, char *section)
+CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
{
CONF_VALUE *v,vv;
if ((conf == NULL) || (section == NULL)) return(NULL);
vv.name=NULL;
- vv.section=section;
+ vv.section=(char *)section;
v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
return(v);
}
/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
-STACK_OF(CONF_VALUE) *_CONF_get_section_values(CONF *conf, char *section)
+STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
+ const char *section)
{
CONF_VALUE *v;
return 1;
}
-char *_CONF_get_string(CONF *conf, char *section, char *name)
+char *_CONF_get_string(const CONF *conf, const char *section, const char *name)
{
CONF_VALUE *v,vv;
char *p;
{
if (section != NULL)
{
- vv.name=name;
- vv.section=section;
+ vv.name=(char *)name;
+ vv.section=(char *)section;
v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
if (v != NULL) return(v->value);
if (strcmp(section,"ENV") == 0)
}
}
vv.section="default";
- vv.name=name;
+ vv.name=(char *)name;
v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
if (v != NULL)
return(v->value);
}
/* Up until OpenSSL 0.9.5a, this was new_section */
-CONF_VALUE *_CONF_new_section(CONF *conf, char *section)
+CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
{
STACK *sk=NULL;
int ok=0,i;
#endif
/* Up until OpenSSL 0.9.5a, this was new_section */
-CONF_VALUE *_CONF_new_section(CONF *conf, char *section);
+CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
/* Up until OpenSSL 0.9.5a, this was get_section */
-CONF_VALUE *_CONF_get_section(CONF *conf, char *section);
+CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
-STACK_OF(CONF_VALUE) *_CONF_get_section_values(CONF *conf, char *section);
+STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
+ const char *section);
int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
-char *_CONF_get_string(CONF *conf, char *section, char *name);
-long _CONF_get_number(CONF *conf, char *section, char *name);
+char *_CONF_get_string(const CONF *conf, const char *section,
+ const char *name);
+long _CONF_get_number(const CONF *conf, const char *section, const char *name);
int _CONF_new_data(CONF *conf);
void _CONF_free_data(CONF *conf);
static int def_destroy_data(CONF *conf);
static int def_load(CONF *conf, const char *name, long *eline);
static int def_load_bio(CONF *conf, BIO *bp, long *eline);
-static int def_dump(CONF *conf, BIO *bp);
-static int def_is_number(CONF *conf, char c);
-static int def_to_int(CONF *conf, char c);
+static int def_dump(const CONF *conf, BIO *bp);
+static int def_is_number(const CONF *conf, char c);
+static int def_to_int(const CONF *conf, char c);
const char *CONF_def_version="CONF_def" OPENSSL_VERSION_PTEXT;
static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_value, CONF_VALUE *, BIO *)
-static int def_dump(CONF *conf, BIO *out)
+static int def_dump(const CONF *conf, BIO *out)
{
lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value), out);
return 1;
}
-static int def_is_number(CONF *conf, char c)
+static int def_is_number(const CONF *conf, char c)
{
return IS_NUMBER(conf,c);
}
-static int def_to_int(CONF *conf, char c)
+static int def_to_int(const CONF *conf, char c)
{
return c - '0';
}
return NULL;
}
-STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section)
+STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section)
{
if (conf == NULL)
{
}
}
-char *CONF_get_string(LHASH *conf,char *group,char *name)
+char *CONF_get_string(LHASH *conf,const char *group,const char *name)
{
if (conf == NULL)
{
}
}
-long CONF_get_number(LHASH *conf,char *group,char *name)
+long CONF_get_number(LHASH *conf,const char *group,const char *name)
{
int status;
long result = 0;
return conf->meth->load_bio(conf, bp, eline);
}
-STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section)
+STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section)
{
if (conf == NULL)
{
return _CONF_get_section_values(conf, section);
}
-char *NCONF_get_string(CONF *conf,char *group,char *name)
+char *NCONF_get_string(const CONF *conf,const char *group,const char *name)
{
char *s = _CONF_get_string(conf, group, name);
}
CONFerr(CONF_F_NCONF_GET_STRING,
CONF_R_NO_VALUE);
+ ERR_add_error_data(4,"group=",group," name=",name);
return NULL;
}
-int NCONF_get_number_e(CONF *conf,char *group,char *name,long *result)
+int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
+ long *result)
{
char *str;
}
#ifndef OPENSSL_NO_FP_API
-int NCONF_dump_fp(CONF *conf, FILE *out)
+int NCONF_dump_fp(const CONF *conf, FILE *out)
{
BIO *btmp;
int ret;
}
#endif
-int NCONF_dump_bio(CONF *conf, BIO *out)
+int NCONF_dump_bio(const CONF *conf, BIO *out)
{
if (conf == NULL)
{
static void module_free(CONF_MODULE *md);
static void module_finish(CONF_IMODULE *imod);
-static int module_run(CONF *cnf, char *name, char *value, unsigned long flags);
+static int module_run(const CONF *cnf, char *name, char *value,
+ unsigned long flags);
static CONF_MODULE *module_add(DSO *dso, const char *name,
conf_init_func *ifunc, conf_finish_func *ffunc);
static CONF_MODULE *module_find(char *name);
-static int module_init(CONF_MODULE *pmod, char *name, char *value, CONF *cnf);
-static CONF_MODULE *module_load_dso(CONF *cnf, char *name, char *value, unsigned long flags);
+static int module_init(CONF_MODULE *pmod, char *name, char *value,
+ const CONF *cnf);
+static CONF_MODULE *module_load_dso(const CONF *cnf, char *name, char *value,
+ unsigned long flags);
/* Main function: load modules from a CONF structure */
-int CONF_modules_load(CONF *cnf, char *appname, unsigned long flags)
+int CONF_modules_load(const CONF *cnf, const char *appname,
+ unsigned long flags)
{
STACK_OF(CONF_VALUE) *values;
CONF_VALUE *vl;
}
-int CONF_modules_load_file(char *filename, char *appname, unsigned long flags)
+int CONF_modules_load_file(const char *filename, const char *appname,
+ unsigned long flags)
{
CONF *conf = NULL;
int ret = 0;
return ret;
}
-static int module_run(CONF *cnf, char *name, char *value, unsigned long flags)
+static int module_run(const CONF *cnf, char *name, char *value,
+ unsigned long flags)
{
CONF_MODULE *md;
int ret;
}
/* Load a module from a DSO */
-static CONF_MODULE *module_load_dso(CONF *cnf, char *name, char *value, unsigned long flags)
+static CONF_MODULE *module_load_dso(const CONF *cnf, char *name, char *value,
+ unsigned long flags)
{
DSO *dso = NULL;
conf_init_func *ifunc;
/* add module to list */
static CONF_MODULE *module_add(DSO *dso, const char *name,
- conf_init_func *ifunc, conf_finish_func *ffunc)
+ conf_init_func *ifunc, conf_finish_func *ffunc)
{
CONF_MODULE *tmod = NULL;
if (supported_modules == NULL)
}
/* initialize a module */
-static int module_init(CONF_MODULE *pmod, char *name, char *value, CONF *cnf)
+static int module_init(CONF_MODULE *pmod, char *name, char *value,
+ const CONF *cnf)
{
int ret = 1;
int init_called = 0;
/* Utility functions */
-char *CONF_imodule_get_name(CONF_IMODULE *md)
+const char *CONF_imodule_get_name(const CONF_IMODULE *md)
{
return md->name;
}
-char *CONF_imodule_get_value(CONF_IMODULE *md)
+const char *CONF_imodule_get_value(const CONF_IMODULE *md)
{
return md->value;
}
-void *CONF_imodule_get_usr_data(CONF_IMODULE *md)
+void *CONF_imodule_get_usr_data(const CONF_IMODULE *md)
{
return md->usr_data;
}
md->usr_data = usr_data;
}
-CONF_MODULE *CONF_imodule_get_module(CONF_IMODULE *md)
+CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md)
{
return md->pmod;
}
-unsigned long CONF_imodule_get_flags(CONF_IMODULE *md)
+unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md)
{
return md->flags;
}
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
#else
#include "../evp/evp_locl.h"
#endif
+#include <openssl/conf.h>
#ifndef OPENSSL_OPENBSD_DEV_CRYPTO
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) ||
if(ioctl(fd, CIOCCRYPT, &cryp) == -1)
{
- if(errno == EINVAL) /* buffer is misaligned */
+ if(errno == EINVAL && allow_misaligned) /* buffer is misaligned */
{
char *dcopy;
* because sometimes only copies of the context are ever finalised.
*/
if (ctx->digest && ctx->digest->cleanup
- && !EVP_MD_CTX_test_flags(ctx,EVP_MD_CTX_FLAG_CLEANED))
+ && !EVP_MD_CTX_test_flags(ctx,EVP_MD_CTX_FLAG_CLEANED))
ctx->digest->cleanup(ctx);
if (ctx->digest && ctx->digest->ctx_size && ctx->md_data)
{
#include <string.h>
#include <openssl/evp.h>
#include <openssl/engine.h>
+#include <openssl/conf.h>
static void hexdump(FILE *f,const char *title,const unsigned char *s,int l)
{
OpenSSL_add_all_digests();
/* Load all compiled-in ENGINEs */
ENGINE_load_builtin_engines();
+ OPENSSL_config();
/* Register all available ENGINE implementations of ciphers and digests.
* This could perhaps be changed to "ENGINE_register_all_complete()"? */
ENGINE_register_all_ciphers();