exit() in whatever way works for the intended platform, and define
OPENSSL_EXIT() to have the old meaning (the name is of course because
it's only used in the openssl program)
37 files changed:
if (osk != NULL) sk_free(osk);
OBJ_cleanup();
apps_shutdown();
if (osk != NULL) sk_free(osk);
OBJ_cleanup();
apps_shutdown();
}
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
}
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
NCONF_free(conf);
OBJ_cleanup();
apps_shutdown();
NCONF_free(conf);
OBJ_cleanup();
apps_shutdown();
}
static void lookup_fail(char *name, char *tag)
}
static void lookup_fail(char *name, char *tag)
if (ssl != NULL) SSL_free(ssl);
if (STDout != NULL) BIO_free_all(STDout);
apps_shutdown();
if (ssl != NULL) SSL_free(ssl);
if (STDout != NULL) BIO_free_all(STDout);
apps_shutdown();
X509_STORE_free(store);
}
apps_shutdown();
X509_STORE_free(store);
}
apps_shutdown();
}
static X509_CRL *load_crl(char *infile, int format)
}
static X509_CRL *load_crl(char *infile, int format)
if (crl != NULL) X509_CRL_free(crl);
apps_shutdown();
if (crl != NULL) X509_CRL_free(crl);
apps_shutdown();
if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd);
apps_shutdown();
if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd);
apps_shutdown();
}
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
}
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
apps_shutdown();
}
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
}
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dsa != NULL) DSA_free(dsa);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dsa != NULL) DSA_free(dsa);
apps_shutdown();
}
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
}
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
if (passout)
OPENSSL_free(passout);
apps_shutdown();
if (passout)
OPENSSL_free(passout);
apps_shutdown();
if (group != NULL)
EC_GROUP_free(group);
apps_shutdown();
if (group != NULL)
EC_GROUP_free(group);
apps_shutdown();
}
int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
}
int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
if (b64 != NULL) BIO_free(b64);
if(pass) OPENSSL_free(pass);
apps_shutdown();
if (b64 != NULL) BIO_free(b64);
if(pass) OPENSSL_free(pass);
apps_shutdown();
}
int set_hex(char *in, unsigned char *out, int size)
}
int set_hex(char *in, unsigned char *out, int size)
sk_pop_free(post_cmds, identity);
if (bio_out != NULL) BIO_free_all(bio_out);
apps_shutdown();
sk_pop_free(post_cmds, identity);
if (bio_out != NULL) BIO_free_all(bio_out);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
apps_shutdown();
}
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
}
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
if (dsa != NULL) DSA_free(dsa);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if (dsa != NULL) DSA_free(dsa);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if (ret != 0)
ERR_print_errors(bio_err);
apps_shutdown();
if (ret != 0)
ERR_print_errors(bio_err);
apps_shutdown();
}
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
}
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
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");
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");
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
}
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
}
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
BIO_free(bio_err);
bio_err=NULL;
}
BIO_free(bio_err);
bio_err=NULL;
}
}
#define LIST_STANDARD_COMMANDS "list-standard-commands"
}
#define LIST_STANDARD_COMMANDS "list-standard-commands"
if (out)
BIO_free_all(out);
apps_shutdown();
if (out)
BIO_free_all(out);
apps_shutdown();
int MAIN(int argc, char **argv)
{
fputs("Program not available.\n", stderr)
int MAIN(int argc, char **argv)
{
fputs("Program not available.\n", stderr)
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
}
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
}
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();
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
apps_shutdown();
if (out)
BIO_free_all(out);
apps_shutdown();
if (out)
BIO_free_all(out);
apps_shutdown();
if (ec_params != NULL) EC_KEY_free(ec_params);
#endif
apps_shutdown();
if (ec_params != NULL) EC_KEY_free(ec_params);
#endif
apps_shutdown();
}
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs,
}
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs,
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
}
#else /* !OPENSSL_NO_RSA */
}
#else /* !OPENSSL_NO_RSA */
bio_c_out=NULL;
}
apps_shutdown();
bio_c_out=NULL;
}
apps_shutdown();
bio_s_out=NULL;
}
apps_shutdown();
bio_s_out=NULL;
}
apps_shutdown();
}
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
}
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
tm_ctx=NULL;
}
apps_shutdown();
tm_ctx=NULL;
}
apps_shutdown();
}
/***********************************************************************
}
/***********************************************************************
if (out != NULL) BIO_free_all(out);
if (x != NULL) SSL_SESSION_free(x);
apps_shutdown();
if (out != NULL) BIO_free_all(out);
if (x != NULL) SSL_SESSION_free(x);
apps_shutdown();
}
static SSL_SESSION *load_sess_id(char *infile, int format)
}
static SSL_SESSION *load_sess_id(char *infile, int format)
}
static void print_message(const char *s, long num, int length)
}
static void print_message(const char *s, long num, int length)
EVP_PKEY_free(pkey);
if(passin) OPENSSL_free(passin);
apps_shutdown();
EVP_PKEY_free(pkey);
if(passin) OPENSSL_free(passin);
apps_shutdown();
sk_X509_pop_free(untrusted, X509_free);
sk_X509_pop_free(trusted, X509_free);
apps_shutdown();
sk_X509_pop_free(untrusted, X509_free);
sk_X509_pop_free(trusted, X509_free);
apps_shutdown();
}
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
}
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
end:
apps_shutdown();
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
end:
apps_shutdown();
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
if (passin) OPENSSL_free(passin);
apps_shutdown();
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
if (passin) OPENSSL_free(passin);
apps_shutdown();
}
static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
}
static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
# define _kbhit kbhit
# endif
# define _kbhit kbhit
# endif
-# if defined(WIN16) && !defined(MONOLITH) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
-# define EXIT(n) do { if (n == 0) _wsetexit(_WINEXITNOPERSIST); return(n); } while(0)
+# if defined(WIN16) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
+# define EXIT(n) _wsetexit(_WINEXITNOPERSIST)
+# define OPENSSL_EXIT(n) do { if (n == 0) EXIT(n); return(n); } while(0)
-# define EXIT(n) return(n)
+# define EXIT(n) return(n)
# endif
# define LIST_SEPARATOR_CHAR ';'
# ifndef X_OK
# endif
# define LIST_SEPARATOR_CHAR ';'
# ifndef X_OK
the status is tagged as an error, which I believe is what is wanted here.
-- Richard Levitte
*/
the status is tagged as an error, which I believe is what is wanted here.
-- Richard Levitte
*/
-# if !defined(MONOLITH) || defined(OPENSSL_C)
-# define EXIT(n) do { int __VMS_EXIT = n; \
+# define EXIT(n) do { int __VMS_EXIT = n; \
if (__VMS_EXIT == 0) \
__VMS_EXIT = 1; \
else \
__VMS_EXIT = (n << 3) | 2; \
__VMS_EXIT |= 0x10000000; \
if (__VMS_EXIT == 0) \
__VMS_EXIT = 1; \
else \
__VMS_EXIT = (n << 3) | 2; \
__VMS_EXIT |= 0x10000000; \
- exit(__VMS_EXIT); \
- return(__VMS_EXIT); } while(0)
-# else
-# define EXIT(n) return(n)
-# endif
+ exit(__VMS_EXIT); } while(0)
# define NO_SYS_PARAM_H
# else
/* !defined VMS */
# define NO_SYS_PARAM_H
# else
/* !defined VMS */
# define RFILE ".rnd"
# define LIST_SEPARATOR_CHAR ':'
# define NUL_DEV "/dev/null"
# define RFILE ".rnd"
# define LIST_SEPARATOR_CHAR ':'
# define NUL_DEV "/dev/null"
-# ifndef MONOLITH
-# define EXIT(n) do { exit(n); return(n); } while(0)
-# else
-# define EXIT(n) return(n)
-# endif
+# define EXIT(n) exit(n)
# endif
# define SSLeay_getpid() getpid()
# endif
# define SSLeay_getpid() getpid()
(((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum])
#endif
(((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum])
#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
+
/***********************************************/
/* do we need to do this for getenv.
/***********************************************/
/* do we need to do this for getenv.