summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-04-16 02:14:27 +0000
committertedu <tedu@openbsd.org>2014-04-16 02:14:27 +0000
commitacbada9f2874b3b23c8799bfe2d3ef28f3939498 (patch)
tree190331c8990a060b4e599e12692a3c6c58a0164b /lib/libssl/src
parentstrncpy(d, s, strlen(s)) is a special kind of stupid. even when it's right, (diff)
downloadwireguard-openbsd-acbada9f2874b3b23c8799bfe2d3ef28f3939498.tar.xz
wireguard-openbsd-acbada9f2874b3b23c8799bfe2d3ef28f3939498.zip
spray the apps directory with anti-VMS napalm.
so that its lovecraftian horror is not forever lost, i reproduce below a comment from the deleted code. /* 2011-03-22 SMS. * If we have 32-bit pointers everywhere, then we're safe, and * we bypass this mess, as on non-VMS systems. (See ARGV, * above.) * Problem 1: Compaq/HP C before V7.3 always used 32-bit * pointers for argv[]. * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers * everywhere else, we always allocate and use a 64-bit * duplicate of argv[]. * Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed * to NULL-terminate a 64-bit argv[]. (As this was written, the * compiler ECO was available only on IA64.) * Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a * 64-bit argv[argc] for NULL, and, if necessary, use a * (properly) NULL-terminated (64-bit) duplicate of argv[]. * The same code is used in either case to duplicate argv[]. * Some of these decisions could be handled in preprocessing, * but the code tends to get even uglier, and the penalty for * deciding at compile- or run-time is tiny. */
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/apps/apps.c37
-rw-r--r--lib/libssl/src/apps/asn1pars.c6
-rw-r--r--lib/libssl/src/apps/ca.c30
-rw-r--r--lib/libssl/src/apps/ciphers.c6
-rw-r--r--lib/libssl/src/apps/cms.c6
-rw-r--r--lib/libssl/src/apps/crl.c12
-rw-r--r--lib/libssl/src/apps/crl2p7.c6
-rw-r--r--lib/libssl/src/apps/dgst.c6
-rw-r--r--lib/libssl/src/apps/dh.c6
-rw-r--r--lib/libssl/src/apps/dhparam.c6
-rw-r--r--lib/libssl/src/apps/dsa.c6
-rw-r--r--lib/libssl/src/apps/dsaparam.c6
-rw-r--r--lib/libssl/src/apps/ec.c6
-rw-r--r--lib/libssl/src/apps/ecparam.c6
-rw-r--r--lib/libssl/src/apps/enc.c6
-rw-r--r--lib/libssl/src/apps/engine.c6
-rw-r--r--lib/libssl/src/apps/errstr.c6
-rw-r--r--lib/libssl/src/apps/gendh.c6
-rw-r--r--lib/libssl/src/apps/gendsa.c6
-rw-r--r--lib/libssl/src/apps/genpkey.c6
-rw-r--r--lib/libssl/src/apps/genrsa.c6
-rw-r--r--lib/libssl/src/apps/nseq.c6
-rw-r--r--lib/libssl/src/apps/ocsp.c5
-rw-r--r--lib/libssl/src/apps/openssl.c71
-rw-r--r--lib/libssl/src/apps/passwd.c6
-rw-r--r--lib/libssl/src/apps/pkcs12.c6
-rw-r--r--lib/libssl/src/apps/pkcs7.c6
-rw-r--r--lib/libssl/src/apps/pkcs8.c6
-rw-r--r--lib/libssl/src/apps/pkey.c6
-rw-r--r--lib/libssl/src/apps/pkeyparam.c6
-rw-r--r--lib/libssl/src/apps/pkeyutl.c6
-rw-r--r--lib/libssl/src/apps/prime.c6
-rw-r--r--lib/libssl/src/apps/rand.c6
-rw-r--r--lib/libssl/src/apps/req.c12
-rw-r--r--lib/libssl/src/apps/rsa.c6
-rw-r--r--lib/libssl/src/apps/rsautl.c6
-rw-r--r--lib/libssl/src/apps/s_apps.h23
-rw-r--r--lib/libssl/src/apps/s_client.c10
-rw-r--r--lib/libssl/src/apps/s_server.c14
-rw-r--r--lib/libssl/src/apps/s_socket.c9
-rw-r--r--lib/libssl/src/apps/sess_id.c6
-rw-r--r--lib/libssl/src/apps/smime.c6
-rw-r--r--lib/libssl/src/apps/speed.c4
-rw-r--r--lib/libssl/src/apps/spkac.c12
-rw-r--r--lib/libssl/src/apps/srp.c6
-rw-r--r--lib/libssl/src/apps/x509.c12
46 files changed, 0 insertions, 449 deletions
diff --git a/lib/libssl/src/apps/apps.c b/lib/libssl/src/apps/apps.c
index 4ec99601cf0..5162c0179ac 100644
--- a/lib/libssl/src/apps/apps.c
+++ b/lib/libssl/src/apps/apps.c
@@ -109,12 +109,6 @@
*
*/
-#if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS)
-#define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get
- the declaration of fileno(). The value
- 2 is to make sure no function defined
- in POSIX-2 is left undefined. */
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -335,34 +329,6 @@ void program_name(char *in, char *out, int size)
out[n]='\0';
}
#else
-#ifdef OPENSSL_SYS_VMS
-void program_name(char *in, char *out, int size)
- {
- char *p=in, *q;
- char *chars=":]>";
-
- while(*chars != '\0')
- {
- q=strrchr(p,*chars);
- if (q > p)
- p = q + 1;
- chars++;
- }
-
- q=strrchr(p,'.');
- if (q == NULL)
- q = p + strlen(p);
- strncpy(out,p,size-1);
- if (q-p >= size)
- {
- out[size-1]='\0';
- }
- else
- {
- out[q-p]='\0';
- }
- }
-#else
void program_name(char *in, char *out, int size)
{
char *p;
@@ -375,7 +341,6 @@ void program_name(char *in, char *out, int size)
BUF_strlcpy(out,p,size);
}
#endif
-#endif
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
{
@@ -1543,9 +1508,7 @@ char *make_config_name()
len=strlen(t)+strlen(OPENSSL_CONF)+2;
p=OPENSSL_malloc(len);
BUF_strlcpy(p,t,len);
-#ifndef OPENSSL_SYS_VMS
BUF_strlcat(p,"/",len);
-#endif
BUF_strlcat(p,OPENSSL_CONF,len);
return p;
diff --git a/lib/libssl/src/apps/asn1pars.c b/lib/libssl/src/apps/asn1pars.c
index 0d6607071fe..0ff3cdf3a0d 100644
--- a/lib/libssl/src/apps/asn1pars.c
+++ b/lib/libssl/src/apps/asn1pars.c
@@ -224,12 +224,6 @@ bad:
goto end;
}
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
if (oidfile != NULL)
{
diff --git a/lib/libssl/src/apps/ca.c b/lib/libssl/src/apps/ca.c
index 6f37e029aca..4c71aa2a75d 100644
--- a/lib/libssl/src/apps/ca.c
+++ b/lib/libssl/src/apps/ca.c
@@ -76,15 +76,7 @@
#include <openssl/pem.h>
#ifndef W_OK
-# ifdef OPENSSL_SYS_VMS
-# if defined(__DECC)
-# include <unistd.h>
-# else
-# include <unixlib.h>
-# endif
-# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_NETWARE)
# include <sys/file.h>
-# endif
#endif
#include "apps.h"
@@ -587,16 +579,10 @@ bad:
const char *s=X509_get_default_cert_area();
size_t len;
-#ifdef OPENSSL_SYS_VMS
- len = strlen(s)+sizeof(CONFIG_FILE);
- tofree=OPENSSL_malloc(len);
- strcpy(tofree,s);
-#else
len = strlen(s)+sizeof(CONFIG_FILE)+1;
tofree=OPENSSL_malloc(len);
BUF_strlcpy(tofree,s,len);
BUF_strlcat(tofree,"/",len);
-#endif
BUF_strlcat(tofree,CONFIG_FILE,len);
configfile=tofree;
}
@@ -854,7 +840,6 @@ bad:
BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n");
goto err;
}
-#ifndef OPENSSL_SYS_VMS
/* outdir is a directory spec, but access() for VMS demands a
filename. In any case, stat(), below, will catch the problem
if outdir is not a directory spec, and the fopen() or open()
@@ -882,7 +867,6 @@ bad:
perror(outdir);
goto err;
}
-#endif
}
/*****************************************************************/
@@ -943,12 +927,6 @@ bad:
if (verbose)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT); /* cannot fail */
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
TXT_DB_write(out,db->db);
BIO_printf(bio_err,"%d entries loaded from the database\n",
sk_OPENSSL_PSTRING_num(db->db->data));
@@ -1026,12 +1004,6 @@ bad:
else
{
BIO_set_fp(Sout,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- Sout = BIO_push(tmpbio, Sout);
- }
-#endif
}
}
@@ -1319,9 +1291,7 @@ bad:
strlcpy(buf[2],outdir,sizeof(buf[2]));
-#ifndef OPENSSL_SYS_VMS
BUF_strlcat(buf[2],"/",sizeof(buf[2]));
-#endif
n=(char *)&(buf[2][strlen(buf[2])]);
if (j > 0)
diff --git a/lib/libssl/src/apps/ciphers.c b/lib/libssl/src/apps/ciphers.c
index 1906ca85a2b..b5ab166bc5c 100644
--- a/lib/libssl/src/apps/ciphers.c
+++ b/lib/libssl/src/apps/ciphers.c
@@ -103,12 +103,6 @@ int MAIN(int argc, char **argv)
if (bio_err == NULL)
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- STDout = BIO_push(tmpbio, STDout);
- }
-#endif
if (!load_config(bio_err, NULL))
goto end;
diff --git a/lib/libssl/src/apps/cms.c b/lib/libssl/src/apps/cms.c
index 5f77f8fbb03..801d523caf3 100644
--- a/lib/libssl/src/apps/cms.c
+++ b/lib/libssl/src/apps/cms.c
@@ -878,12 +878,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if ((operation == SMIME_VERIFY) || (operation == SMIME_VERIFY_RECEIPT))
diff --git a/lib/libssl/src/apps/crl.c b/lib/libssl/src/apps/crl.c
index 8797d300cf1..88e606554ab 100644
--- a/lib/libssl/src/apps/crl.c
+++ b/lib/libssl/src/apps/crl.c
@@ -137,12 +137,6 @@ int MAIN(int argc, char **argv)
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
{
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- bio_out = BIO_push(tmpbio, bio_out);
- }
-#endif
}
informat=FORMAT_PEM;
@@ -372,12 +366,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/crl2p7.c b/lib/libssl/src/apps/crl2p7.c
index bbc83774dbe..20207091a9b 100644
--- a/lib/libssl/src/apps/crl2p7.c
+++ b/lib/libssl/src/apps/crl2p7.c
@@ -241,12 +241,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/dgst.c b/lib/libssl/src/apps/dgst.c
index f4aec779c1d..0615fa837b2 100644
--- a/lib/libssl/src/apps/dgst.c
+++ b/lib/libssl/src/apps/dgst.c
@@ -328,12 +328,6 @@ int MAIN(int argc, char **argv)
else out = BIO_new_file(outfile, "w");
} else {
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if(!out) {
diff --git a/lib/libssl/src/apps/dh.c b/lib/libssl/src/apps/dh.c
index dee9c01fcec..5f534261edc 100644
--- a/lib/libssl/src/apps/dh.c
+++ b/lib/libssl/src/apps/dh.c
@@ -210,12 +210,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/dhparam.c b/lib/libssl/src/apps/dhparam.c
index 93bab90b72d..193e59bd016 100644
--- a/lib/libssl/src/apps/dhparam.c
+++ b/lib/libssl/src/apps/dhparam.c
@@ -416,12 +416,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/dsa.c b/lib/libssl/src/apps/dsa.c
index 5222487ab9c..45bac4a9d16 100644
--- a/lib/libssl/src/apps/dsa.c
+++ b/lib/libssl/src/apps/dsa.c
@@ -293,12 +293,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/dsaparam.c b/lib/libssl/src/apps/dsaparam.c
index ad609fd6c0c..47f8c83702b 100644
--- a/lib/libssl/src/apps/dsaparam.c
+++ b/lib/libssl/src/apps/dsaparam.c
@@ -258,12 +258,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/ec.c b/lib/libssl/src/apps/ec.c
index 896eabc13fb..dd3bb9d4a1d 100644
--- a/lib/libssl/src/apps/ec.c
+++ b/lib/libssl/src/apps/ec.c
@@ -311,12 +311,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out, stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/ecparam.c b/lib/libssl/src/apps/ecparam.c
index 976ebef12ba..17e28cf1d6e 100644
--- a/lib/libssl/src/apps/ecparam.c
+++ b/lib/libssl/src/apps/ecparam.c
@@ -320,12 +320,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/enc.c b/lib/libssl/src/apps/enc.c
index ab974893be1..16e98b8e531 100644
--- a/lib/libssl/src/apps/enc.c
+++ b/lib/libssl/src/apps/enc.c
@@ -456,12 +456,6 @@ bad:
if (bufsize != NULL)
setvbuf(stdout, (char *)NULL, _IONBF, 0);
#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/engine.c b/lib/libssl/src/apps/engine.c
index 9a0294398e8..33eeaf9f59a 100644
--- a/lib/libssl/src/apps/engine.c
+++ b/lib/libssl/src/apps/engine.c
@@ -360,12 +360,6 @@ int MAIN(int argc, char **argv)
if (!load_config(bio_err, NULL))
goto end;
bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- bio_out = BIO_push(tmpbio, bio_out);
- }
-#endif
argc--;
argv++;
diff --git a/lib/libssl/src/apps/errstr.c b/lib/libssl/src/apps/errstr.c
index fe3b98077ee..f9b4a4f093c 100644
--- a/lib/libssl/src/apps/errstr.c
+++ b/lib/libssl/src/apps/errstr.c
@@ -91,12 +91,6 @@ int MAIN(int argc, char **argv)
out=BIO_new(BIO_s_file());
if ((out != NULL) && BIO_set_fp(out,stdout,BIO_NOCLOSE))
{
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
lh_ERR_STRING_DATA_node_stats_bio(
ERR_get_string_table(), out);
lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(),
diff --git a/lib/libssl/src/apps/gendh.c b/lib/libssl/src/apps/gendh.c
index 6ef7eb94937..c80fc0c21ca 100644
--- a/lib/libssl/src/apps/gendh.c
+++ b/lib/libssl/src/apps/gendh.c
@@ -173,12 +173,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/gendsa.c b/lib/libssl/src/apps/gendsa.c
index 62ea9779051..612bdfbc1db 100644
--- a/lib/libssl/src/apps/gendsa.c
+++ b/lib/libssl/src/apps/gendsa.c
@@ -233,12 +233,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/genpkey.c b/lib/libssl/src/apps/genpkey.c
index 6dfda08b9e0..24b623a1bb3 100644
--- a/lib/libssl/src/apps/genpkey.c
+++ b/lib/libssl/src/apps/genpkey.c
@@ -233,12 +233,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp (stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
EVP_PKEY_CTX_set_cb(ctx, genpkey_cb);
diff --git a/lib/libssl/src/apps/genrsa.c b/lib/libssl/src/apps/genrsa.c
index d3064b663ad..bdc8778b1d9 100644
--- a/lib/libssl/src/apps/genrsa.c
+++ b/lib/libssl/src/apps/genrsa.c
@@ -238,12 +238,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/nseq.c b/lib/libssl/src/apps/nseq.c
index e3c4dba5473..4abb436f5d6 100644
--- a/lib/libssl/src/apps/nseq.c
+++ b/lib/libssl/src/apps/nseq.c
@@ -121,12 +121,6 @@ int MAIN(int argc, char **argv)
}
} else {
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if (toseq) {
seq = NETSCAPE_CERT_SEQUENCE_new();
diff --git a/lib/libssl/src/apps/ocsp.c b/lib/libssl/src/apps/ocsp.c
index b0ec7cdb190..1713467c084 100644
--- a/lib/libssl/src/apps/ocsp.c
+++ b/lib/libssl/src/apps/ocsp.c
@@ -57,11 +57,6 @@
*/
#ifndef OPENSSL_NO_OCSP
-#ifdef OPENSSL_SYS_VMS
-#define _XOPEN_SOURCE_EXTENDED /* So fd_set and friends get properly defined
- on OpenVMS */
-#endif
-
#define USE_SOCKETS
#include <stdio.h>
diff --git a/lib/libssl/src/apps/openssl.c b/lib/libssl/src/apps/openssl.c
index e40be80db34..8bd71082220 100644
--- a/lib/libssl/src/apps/openssl.c
+++ b/lib/libssl/src/apps/openssl.c
@@ -216,11 +216,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
}
}
-#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
-# define ARGV _Argv
-#else
# define ARGV Argv
-#endif
int main(int Argc, char *ARGV[])
{
@@ -237,54 +233,6 @@ int main(int Argc, char *ARGV[])
LHASH_OF(FUNCTION) *prog=NULL;
long errline;
-#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
- /* 2011-03-22 SMS.
- * If we have 32-bit pointers everywhere, then we're safe, and
- * we bypass this mess, as on non-VMS systems. (See ARGV,
- * above.)
- * Problem 1: Compaq/HP C before V7.3 always used 32-bit
- * pointers for argv[].
- * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
- * everywhere else, we always allocate and use a 64-bit
- * duplicate of argv[].
- * Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
- * to NULL-terminate a 64-bit argv[]. (As this was written, the
- * compiler ECO was available only on IA64.)
- * Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
- * 64-bit argv[argc] for NULL, and, if necessary, use a
- * (properly) NULL-terminated (64-bit) duplicate of argv[].
- * The same code is used in either case to duplicate argv[].
- * Some of these decisions could be handled in preprocessing,
- * but the code tends to get even uglier, and the penalty for
- * deciding at compile- or run-time is tiny.
- */
- char **Argv = NULL;
- int free_Argv = 0;
-
- if ((sizeof( _Argv) < 8) /* 32-bit argv[]. */
-# if !defined( VMS_TRUST_ARGV)
- || (_Argv[ Argc] != NULL) /* Untrusted argv[argc] not NULL. */
-# endif
- )
- {
- int i;
- Argv = OPENSSL_malloc( (Argc+ 1)* sizeof( char *));
- if (Argv == NULL)
- { ret = -1; goto end; }
- for(i = 0; i < Argc; i++)
- Argv[i] = _Argv[i];
- Argv[ Argc] = NULL; /* Certain NULL termination. */
- free_Argv = 1;
- }
- else
- {
- /* Use the known-good 32-bit argv[] (which needs the
- * type cast to satisfy the compiler), or the trusted or
- * tested-good 64-bit argv[] as-is. */
- Argv = (char **)_Argv;
- }
-#endif /* defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64) */
-
arg.data=NULL;
arg.count=0;
@@ -443,13 +391,6 @@ end:
BIO_free(bio_err);
bio_err=NULL;
}
-#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
- /* Free any duplicate Argv[] storage. */
- if (free_Argv)
- {
- OPENSSL_free(Argv);
- }
-#endif
OPENSSL_EXIT(ret);
}
@@ -492,12 +433,6 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
else if ((strncmp(argv[0],"no-",3)) == 0)
{
BIO *bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- bio_stdout = BIO_push(tmpbio, bio_stdout);
- }
-#endif
f.name=argv[0]+3;
ret = (lh_FUNCTION_retrieve(prog,&f) != NULL);
if (!ret)
@@ -538,12 +473,6 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */
list_type = FUNC_TYPE_CIPHER;
bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- bio_stdout = BIO_push(tmpbio, bio_stdout);
- }
-#endif
if (!load_config(bio_err, NULL))
goto end;
diff --git a/lib/libssl/src/apps/passwd.c b/lib/libssl/src/apps/passwd.c
index 9eabeb488cc..cb30f810c8f 100644
--- a/lib/libssl/src/apps/passwd.c
+++ b/lib/libssl/src/apps/passwd.c
@@ -85,12 +85,6 @@ int MAIN(int argc, char **argv)
if (out == NULL)
goto err;
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
badopt = 0, opt_done = 0;
i = 0;
diff --git a/lib/libssl/src/apps/pkcs12.c b/lib/libssl/src/apps/pkcs12.c
index 4d62a7b8cab..f099e8f6187 100644
--- a/lib/libssl/src/apps/pkcs12.c
+++ b/lib/libssl/src/apps/pkcs12.c
@@ -398,12 +398,6 @@ int MAIN(int argc, char **argv)
if (!outfile) {
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
} else out = BIO_new_file(outfile, "wb");
if (!out) {
BIO_printf(bio_err, "Error opening output file %s\n",
diff --git a/lib/libssl/src/apps/pkcs7.c b/lib/libssl/src/apps/pkcs7.c
index ae6cd33f738..272bf11f24d 100644
--- a/lib/libssl/src/apps/pkcs7.c
+++ b/lib/libssl/src/apps/pkcs7.c
@@ -221,12 +221,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/pkcs8.c b/lib/libssl/src/apps/pkcs8.c
index 7edeb179dd1..90b2ebe3ef7 100644
--- a/lib/libssl/src/apps/pkcs8.c
+++ b/lib/libssl/src/apps/pkcs8.c
@@ -266,12 +266,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp (stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if (topk8)
{
diff --git a/lib/libssl/src/apps/pkey.c b/lib/libssl/src/apps/pkey.c
index 17e6702fb17..a55714d0cef 100644
--- a/lib/libssl/src/apps/pkey.c
+++ b/lib/libssl/src/apps/pkey.c
@@ -219,12 +219,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp (stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if (pubin)
diff --git a/lib/libssl/src/apps/pkeyparam.c b/lib/libssl/src/apps/pkeyparam.c
index 6f7a357a36c..6a46c8ac499 100644
--- a/lib/libssl/src/apps/pkeyparam.c
+++ b/lib/libssl/src/apps/pkeyparam.c
@@ -167,12 +167,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp (stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
pkey = PEM_read_bio_Parameters(in, NULL);
diff --git a/lib/libssl/src/apps/pkeyutl.c b/lib/libssl/src/apps/pkeyutl.c
index 7eb3f5c544d..8b260caae05 100644
--- a/lib/libssl/src/apps/pkeyutl.c
+++ b/lib/libssl/src/apps/pkeyutl.c
@@ -278,12 +278,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if (sigfile)
diff --git a/lib/libssl/src/apps/prime.c b/lib/libssl/src/apps/prime.c
index f1aaef8725e..031906a792b 100644
--- a/lib/libssl/src/apps/prime.c
+++ b/lib/libssl/src/apps/prime.c
@@ -112,12 +112,6 @@ int MAIN(int argc, char **argv)
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
{
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- bio_out = BIO_push(tmpbio, bio_out);
- }
-#endif
}
if(generate)
diff --git a/lib/libssl/src/apps/rand.c b/lib/libssl/src/apps/rand.c
index 790e79592c1..884c244486a 100644
--- a/lib/libssl/src/apps/rand.c
+++ b/lib/libssl/src/apps/rand.c
@@ -191,12 +191,6 @@ int MAIN(int argc, char **argv)
else
{
r = BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if (r <= 0)
goto err;
diff --git a/lib/libssl/src/apps/req.c b/lib/libssl/src/apps/req.c
index ede69ed5d86..66038905a2c 100644
--- a/lib/libssl/src/apps/req.c
+++ b/lib/libssl/src/apps/req.c
@@ -717,12 +717,6 @@ bad:
{
BIO_printf(bio_err,"writing new private key to stdout\n");
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
@@ -969,12 +963,6 @@ loop:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/rsa.c b/lib/libssl/src/apps/rsa.c
index a17708fe9ca..579c2e276a9 100644
--- a/lib/libssl/src/apps/rsa.c
+++ b/lib/libssl/src/apps/rsa.c
@@ -306,12 +306,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/rsautl.c b/lib/libssl/src/apps/rsautl.c
index b01f004eb3f..49903496f58 100644
--- a/lib/libssl/src/apps/rsautl.c
+++ b/lib/libssl/src/apps/rsautl.c
@@ -247,12 +247,6 @@ int MAIN(int argc, char **argv)
}
} else {
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
keysize = RSA_size(rsa);
diff --git a/lib/libssl/src/apps/s_apps.h b/lib/libssl/src/apps/s_apps.h
index 08f55d53d34..95a13119cbd 100644
--- a/lib/libssl/src/apps/s_apps.h
+++ b/lib/libssl/src/apps/s_apps.h
@@ -121,29 +121,6 @@
#define _kbhit kbhit
#endif
-#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
-/* VAX C does not defined fd_set and friends, but it's actually quite simple */
-/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
-#define MAX_NOFILE 32
-#define NBBY 8 /* number of bits in a byte */
-
-#ifndef FD_SETSIZE
-#define FD_SETSIZE MAX_NOFILE
-#endif /* FD_SETSIZE */
-
-/* How many things we'll allow select to use. 0 if unlimited */
-#define MAXSELFD MAX_NOFILE
-typedef int fd_mask; /* int here! VMS prototypes int, not long */
-#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask (power of 2!)*/
-#define NFDSHIFT 5 /* Shift based on above */
-
-typedef fd_mask fd_set;
-#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
-#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
-#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
-#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
-#endif
-
#define PORT 4433
#define PORT_STR "4433"
#define PROTOCOL "tcp"
diff --git a/lib/libssl/src/apps/s_client.c b/lib/libssl/src/apps/s_client.c
index 7bea7204c1e..cb0a7688c83 100644
--- a/lib/libssl/src/apps/s_client.c
+++ b/lib/libssl/src/apps/s_client.c
@@ -151,11 +151,6 @@
recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
is needed to have fileno() declared correctly... So let's define u_int */
-#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
-#define __U_INT
-typedef unsigned int u_int;
-#endif
-
#define USE_SOCKETS
#include "apps.h"
#include <openssl/x509.h>
@@ -171,11 +166,6 @@ typedef unsigned int u_int;
#include "s_apps.h"
#include "timeouts.h"
-#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
-/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
-#undef FIONBIO
-#endif
-
#if defined(OPENSSL_SYS_BEOS_R5)
#include <fcntl.h>
#endif
diff --git a/lib/libssl/src/apps/s_server.c b/lib/libssl/src/apps/s_server.c
index 26e1fe95058..4ad535b9ee0 100644
--- a/lib/libssl/src/apps/s_server.c
+++ b/lib/libssl/src/apps/s_server.c
@@ -161,15 +161,6 @@
#include <sys/types.h>
#endif
-/* With IPv6, it looks like Digital has mixed up the proper order of
- recursive header file inclusion, resulting in the compiler complaining
- that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
- is needed to have fileno() declared correctly... So let's define u_int */
-#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
-#define __U_INT
-typedef unsigned int u_int;
-#endif
-
#include <openssl/lhash.h>
#include <openssl/bn.h>
#define USE_SOCKETS
@@ -192,11 +183,6 @@ typedef unsigned int u_int;
#include "s_apps.h"
#include "timeouts.h"
-#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
-/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
-#undef FIONBIO
-#endif
-
#if defined(OPENSSL_SYS_BEOS_R5)
#include <fcntl.h>
#endif
diff --git a/lib/libssl/src/apps/s_socket.c b/lib/libssl/src/apps/s_socket.c
index 8c4421a9304..a301567668a 100644
--- a/lib/libssl/src/apps/s_socket.c
+++ b/lib/libssl/src/apps/s_socket.c
@@ -68,15 +68,6 @@
#include "../e_os2.h"
#endif
-/* With IPv6, it looks like Digital has mixed up the proper order of
- recursive header file inclusion, resulting in the compiler complaining
- that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
- is needed to have fileno() declared correctly... So let's define u_int */
-#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
-#define __U_INT
-typedef unsigned int u_int;
-#endif
-
#define USE_SOCKETS
#define NON_MAIN
#include "apps.h"
diff --git a/lib/libssl/src/apps/sess_id.c b/lib/libssl/src/apps/sess_id.c
index b16686c26df..8fab8c0b9a9 100644
--- a/lib/libssl/src/apps/sess_id.c
+++ b/lib/libssl/src/apps/sess_id.c
@@ -210,12 +210,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{
diff --git a/lib/libssl/src/apps/smime.c b/lib/libssl/src/apps/smime.c
index c583f8a0e16..cd08fe44648 100644
--- a/lib/libssl/src/apps/smime.c
+++ b/lib/libssl/src/apps/smime.c
@@ -659,12 +659,6 @@ int MAIN(int argc, char **argv)
else
{
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if (operation == SMIME_VERIFY)
diff --git a/lib/libssl/src/apps/speed.c b/lib/libssl/src/apps/speed.c
index 9886ca37669..1b94d19f9d2 100644
--- a/lib/libssl/src/apps/speed.c
+++ b/lib/libssl/src/apps/speed.c
@@ -210,11 +210,7 @@
#endif
#ifndef HAVE_FORK
-# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
-# define HAVE_FORK 0
-# else
# define HAVE_FORK 1
-# endif
#endif
#if HAVE_FORK
diff --git a/lib/libssl/src/apps/spkac.c b/lib/libssl/src/apps/spkac.c
index 0e01ea9947d..7b90825b215 100644
--- a/lib/libssl/src/apps/spkac.c
+++ b/lib/libssl/src/apps/spkac.c
@@ -209,12 +209,6 @@ bad:
if (outfile) out = BIO_new_file(outfile, "w");
else {
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if(!out) {
@@ -267,12 +261,6 @@ bad:
if (outfile) out = BIO_new_file(outfile, "w");
else {
out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
if(!out) {
diff --git a/lib/libssl/src/apps/srp.c b/lib/libssl/src/apps/srp.c
index 9c7ae184db1..7004fea7ff2 100644
--- a/lib/libssl/src/apps/srp.c
+++ b/lib/libssl/src/apps/srp.c
@@ -443,16 +443,10 @@ bad:
const char *s=X509_get_default_cert_area();
size_t len;
-#ifdef OPENSSL_SYS_VMS
- len = strlen(s)+sizeof(CONFIG_FILE);
- tofree=OPENSSL_malloc(len);
- strcpy(tofree,s);
-#else
len = strlen(s)+sizeof(CONFIG_FILE)+1;
tofree=OPENSSL_malloc(len);
BUF_strlcpy(tofree,s,len);
BUF_strlcat(tofree,"/",len);
-#endif
BUF_strlcat(tofree,CONFIG_FILE,len);
configfile=tofree;
}
diff --git a/lib/libssl/src/apps/x509.c b/lib/libssl/src/apps/x509.c
index 0cee89eea11..2ed3f13327c 100644
--- a/lib/libssl/src/apps/x509.c
+++ b/lib/libssl/src/apps/x509.c
@@ -221,12 +221,6 @@ int MAIN(int argc, char **argv)
if (!load_config(bio_err, NULL))
goto end;
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- STDout = BIO_push(tmpbio, STDout);
- }
-#endif
informat=FORMAT_PEM;
outformat=FORMAT_PEM;
@@ -682,12 +676,6 @@ bad:
if (outfile == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
-#ifdef OPENSSL_SYS_VMS
- {
- BIO *tmpbio = BIO_new(BIO_f_linebuffer());
- out = BIO_push(tmpbio, out);
- }
-#endif
}
else
{