summaryrefslogtreecommitdiffstats
path: root/lib/libssl
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-04-17 20:58:07 +0000
committerderaadt <deraadt@openbsd.org>2014-04-17 20:58:07 +0000
commitedd82e4a5ad934c58f2008341548027dc317a2ba (patch)
tree007c3eb7b0de757e045780a8dc87a582eaf9dfca /lib/libssl
parentmalloc + memset 0 -> calloc (diff)
downloadwireguard-openbsd-edd82e4a5ad934c58f2008341548027dc317a2ba.tar.xz
wireguard-openbsd-edd82e4a5ad934c58f2008341548027dc317a2ba.zip
Mostly gut e_os.h:
USE_SOCKETS is unrelated to using sockets, but just pulls in .h files. It makes every file buy a kitchen sink, because 11 files forgot to. EXIT() is really exit(), a gentle surprise but... OPENSSL_EXIT() is really just return(), because noone compiles the openssl command non-monolithic anymore
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/s3_pkt.c1
-rw-r--r--lib/libssl/src/apps/app_rand.c2
-rw-r--r--lib/libssl/src/apps/asn1pars.c2
-rw-r--r--lib/libssl/src/apps/ca.c2
-rw-r--r--lib/libssl/src/apps/ciphers.c2
-rw-r--r--lib/libssl/src/apps/crl.c2
-rw-r--r--lib/libssl/src/apps/crl2p7.c2
-rw-r--r--lib/libssl/src/apps/dgst.c2
-rw-r--r--lib/libssl/src/apps/dh.c2
-rw-r--r--lib/libssl/src/apps/dhparam.c4
-rw-r--r--lib/libssl/src/apps/dsa.c2
-rw-r--r--lib/libssl/src/apps/dsaparam.c2
-rw-r--r--lib/libssl/src/apps/ec.c2
-rw-r--r--lib/libssl/src/apps/ecparam.c2
-rw-r--r--lib/libssl/src/apps/enc.c2
-rw-r--r--lib/libssl/src/apps/engine.c2
-rw-r--r--lib/libssl/src/apps/errstr.c2
-rw-r--r--lib/libssl/src/apps/gendh.c4
-rw-r--r--lib/libssl/src/apps/gendsa.c4
-rw-r--r--lib/libssl/src/apps/genrsa.c4
-rw-r--r--lib/libssl/src/apps/nseq.c4
-rw-r--r--lib/libssl/src/apps/ocsp.c4
-rw-r--r--lib/libssl/src/apps/openssl.c7
-rw-r--r--lib/libssl/src/apps/passwd.c4
-rw-r--r--lib/libssl/src/apps/pkcs12.c4
-rw-r--r--lib/libssl/src/apps/pkcs7.c2
-rw-r--r--lib/libssl/src/apps/rand.c4
-rw-r--r--lib/libssl/src/apps/req.c4
-rw-r--r--lib/libssl/src/apps/rsa.c2
-rw-r--r--lib/libssl/src/apps/s_cb.c6
-rw-r--r--lib/libssl/src/apps/s_client.c9
-rw-r--r--lib/libssl/src/apps/s_server.c6
-rw-r--r--lib/libssl/src/apps/s_socket.c5
-rw-r--r--lib/libssl/src/apps/s_time.c4
-rw-r--r--lib/libssl/src/apps/sess_id.c2
-rw-r--r--lib/libssl/src/apps/smime.c2
-rw-r--r--lib/libssl/src/apps/speed.c2
-rw-r--r--lib/libssl/src/apps/spkac.c2
-rw-r--r--lib/libssl/src/apps/srp.c2
-rw-r--r--lib/libssl/src/apps/ts.c4
-rw-r--r--lib/libssl/src/apps/verify.c2
-rw-r--r--lib/libssl/src/apps/version.c2
-rw-r--r--lib/libssl/src/apps/x509.c2
-rw-r--r--lib/libssl/src/crypto/bio/b_sock.c11
-rw-r--r--lib/libssl/src/crypto/bio/bss_acpt.c2
-rw-r--r--lib/libssl/src/crypto/bio/bss_conn.c4
-rw-r--r--lib/libssl/src/crypto/bio/bss_dgram.c6
-rw-r--r--lib/libssl/src/crypto/bio/bss_fd.c1
-rw-r--r--lib/libssl/src/crypto/bio/bss_sock.c2
-rw-r--r--lib/libssl/src/crypto/x509/by_dir.c2
-rw-r--r--lib/libssl/src/e_os.h50
-rw-r--r--lib/libssl/src/ssl/s3_pkt.c1
52 files changed, 91 insertions, 120 deletions
diff --git a/lib/libssl/s3_pkt.c b/lib/libssl/s3_pkt.c
index c9a7b6cf073..d6c8756a1ac 100644
--- a/lib/libssl/s3_pkt.c
+++ b/lib/libssl/s3_pkt.c
@@ -111,7 +111,6 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "ssl_locl.h"
#include <openssl/evp.h>
#include <openssl/buffer.h>
diff --git a/lib/libssl/src/apps/app_rand.c b/lib/libssl/src/apps/app_rand.c
index 59fab2e269b..0dbec7d595f 100644
--- a/lib/libssl/src/apps/app_rand.c
+++ b/lib/libssl/src/apps/app_rand.c
@@ -164,7 +164,7 @@ app_RAND_load_files(char *name)
for (;;) {
last = 0;
for (p = name;
- ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
+ ((*p != '\0') && (*p != ':')); p++);
if (*p == '\0')
last = 1;
*p = '\0';
diff --git a/lib/libssl/src/apps/asn1pars.c b/lib/libssl/src/apps/asn1pars.c
index 246308f1279..95fc88d6443 100644
--- a/lib/libssl/src/apps/asn1pars.c
+++ b/lib/libssl/src/apps/asn1pars.c
@@ -355,7 +355,7 @@ end:
sk_OPENSSL_STRING_free(osk);
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
diff --git a/lib/libssl/src/apps/ca.c b/lib/libssl/src/apps/ca.c
index 9c75e1a4f4b..cd3304717bc 100644
--- a/lib/libssl/src/apps/ca.c
+++ b/lib/libssl/src/apps/ca.c
@@ -1411,7 +1411,7 @@ err:
NCONF_free(extconf);
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static void
diff --git a/lib/libssl/src/apps/ciphers.c b/lib/libssl/src/apps/ciphers.c
index fb798a440c2..1586dc5383f 100644
--- a/lib/libssl/src/apps/ciphers.c
+++ b/lib/libssl/src/apps/ciphers.c
@@ -204,5 +204,5 @@ end:
if (STDout != NULL)
BIO_free_all(STDout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/crl.c b/lib/libssl/src/apps/crl.c
index 58c711813f7..c89b8818a80 100644
--- a/lib/libssl/src/apps/crl.c
+++ b/lib/libssl/src/apps/crl.c
@@ -385,7 +385,7 @@ end:
X509_STORE_free(store);
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static X509_CRL *
diff --git a/lib/libssl/src/apps/crl2p7.c b/lib/libssl/src/apps/crl2p7.c
index bfd2d81e880..ce782742c4c 100644
--- a/lib/libssl/src/apps/crl2p7.c
+++ b/lib/libssl/src/apps/crl2p7.c
@@ -262,7 +262,7 @@ end:
X509_CRL_free(crl);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
/*
diff --git a/lib/libssl/src/apps/dgst.c b/lib/libssl/src/apps/dgst.c
index c024229c58b..4a4fa6ff555 100644
--- a/lib/libssl/src/apps/dgst.c
+++ b/lib/libssl/src/apps/dgst.c
@@ -507,7 +507,7 @@ end:
if (bmd != NULL)
BIO_free(bmd);
apps_shutdown();
- OPENSSL_EXIT(err);
+ exit(err);
}
int
diff --git a/lib/libssl/src/apps/dh.c b/lib/libssl/src/apps/dh.c
index f362c5aeddb..109a6c0d40b 100644
--- a/lib/libssl/src/apps/dh.c
+++ b/lib/libssl/src/apps/dh.c
@@ -322,7 +322,7 @@ end:
if (dh != NULL)
DH_free(dh);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_DH */
diff --git a/lib/libssl/src/apps/dhparam.c b/lib/libssl/src/apps/dhparam.c
index 9e1b2144584..c86d5ef0403 100644
--- a/lib/libssl/src/apps/dhparam.c
+++ b/lib/libssl/src/apps/dhparam.c
@@ -253,7 +253,7 @@ bad:
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, " -engine e use engine e, possibly a hardware device.\n");
#endif
- BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, " -rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err, " - load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
BIO_printf(bio_err, " -noout no output\n");
@@ -494,7 +494,7 @@ end:
if (dh != NULL)
DH_free(dh);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
diff --git a/lib/libssl/src/apps/dsa.c b/lib/libssl/src/apps/dsa.c
index 3dad04317f9..37b9a3ffb06 100644
--- a/lib/libssl/src/apps/dsa.c
+++ b/lib/libssl/src/apps/dsa.c
@@ -350,7 +350,7 @@ end:
if (passout)
free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_DSA */
diff --git a/lib/libssl/src/apps/dsaparam.c b/lib/libssl/src/apps/dsaparam.c
index 81ac16b717d..1efa02fbcfd 100644
--- a/lib/libssl/src/apps/dsaparam.c
+++ b/lib/libssl/src/apps/dsaparam.c
@@ -420,7 +420,7 @@ end:
if (dsa != NULL)
DSA_free(dsa);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
diff --git a/lib/libssl/src/apps/ec.c b/lib/libssl/src/apps/ec.c
index f64608e9c39..8575ba96821 100644
--- a/lib/libssl/src/apps/ec.c
+++ b/lib/libssl/src/apps/ec.c
@@ -353,7 +353,7 @@ end:
if (passout)
free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_EC */
diff --git a/lib/libssl/src/apps/ecparam.c b/lib/libssl/src/apps/ecparam.c
index e2b3beee6ff..1e7020ca7a8 100644
--- a/lib/libssl/src/apps/ecparam.c
+++ b/lib/libssl/src/apps/ecparam.c
@@ -689,7 +689,7 @@ end:
if (group != NULL)
EC_GROUP_free(group);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
diff --git a/lib/libssl/src/apps/enc.c b/lib/libssl/src/apps/enc.c
index 22f431ff1a2..11768dbe3af 100644
--- a/lib/libssl/src/apps/enc.c
+++ b/lib/libssl/src/apps/enc.c
@@ -686,7 +686,7 @@ end:
#endif
if(pass) free(pass);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
int set_hex(char *in, unsigned char *out, int size)
diff --git a/lib/libssl/src/apps/engine.c b/lib/libssl/src/apps/engine.c
index be07889d600..b9f3121b9fb 100644
--- a/lib/libssl/src/apps/engine.c
+++ b/lib/libssl/src/apps/engine.c
@@ -532,7 +532,7 @@ end:
sk_OPENSSL_STRING_pop_free(post_cmds, identity);
if (bio_out != NULL) BIO_free_all(bio_out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else
diff --git a/lib/libssl/src/apps/errstr.c b/lib/libssl/src/apps/errstr.c
index 00c489be0e9..2a26c4ed156 100644
--- a/lib/libssl/src/apps/errstr.c
+++ b/lib/libssl/src/apps/errstr.c
@@ -114,5 +114,5 @@ MAIN(int argc, char **argv)
}
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/gendh.c b/lib/libssl/src/apps/gendh.c
index 00c31cf40d2..531e37a25b0 100644
--- a/lib/libssl/src/apps/gendh.c
+++ b/lib/libssl/src/apps/gendh.c
@@ -151,7 +151,7 @@ bad:
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, " -engine e - use engine e, possibly a hardware device.\n");
#endif
- BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, " -rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err, " - load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
goto end;
@@ -202,7 +202,7 @@ end:
if (dh != NULL)
DH_free(dh);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
diff --git a/lib/libssl/src/apps/gendsa.c b/lib/libssl/src/apps/gendsa.c
index 17dbd9d6d3a..c4e5415cdc1 100644
--- a/lib/libssl/src/apps/gendsa.c
+++ b/lib/libssl/src/apps/gendsa.c
@@ -190,7 +190,7 @@ bad:
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, " -engine e - use engine e, possibly a hardware device.\n");
#endif
- BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, " -rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err, " - load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
BIO_printf(bio_err, " dsaparam-file\n");
@@ -263,7 +263,7 @@ end:
if (passout)
free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_DSA */
diff --git a/lib/libssl/src/apps/genrsa.c b/lib/libssl/src/apps/genrsa.c
index 65e136a8d26..e6e9877cb93 100644
--- a/lib/libssl/src/apps/genrsa.c
+++ b/lib/libssl/src/apps/genrsa.c
@@ -215,7 +215,7 @@ bad:
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, " -engine e use engine e, possibly a hardware device.\n");
#endif
- BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, " -rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
goto err;
@@ -296,7 +296,7 @@ err:
if (ret != 0)
ERR_print_errors(bio_err);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
diff --git a/lib/libssl/src/apps/nseq.c b/lib/libssl/src/apps/nseq.c
index 4abb436f5d6..a965f1d703a 100644
--- a/lib/libssl/src/apps/nseq.c
+++ b/lib/libssl/src/apps/nseq.c
@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-in file input file\n");
BIO_printf (bio_err, "-out file output file\n");
BIO_printf (bio_err, "-toseq output NS Sequence file\n");
- OPENSSL_EXIT(1);
+ exit(1);
}
if (infile) {
@@ -156,6 +156,6 @@ end:
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/ocsp.c b/lib/libssl/src/apps/ocsp.c
index dff47ba41b6..170bcac1c3c 100644
--- a/lib/libssl/src/apps/ocsp.c
+++ b/lib/libssl/src/apps/ocsp.c
@@ -57,8 +57,6 @@
*/
#ifndef OPENSSL_NO_OCSP
-#define USE_SOCKETS
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -922,7 +920,7 @@ end:
free(path);
}
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_md,X509 *issuer,
diff --git a/lib/libssl/src/apps/openssl.c b/lib/libssl/src/apps/openssl.c
index fd730ce97ef..8f0d11ddd57 100644
--- a/lib/libssl/src/apps/openssl.c
+++ b/lib/libssl/src/apps/openssl.c
@@ -126,7 +126,6 @@
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
-#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
#include "progs.h"
#include "s_apps.h"
#include <openssl/err.h>
@@ -267,11 +266,11 @@ int main(int Argc, char *ARGV[])
if (!FIPS_mode_set(1)) {
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- EXIT(1);
+ exit(1);
}
#else
fprintf(stderr, "FIPS mode not supported.\n");
- EXIT(1);
+ exit(1);
#endif
}
@@ -391,7 +390,7 @@ end:
BIO_free(bio_err);
bio_err=NULL;
}
- OPENSSL_EXIT(ret);
+ return(ret);
}
#define LIST_STANDARD_COMMANDS "list-standard-commands"
diff --git a/lib/libssl/src/apps/passwd.c b/lib/libssl/src/apps/passwd.c
index b26bdbf4c72..ea62a14487d 100644
--- a/lib/libssl/src/apps/passwd.c
+++ b/lib/libssl/src/apps/passwd.c
@@ -286,7 +286,7 @@ err:
if (out)
BIO_free_all(out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
@@ -497,6 +497,6 @@ err:
int MAIN(int argc, char **argv)
{
fputs("Program not available.\n", stderr)
- OPENSSL_EXIT(1);
+ exit(1);
}
#endif
diff --git a/lib/libssl/src/apps/pkcs12.c b/lib/libssl/src/apps/pkcs12.c
index 97947186750..74d063ef5e4 100644
--- a/lib/libssl/src/apps/pkcs12.c
+++ b/lib/libssl/src/apps/pkcs12.c
@@ -335,7 +335,7 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_ENGINE
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
#endif
- BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, "-rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
BIO_printf(bio_err, "-CSP name Microsoft CSP name\n");
@@ -692,7 +692,7 @@ int MAIN(int argc, char **argv)
if(passin) free(passin);
if(passout) free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ exit(ret);
}
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
diff --git a/lib/libssl/src/apps/pkcs7.c b/lib/libssl/src/apps/pkcs7.c
index 272bf11f24d..8a0e878e49e 100644
--- a/lib/libssl/src/apps/pkcs7.c
+++ b/lib/libssl/src/apps/pkcs7.c
@@ -310,5 +310,5 @@ end:
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/rand.c b/lib/libssl/src/apps/rand.c
index 884c244486a..c01df530ae1 100644
--- a/lib/libssl/src/apps/rand.c
+++ b/lib/libssl/src/apps/rand.c
@@ -168,7 +168,7 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
#endif
- BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", ':', ':');
BIO_printf(bio_err, "-base64 - base64 encode output\n");
BIO_printf(bio_err, "-hex - hex encode output\n");
goto err;
@@ -235,5 +235,5 @@ err:
if (out)
BIO_free_all(out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/req.c b/lib/libssl/src/apps/req.c
index 3374626e63d..22302c5c303 100644
--- a/lib/libssl/src/apps/req.c
+++ b/lib/libssl/src/apps/req.c
@@ -422,7 +422,7 @@ bad:
BIO_printf(bio_err," -key file use the private key contained in file\n");
BIO_printf(bio_err," -keyform arg key file format\n");
BIO_printf(bio_err," -keyout arg file to send the key to\n");
- BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err," -rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
BIO_printf(bio_err," the random number generator\n");
BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
@@ -1097,7 +1097,7 @@ end:
if(passargout && passout) free(passout);
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ex);
+ exit(ex);
}
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn,
diff --git a/lib/libssl/src/apps/rsa.c b/lib/libssl/src/apps/rsa.c
index 63522676712..b367f235518 100644
--- a/lib/libssl/src/apps/rsa.c
+++ b/lib/libssl/src/apps/rsa.c
@@ -433,7 +433,7 @@ end:
if(passin) free(passin);
if(passout) free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_RSA */
diff --git a/lib/libssl/src/apps/s_cb.c b/lib/libssl/src/apps/s_cb.c
index 6c341d924c3..b5dc40c53a8 100644
--- a/lib/libssl/src/apps/s_cb.c
+++ b/lib/libssl/src/apps/s_cb.c
@@ -111,11 +111,13 @@
#include <stdio.h>
#include <stdlib.h>
-#define USE_SOCKETS
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
#define NON_MAIN
#include "apps.h"
#undef NON_MAIN
-#undef USE_SOCKETS
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/x509.h>
diff --git a/lib/libssl/src/apps/s_client.c b/lib/libssl/src/apps/s_client.c
index a163ac9904c..0b300a574d1 100644
--- a/lib/libssl/src/apps/s_client.c
+++ b/lib/libssl/src/apps/s_client.c
@@ -141,13 +141,16 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#include <string.h>
#include <openssl/e_os2.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#ifdef OPENSSL_NO_STDIO
#define APPS_WIN16
#endif
-#define USE_SOCKETS
#include "apps.h"
#include <openssl/x509.h>
#include <openssl/ssl.h>
@@ -338,7 +341,7 @@ static void sc_usage(void)
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
#endif
- BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err," -rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err," -sess_out arg - file to write SSL session to\n");
BIO_printf(bio_err," -sess_in arg - file to read SSL session from\n");
#ifndef OPENSSL_NO_TLSEXT
@@ -1862,7 +1865,7 @@ end:
bio_c_out=NULL;
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/s_server.c b/lib/libssl/src/apps/s_server.c
index 1a2b9804efb..1396992739a 100644
--- a/lib/libssl/src/apps/s_server.c
+++ b/lib/libssl/src/apps/s_server.c
@@ -151,6 +151,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/socket.h>
#include <openssl/e_os2.h>
#ifdef OPENSSL_NO_STDIO
@@ -161,7 +162,6 @@
#include <openssl/lhash.h>
#include <openssl/bn.h>
-#define USE_SOCKETS
#include "apps.h"
#include <openssl/err.h>
#include <openssl/pem.h>
@@ -523,7 +523,7 @@ static void sv_usage(void)
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
#endif
BIO_printf(bio_err," -id_prefix arg - Generate SSL/TLS session IDs prefixed by 'arg'\n");
- BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err," -rand file%cfile%c...\n", ':', ':');
#ifndef OPENSSL_NO_TLSEXT
BIO_printf(bio_err," -servername host - servername for HostName TLS extension\n");
BIO_printf(bio_err," -servername_fatal - on mismatch send fatal alert (default warning alert)\n");
@@ -1744,7 +1744,7 @@ end:
bio_s_out=NULL;
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
diff --git a/lib/libssl/src/apps/s_socket.c b/lib/libssl/src/apps/s_socket.c
index a0dabcac655..097c900bd77 100644
--- a/lib/libssl/src/apps/s_socket.c
+++ b/lib/libssl/src/apps/s_socket.c
@@ -61,6 +61,9 @@
#include <string.h>
#include <errno.h>
#include <signal.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#ifdef FLAT_INC
#include "e_os2.h"
@@ -68,10 +71,8 @@
#include "../e_os2.h"
#endif
-#define USE_SOCKETS
#define NON_MAIN
#include "apps.h"
-#undef USE_SOCKETS
#undef NON_MAIN
#include "s_apps.h"
#include <openssl/ssl.h>
diff --git a/lib/libssl/src/apps/s_time.c b/lib/libssl/src/apps/s_time.c
index 1eb01f6d2f6..ee5f7c633ef 100644
--- a/lib/libssl/src/apps/s_time.c
+++ b/lib/libssl/src/apps/s_time.c
@@ -66,8 +66,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/socket.h>
-#define USE_SOCKETS
#include "apps.h"
#ifdef OPENSSL_NO_STDIO
#define APPS_WIN16
@@ -533,7 +533,7 @@ end:
tm_ctx=NULL;
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
/***********************************************************************
diff --git a/lib/libssl/src/apps/sess_id.c b/lib/libssl/src/apps/sess_id.c
index 8fab8c0b9a9..5ad1bddedb4 100644
--- a/lib/libssl/src/apps/sess_id.c
+++ b/lib/libssl/src/apps/sess_id.c
@@ -269,7 +269,7 @@ end:
if (out != NULL) BIO_free_all(out);
if (x != NULL) SSL_SESSION_free(x);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static SSL_SESSION *load_sess_id(char *infile, int format)
diff --git a/lib/libssl/src/apps/smime.c b/lib/libssl/src/apps/smime.c
index 4421e948bb4..c4b976fa00f 100644
--- a/lib/libssl/src/apps/smime.c
+++ b/lib/libssl/src/apps/smime.c
@@ -485,7 +485,7 @@ int MAIN(int argc, char **argv)
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
#endif
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
- BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ BIO_printf(bio_err, "-rand file%cfile%c...\n", ':', ':');
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
BIO_printf (bio_err, "cert.pem recipient certificate(s) for encryption\n");
diff --git a/lib/libssl/src/apps/speed.c b/lib/libssl/src/apps/speed.c
index acae09e95e9..59f28e4d58b 100644
--- a/lib/libssl/src/apps/speed.c
+++ b/lib/libssl/src/apps/speed.c
@@ -2522,7 +2522,7 @@ end:
#endif
apps_shutdown();
- OPENSSL_EXIT(mret);
+ exit(mret);
}
static void print_message(const char *s, long num, int length)
diff --git a/lib/libssl/src/apps/spkac.c b/lib/libssl/src/apps/spkac.c
index 8d29dce907b..3caf5c04bdd 100644
--- a/lib/libssl/src/apps/spkac.c
+++ b/lib/libssl/src/apps/spkac.c
@@ -292,5 +292,5 @@ end:
EVP_PKEY_free(pkey);
if(passin) free(passin);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/srp.c b/lib/libssl/src/apps/srp.c
index 15f3315c188..2ce1d408317 100644
--- a/lib/libssl/src/apps/srp.c
+++ b/lib/libssl/src/apps/srp.c
@@ -741,7 +741,7 @@ err:
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/ts.c b/lib/libssl/src/apps/ts.c
index 9528631e922..799c5b35329 100644
--- a/lib/libssl/src/apps/ts.c
+++ b/lib/libssl/src/apps/ts.c
@@ -371,7 +371,7 @@ int MAIN(int argc, char **argv)
"[-md2|-md4|-md5|-sha|-sha1|-mdc2|-ripemd160] "
"[-policy object_id] [-no_nonce] [-cert] "
"[-in request.tsq] [-out request.tsq] [-text]\n",
- LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
+ ':', ':');
BIO_printf(bio_err, "or\n"
"ts -reply [-config configfile] [-section tsa_section] "
"[-queryfile request.tsq] [-passin password] "
@@ -397,7 +397,7 @@ int MAIN(int argc, char **argv)
bio_err = NULL;
}
- OPENSSL_EXIT(ret);
+ return(ret);
}
/*
diff --git a/lib/libssl/src/apps/verify.c b/lib/libssl/src/apps/verify.c
index ea1a2e6fd92..135d76d6673 100644
--- a/lib/libssl/src/apps/verify.c
+++ b/lib/libssl/src/apps/verify.c
@@ -260,7 +260,7 @@ end:
sk_X509_pop_free(trusted, X509_free);
sk_X509_CRL_pop_free(crls, X509_CRL_free);
apps_shutdown();
- OPENSSL_EXIT(ret < 0 ? 2 : ret);
+ exit(ret < 0 ? 2 : ret);
}
static int check(X509_STORE *ctx, char *file,
diff --git a/lib/libssl/src/apps/version.c b/lib/libssl/src/apps/version.c
index e9555cbde29..811ac26fc1a 100644
--- a/lib/libssl/src/apps/version.c
+++ b/lib/libssl/src/apps/version.c
@@ -213,5 +213,5 @@ int MAIN(int argc, char **argv)
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
end:
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
diff --git a/lib/libssl/src/apps/x509.c b/lib/libssl/src/apps/x509.c
index 4e5ce377500..0026793a433 100644
--- a/lib/libssl/src/apps/x509.c
+++ b/lib/libssl/src/apps/x509.c
@@ -1089,7 +1089,7 @@ end:
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
if (passin) free(passin);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, int create)
diff --git a/lib/libssl/src/crypto/bio/b_sock.c b/lib/libssl/src/crypto/bio/b_sock.c
index 1ae9d96577c..0972feeb584 100644
--- a/lib/libssl/src/crypto/bio/b_sock.c
+++ b/lib/libssl/src/crypto/bio/b_sock.c
@@ -59,16 +59,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
-#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK)
-#include <netdb.h>
-#if defined(NETWARE_CLIB)
#include <sys/ioctl.h>
-NETDB_DEFINE_CONTEXT
-#endif
-#endif
+
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#ifndef OPENSSL_NO_SOCK
diff --git a/lib/libssl/src/crypto/bio/bss_acpt.c b/lib/libssl/src/crypto/bio/bss_acpt.c
index a272ada3667..27a4d371dc2 100644
--- a/lib/libssl/src/crypto/bio/bss_acpt.c
+++ b/lib/libssl/src/crypto/bio/bss_acpt.c
@@ -58,9 +58,9 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
+#include <sys/socket.h>
#ifndef OPENSSL_NO_SOCK
diff --git a/lib/libssl/src/crypto/bio/bss_conn.c b/lib/libssl/src/crypto/bio/bss_conn.c
index 9c5320cafb6..46667bc7d62 100644
--- a/lib/libssl/src/crypto/bio/bss_conn.c
+++ b/lib/libssl/src/crypto/bio/bss_conn.c
@@ -58,9 +58,11 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#ifndef OPENSSL_NO_SOCK
diff --git a/lib/libssl/src/crypto/bio/bss_dgram.c b/lib/libssl/src/crypto/bio/bss_dgram.c
index 4c54601abcb..50281b5650a 100644
--- a/lib/libssl/src/crypto/bio/bss_dgram.c
+++ b/lib/libssl/src/crypto/bio/bss_dgram.c
@@ -60,10 +60,12 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
-
#include <openssl/bio.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
#ifndef OPENSSL_NO_DGRAM
#ifndef OPENSSL_NO_SCTP
diff --git a/lib/libssl/src/crypto/bio/bss_fd.c b/lib/libssl/src/crypto/bio/bss_fd.c
index 4369d6411d8..b84719c4870 100644
--- a/lib/libssl/src/crypto/bio/bss_fd.c
+++ b/lib/libssl/src/crypto/bio/bss_fd.c
@@ -58,7 +58,6 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#if defined(OPENSSL_NO_POSIX_IO)
diff --git a/lib/libssl/src/crypto/bio/bss_sock.c b/lib/libssl/src/crypto/bio/bss_sock.c
index 5335495c6ef..7c499634fbc 100644
--- a/lib/libssl/src/crypto/bio/bss_sock.c
+++ b/lib/libssl/src/crypto/bio/bss_sock.c
@@ -58,8 +58,8 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
+#include <sys/socket.h>
#ifndef OPENSSL_NO_SOCK
diff --git a/lib/libssl/src/crypto/x509/by_dir.c b/lib/libssl/src/crypto/x509/by_dir.c
index 76f8244f364..bc603312752 100644
--- a/lib/libssl/src/crypto/x509/by_dir.c
+++ b/lib/libssl/src/crypto/x509/by_dir.c
@@ -218,7 +218,7 @@ add_cert_dir(BY_DIR *ctx, const char *dir, int type)
s = dir;
p = s;
do {
- if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
+ if ((*p == ':') || (*p == '\0')) {
BY_DIR_ENTRY *ent;
ss = s;
s = p + 1;
diff --git a/lib/libssl/src/e_os.h b/lib/libssl/src/e_os.h
index b9278c9e7e1..e66179273f8 100644
--- a/lib/libssl/src/e_os.h
+++ b/lib/libssl/src/e_os.h
@@ -61,10 +61,14 @@
#include <openssl/opensslconf.h>
+/*
+ * <openssl/e_os2.h> contains what we can justify to make visible
+ * to the outside
+ * <openssl/e_os2.h> is not exported interface (except to the openssl
+ * command)
+ */
+
#include <openssl/e_os2.h>
-/* <openssl/e_os2.h> contains what we can justify to make visible
- * to the outside; this file e_os.h is not part of the exported
- * interface. */
#ifdef __cplusplus
extern "C" {
@@ -76,44 +80,10 @@ extern "C" {
#define REF_PRINT(a,b) fprintf(stderr,"%08X:%4d:%s\n",(int)b,b->references,a)
#endif
-# include <unistd.h>
-# include <sys/types.h>
-# define OPENSSL_CONF "openssl.cnf"
-# define SSLEAY_CONF OPENSSL_CONF
-# define RFILE ".rnd"
-# define LIST_SEPARATOR_CHAR ':'
-# define EXIT(n) exit(n)
-
-
-#ifdef USE_SOCKETS
-# include <sys/param.h>
-# include <sys/time.h> /* Needed under linux for FD_XXX */
-# include <netdb.h>
-# include <sys/socket.h>
-# include <netinet/in.h>
-# include <sys/ioctl.h>
-#endif
-
-/* Some IPv6 implementations are broken, disable them in known bad
- * versions.
- */
-# if !defined(OPENSSL_USE_IPV6)
-# if defined(AF_INET6)
-# define OPENSSL_USE_IPV6 1
-# else
-# define OPENSSL_USE_IPV6 0
-# endif
-# endif
-
-#ifndef OPENSSL_EXIT
-# if defined(MONOLITH) && !defined(OPENSSL_C)
-# define OPENSSL_EXIT(n) return(n)
-# else
-# define OPENSSL_EXIT(n) do { EXIT(n); return(n); } while(0)
-# endif
-#endif
+#define OPENSSL_CONF "openssl.cnf"
+#define RFILE ".rnd"
-/***********************************************/
+#define OPENSSL_USE_IPV6 1
#ifdef __cplusplus
}
diff --git a/lib/libssl/src/ssl/s3_pkt.c b/lib/libssl/src/ssl/s3_pkt.c
index c9a7b6cf073..d6c8756a1ac 100644
--- a/lib/libssl/src/ssl/s3_pkt.c
+++ b/lib/libssl/src/ssl/s3_pkt.c
@@ -111,7 +111,6 @@
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "ssl_locl.h"
#include <openssl/evp.h>
#include <openssl/buffer.h>