#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
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
+#include <sys/socket.h>
#ifndef OPENSSL_NO_SOCK
#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
#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
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#if defined(OPENSSL_NO_POSIX_IO)
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
+#include <sys/socket.h>
#ifndef OPENSSL_NO_SOCK
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;
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "ssl_locl.h"
#include <openssl/evp.h>
#include <openssl/buffer.h>
for (;;) {
last = 0;
for (p = name;
- ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
+ ((*p != '\0') && (*p != ':')); p++);
if (*p == '\0')
last = 1;
*p = '\0';
sk_OPENSSL_STRING_free(osk);
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
NCONF_free(extconf);
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static void
if (STDout != NULL)
BIO_free_all(STDout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
X509_STORE_free(store);
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static X509_CRL *
X509_CRL_free(crl);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
/*
if (bmd != NULL)
BIO_free(bmd);
apps_shutdown();
- OPENSSL_EXIT(err);
+ exit(err);
}
int
if (dh != NULL)
DH_free(dh);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_DH */
#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");
if (dh != NULL)
DH_free(dh);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
if (passout)
free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_DSA */
if (dsa != NULL)
DSA_free(dsa);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
if (passout)
free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_EC */
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,
#endif
if(pass) free(pass);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
int set_hex(char *in, unsigned char *out, int size)
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
}
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#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;
if (dh != NULL)
DH_free(dh);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
#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");
if (passout)
free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_DSA */
#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;
if (ret != 0)
ERR_print_errors(bio_err);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static int
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) {
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
- OPENSSL_EXIT(ret);
+ return(ret);
}
*/
#ifndef OPENSSL_NO_OCSP
-#define USE_SOCKETS
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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,
#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>
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
}
BIO_free(bio_err);
bio_err=NULL;
}
- OPENSSL_EXIT(ret);
+ return(ret);
}
#define LIST_STANDARD_COMMANDS "list-standard-commands"
if (out)
BIO_free_all(out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
int MAIN(int argc, char **argv)
{
fputs("Program not available.\n", stderr)
- OPENSSL_EXIT(1);
+ exit(1);
}
#endif
#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");
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,
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#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;
if (out)
BIO_free_all(out);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
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");
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,
if(passin) free(passin);
if(passout) free(passout);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#else /* !OPENSSL_NO_RSA */
#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>
#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>
#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
bio_c_out=NULL;
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/socket.h>
#include <openssl/e_os2.h>
#ifdef OPENSSL_NO_STDIO
#include <openssl/lhash.h>
#include <openssl/bn.h>
-#define USE_SOCKETS
#include "apps.h"
#include <openssl/err.h>
#include <openssl/pem.h>
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");
bio_s_out=NULL;
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
#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"
#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>
#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
tm_ctx=NULL;
}
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
/***********************************************************************
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)
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");
#endif
apps_shutdown();
- OPENSSL_EXIT(mret);
+ exit(mret);
}
static void print_message(const char *s, long num, int length)
EVP_PKEY_free(pkey);
if(passin) free(passin);
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
OBJ_cleanup();
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
"[-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] "
bio_err = NULL;
}
- OPENSSL_EXIT(ret);
+ return(ret);
}
/*
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,
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
end:
apps_shutdown();
- OPENSSL_EXIT(ret);
+ return(ret);
}
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)
#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
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
+#include <sys/socket.h>
#ifndef OPENSSL_NO_SOCK
#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
#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
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
#if defined(OPENSSL_NO_POSIX_IO)
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "cryptlib.h"
+#include <sys/socket.h>
#ifndef OPENSSL_NO_SOCK
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;
#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" {
#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
}
#include <stdio.h>
#include <errno.h>
-#define USE_SOCKETS
#include "ssl_locl.h"
#include <openssl/evp.h>
#include <openssl/buffer.h>