summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/src/apps/apps.h18
-rw-r--r--src/lib/libssl/src/apps/openssl.c4
-rw-r--r--src/lib/libssl/src/apps/req.c23
-rw-r--r--src/lib/libssl/src/apps/s_server.c6
-rw-r--r--src/usr.sbin/openssl/Makefile4
5 files changed, 3 insertions, 52 deletions
diff --git a/src/lib/libssl/src/apps/apps.h b/src/lib/libssl/src/apps/apps.h
index b2e78e12fb..ad8ae9d146 100644
--- a/src/lib/libssl/src/apps/apps.h
+++ b/src/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,
137 * (see e_os.h). The string is 137 * (see e_os.h). The string is
138 * destroyed! */ 138 * destroyed! */
139 139
140#ifndef MONOLITH
141
142#define MAIN(a,v) main(a,v)
143
144#ifndef NON_MAIN
145CONF *config = NULL;
146BIO *bio_err = NULL;
147#else
148extern CONF *config;
149extern BIO *bio_err;
150#endif
151
152#else
153
154#define MAIN(a,v) PROG(a,v) 140#define MAIN(a,v) PROG(a,v)
155extern CONF *config; 141extern CONF *config;
156extern char *default_config_file; 142extern char *default_config_file;
157extern BIO *bio_err; 143extern BIO *bio_err;
158 144
159#endif
160
161#include <signal.h> 145#include <signal.h>
162 146
163#define do_pipe_sig() signal(SIGPIPE,SIG_IGN) 147#define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
@@ -168,7 +152,7 @@ extern BIO *bio_err;
168#define zlib_cleanup() COMP_zlib_cleanup() 152#define zlib_cleanup() COMP_zlib_cleanup()
169#endif 153#endif
170 154
171#if defined(MONOLITH) && !defined(OPENSSL_C) 155#if !defined(OPENSSL_C)
172# define apps_startup() \ 156# define apps_startup() \
173 do_pipe_sig() 157 do_pipe_sig()
174# define apps_shutdown() 158# define apps_shutdown()
diff --git a/src/lib/libssl/src/apps/openssl.c b/src/lib/libssl/src/apps/openssl.c
index 8f0d11ddd5..0221eb0085 100644
--- a/src/lib/libssl/src/apps/openssl.c
+++ b/src/lib/libssl/src/apps/openssl.c
@@ -145,12 +145,8 @@ static void list_cipher(BIO *out);
145static void list_md(BIO *out); 145static void list_md(BIO *out);
146char *default_config_file=NULL; 146char *default_config_file=NULL;
147 147
148/* Make sure there is only one when MONOLITH is defined */
149#ifdef MONOLITH
150CONF *config=NULL; 148CONF *config=NULL;
151BIO *bio_err=NULL; 149BIO *bio_err=NULL;
152#endif
153
154 150
155static void lock_dbg_cb(int mode, int type, const char *file, int line) 151static void lock_dbg_cb(int mode, int type, const char *file, int line)
156 { 152 {
diff --git a/src/lib/libssl/src/apps/req.c b/src/lib/libssl/src/apps/req.c
index 690ec0d625..d28a1f3258 100644
--- a/src/lib/libssl/src/apps/req.c
+++ b/src/lib/libssl/src/apps/req.c
@@ -147,9 +147,6 @@ static int check_end(const char *str, const char *end);
147static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type, 147static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
148 long *pkeylen, char **palgnam, 148 long *pkeylen, char **palgnam,
149 ENGINE *keygen_engine); 149 ENGINE *keygen_engine);
150#ifndef MONOLITH
151static char *default_config_file=NULL;
152#endif
153static CONF *req_conf=NULL; 150static CONF *req_conf=NULL;
154static int batch=0; 151static int batch=0;
155 152
@@ -189,10 +186,6 @@ int MAIN(int argc, char **argv)
189 int multirdn = 0; 186 int multirdn = 0;
190 const EVP_MD *md_alg=NULL,*digest=NULL; 187 const EVP_MD *md_alg=NULL,*digest=NULL;
191 unsigned long chtype = MBSTRING_ASC; 188 unsigned long chtype = MBSTRING_ASC;
192#ifndef MONOLITH
193 char *to_free;
194 long errline;
195#endif
196 189
197 req_conf = NULL; 190 req_conf = NULL;
198#ifndef OPENSSL_NO_DES 191#ifndef OPENSSL_NO_DES
@@ -456,18 +449,6 @@ bad:
456 goto end; 449 goto end;
457 } 450 }
458 451
459#ifndef MONOLITH /* else this has happened in openssl.c (global `config') */
460 /* Lets load up our environment a little */
461 p=getenv("OPENSSL_CONF");
462 if (p == NULL)
463 p=getenv("SSLEAY_CONF");
464 if (p == NULL)
465 p=to_free=make_config_name();
466 default_config_file=p;
467 config=NCONF_new(NULL);
468 i=NCONF_load(config, p, &errline);
469#endif
470
471 if (template != NULL) 452 if (template != NULL)
472 { 453 {
473 long errline = -1; 454 long errline = -1;
@@ -1066,10 +1047,6 @@ loop:
1066 } 1047 }
1067 ex=0; 1048 ex=0;
1068end: 1049end:
1069#ifndef MONOLITH
1070 if(to_free)
1071 free(to_free);
1072#endif
1073 if (ex) 1050 if (ex)
1074 { 1051 {
1075 ERR_print_errors(bio_err); 1052 ERR_print_errors(bio_err);
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c
index ca1873d9e4..7fafe56359 100644
--- a/src/lib/libssl/src/apps/s_server.c
+++ b/src/lib/libssl/src/apps/s_server.c
@@ -199,9 +199,7 @@ static DH *load_dh_param(const char *dhfile);
199static DH *get_dh512(void); 199static DH *get_dh512(void);
200#endif 200#endif
201 201
202#ifdef MONOLITH
203static void s_server_init(void); 202static void s_server_init(void);
204#endif
205 203
206#ifndef OPENSSL_NO_DH 204#ifndef OPENSSL_NO_DH
207static unsigned char dh512_p[]={ 205static unsigned char dh512_p[]={
@@ -404,7 +402,6 @@ static int ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
404 402
405#endif 403#endif
406 404
407#ifdef MONOLITH
408static void s_server_init(void) 405static void s_server_init(void)
409 { 406 {
410 accept_socket=-1; 407 accept_socket=-1;
@@ -435,7 +432,6 @@ static void s_server_init(void)
435 engine_id=NULL; 432 engine_id=NULL;
436#endif 433#endif
437 } 434 }
438#endif
439 435
440static void sv_usage(void) 436static void sv_usage(void)
441 { 437 {
@@ -811,9 +807,7 @@ int MAIN(int argc, char *argv[])
811 local_argv=argv; 807 local_argv=argv;
812 808
813 apps_startup(); 809 apps_startup();
814#ifdef MONOLITH
815 s_server_init(); 810 s_server_init();
816#endif
817 811
818 if (bio_err == NULL) 812 if (bio_err == NULL)
819 bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); 813 bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
diff --git a/src/usr.sbin/openssl/Makefile b/src/usr.sbin/openssl/Makefile
index 5b050ae548..2a2df8f2e6 100644
--- a/src/usr.sbin/openssl/Makefile
+++ b/src/usr.sbin/openssl/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.24 2014/04/17 20:46:29 tedu Exp $ 1# $OpenBSD: Makefile,v 1.25 2014/04/17 22:44:34 matthew Exp $
2 2
3PROG= openssl 3PROG= openssl
4LDADD= -lssl -lcrypto 4LDADD= -lssl -lcrypto
@@ -10,7 +10,7 @@ SSLEAY_SRC= ${.CURDIR}/../../${SSLEAYDIST}/apps
10SSLEAY_SRC_TOP= ${.CURDIR}/../../${SSLEAYDIST} 10SSLEAY_SRC_TOP= ${.CURDIR}/../../${SSLEAYDIST}
11 11
12CFLAGS+= -Wall 12CFLAGS+= -Wall
13CFLAGS+= -DMONOLITH -DTERMIOS -DANSI_SOURCE -DOPENSSL_NO_RC5 13CFLAGS+= -DTERMIOS -DANSI_SOURCE -DOPENSSL_NO_RC5
14CFLAGS+= -DOPENSSL_NO_SSL2 14CFLAGS+= -DOPENSSL_NO_SSL2
15CFLAGS+= -I${SSLEAY_SRC_TOP} 15CFLAGS+= -I${SSLEAY_SRC_TOP}
16 16