From: matthew Date: Thu, 17 Apr 2014 22:44:34 +0000 (+0000) Subject: Make MONOLITH the default and only option X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0ee438ed1182794a4e3f9f04895f3f3ae3107303;p=openbsd Make MONOLITH the default and only option ok deraadt --- diff --git a/lib/libssl/src/apps/apps.h b/lib/libssl/src/apps/apps.h index b2e78e12fb5..ad8ae9d146b 100644 --- a/lib/libssl/src/apps/apps.h +++ b/lib/libssl/src/apps/apps.h @@ -137,27 +137,11 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read, * (see e_os.h). The string is * destroyed! */ -#ifndef MONOLITH - -#define MAIN(a,v) main(a,v) - -#ifndef NON_MAIN -CONF *config = NULL; -BIO *bio_err = NULL; -#else -extern CONF *config; -extern BIO *bio_err; -#endif - -#else - #define MAIN(a,v) PROG(a,v) extern CONF *config; extern char *default_config_file; extern BIO *bio_err; -#endif - #include #define do_pipe_sig() signal(SIGPIPE,SIG_IGN) @@ -168,7 +152,7 @@ extern BIO *bio_err; #define zlib_cleanup() COMP_zlib_cleanup() #endif -#if defined(MONOLITH) && !defined(OPENSSL_C) +#if !defined(OPENSSL_C) # define apps_startup() \ do_pipe_sig() # define apps_shutdown() diff --git a/lib/libssl/src/apps/openssl.c b/lib/libssl/src/apps/openssl.c index 8f0d11ddd57..0221eb00850 100644 --- a/lib/libssl/src/apps/openssl.c +++ b/lib/libssl/src/apps/openssl.c @@ -145,12 +145,8 @@ static void list_cipher(BIO *out); static void list_md(BIO *out); char *default_config_file=NULL; -/* Make sure there is only one when MONOLITH is defined */ -#ifdef MONOLITH CONF *config=NULL; BIO *bio_err=NULL; -#endif - static void lock_dbg_cb(int mode, int type, const char *file, int line) { diff --git a/lib/libssl/src/apps/req.c b/lib/libssl/src/apps/req.c index 690ec0d625d..d28a1f32585 100644 --- a/lib/libssl/src/apps/req.c +++ b/lib/libssl/src/apps/req.c @@ -147,9 +147,6 @@ static int check_end(const char *str, const char *end); static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type, long *pkeylen, char **palgnam, ENGINE *keygen_engine); -#ifndef MONOLITH -static char *default_config_file=NULL; -#endif static CONF *req_conf=NULL; static int batch=0; @@ -189,10 +186,6 @@ int MAIN(int argc, char **argv) int multirdn = 0; const EVP_MD *md_alg=NULL,*digest=NULL; unsigned long chtype = MBSTRING_ASC; -#ifndef MONOLITH - char *to_free; - long errline; -#endif req_conf = NULL; #ifndef OPENSSL_NO_DES @@ -456,18 +449,6 @@ bad: goto end; } -#ifndef MONOLITH /* else this has happened in openssl.c (global `config') */ - /* Lets load up our environment a little */ - p=getenv("OPENSSL_CONF"); - if (p == NULL) - p=getenv("SSLEAY_CONF"); - if (p == NULL) - p=to_free=make_config_name(); - default_config_file=p; - config=NCONF_new(NULL); - i=NCONF_load(config, p, &errline); -#endif - if (template != NULL) { long errline = -1; @@ -1066,10 +1047,6 @@ loop: } ex=0; end: -#ifndef MONOLITH - if(to_free) - free(to_free); -#endif if (ex) { ERR_print_errors(bio_err); diff --git a/lib/libssl/src/apps/s_server.c b/lib/libssl/src/apps/s_server.c index ca1873d9e47..7fafe563594 100644 --- a/lib/libssl/src/apps/s_server.c +++ b/lib/libssl/src/apps/s_server.c @@ -199,9 +199,7 @@ static DH *load_dh_param(const char *dhfile); static DH *get_dh512(void); #endif -#ifdef MONOLITH static void s_server_init(void); -#endif #ifndef OPENSSL_NO_DH static unsigned char dh512_p[]={ @@ -404,7 +402,6 @@ static int ssl_srp_server_param_cb(SSL *s, int *ad, void *arg) #endif -#ifdef MONOLITH static void s_server_init(void) { accept_socket=-1; @@ -435,7 +432,6 @@ static void s_server_init(void) engine_id=NULL; #endif } -#endif static void sv_usage(void) { @@ -811,9 +807,7 @@ int MAIN(int argc, char *argv[]) local_argv=argv; apps_startup(); -#ifdef MONOLITH s_server_init(); -#endif if (bio_err == NULL) bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); diff --git a/usr.sbin/openssl/Makefile b/usr.sbin/openssl/Makefile index 5b050ae548e..2a2df8f2e6d 100644 --- a/usr.sbin/openssl/Makefile +++ b/usr.sbin/openssl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.24 2014/04/17 20:46:29 tedu Exp $ +# $OpenBSD: Makefile,v 1.25 2014/04/17 22:44:34 matthew Exp $ PROG= openssl LDADD= -lssl -lcrypto @@ -10,7 +10,7 @@ SSLEAY_SRC= ${.CURDIR}/../../${SSLEAYDIST}/apps SSLEAY_SRC_TOP= ${.CURDIR}/../../${SSLEAYDIST} CFLAGS+= -Wall -CFLAGS+= -DMONOLITH -DTERMIOS -DANSI_SOURCE -DOPENSSL_NO_RC5 +CFLAGS+= -DTERMIOS -DANSI_SOURCE -DOPENSSL_NO_RC5 CFLAGS+= -DOPENSSL_NO_SSL2 CFLAGS+= -I${SSLEAY_SRC_TOP}