if (at != NULL) ASN1_TYPE_free(at);
if (osk != NULL) sk_free(osk);
OBJ_cleanup();
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
X509_CRL_free(crl);
CONF_free(conf);
OBJ_cleanup();
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static void lookup_fail(char *name, char *tag)
if (ctx != NULL) SSL_CTX_free(ctx);
if (ssl != NULL) SSL_free(ssl);
if (STDout != NULL) BIO_free_all(STDout);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
X509_STORE_CTX_cleanup(&ctx);
X509_STORE_free(store);
}
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static X509_CRL *load_crl(char *infile, int format)
BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n");
BIO_printf(bio_err," (can be used more than once)\n");
BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n");
- EXIT(1);
+ OPENSSL_EXIT(1);
}
ERR_load_crypto_strings();
if (p7 != NULL) PKCS7_free(p7);
if (crl != NULL) X509_CRL_free(crl);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
/*
EVP_PKEY_free(sigkey);
if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd);
- EXIT(err);
+ OPENSSL_EXIT(err);
}
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
#endif
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
if(dsa != NULL) DSA_free(dsa);
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
#endif
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
if (dsa != NULL) DSA_free(dsa);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
if (benc != NULL) BIO_free(benc);
if (b64 != NULL) BIO_free(b64);
if(pass) OPENSSL_free(pass);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
int set_hex(char *in, unsigned char *out, int size)
ret++;
}
}
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
ERR_print_errors(bio_err);
if (out != NULL) BIO_free_all(out);
if (dh != NULL) DH_free(dh);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
if (out != NULL) BIO_free_all(out);
if (dsa != NULL) DSA_free(dsa);
if(passout) OPENSSL_free(passout);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
#endif
if(passout) OPENSSL_free(passout);
if (ret != 0)
ERR_print_errors(bio_err);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
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");
- EXIT(1);
+ OPENSSL_EXIT(1);
}
if (infile) {
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
BIO_free(bio_err);
bio_err=NULL;
}
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
#define LIST_STANDARD_COMMANDS "list-standard-commands"
BIO_free(in);
if (out)
BIO_free_all(out);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
int MAIN(int argc, char **argv)
{
fputs("Program not available.\n", stderr)
- EXIT(1);
+ OPENSSL_EXIT(1);
}
#endif
if (canames) sk_free(canames);
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
BIO_printf(bio_err," -text print full details of certificates\n");
BIO_printf(bio_err," -noout don't output encoded data\n");
- EXIT(1);
+ OPENSSL_EXIT(1);
}
ERR_load_crypto_strings();
if (p7 != NULL) PKCS7_free(p7);
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free_all(out);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
ERR_print_errors(bio_err);
if (out)
BIO_free_all(out);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
#ifndef NO_DSA
if (dsa_params != NULL) DSA_free(dsa_params);
#endif
- EXIT(ex);
+ OPENSSL_EXIT(ex);
}
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
if(rsa != NULL) RSA_free(rsa);
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
#else /* !NO_RSA */
BIO_free(bio_c_out);
bio_c_out=NULL;
}
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
BIO_free(bio_s_out);
bio_s_out=NULL;
}
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
if (tm_cipher == NULL ) {
fprintf( stderr, "No CIPHER specified\n" );
-/* EXIT(1); */
+/* OPENSSL_EXIT(1); */
}
if (!(perform & 1)) goto next;
SSL_CTX_free(tm_ctx);
tm_ctx=NULL;
}
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
/***********************************************************************
end:
if (out != NULL) BIO_free_all(out);
if (x != NULL) SSL_SESSION_free(x);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static SSL_SESSION *load_sess_id(char *infile, int format)
if (dsa_key[i] != NULL)
DSA_free(dsa_key[i]);
#endif
- EXIT(mret);
+ OPENSSL_EXIT(mret);
}
static void print_message(char *s, long num, int length)
BIO_free(key);
EVP_PKEY_free(pkey);
if(passin) OPENSSL_free(passin);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
sk_X509_pop_free(untrusted, X509_free);
sk_X509_pop_free(trusted, X509_free);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose)
}
if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
end:
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
if (passin) OPENSSL_free(passin);
- EXIT(ret);
+ OPENSSL_EXIT(ret);
}
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
# 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)
# else
-# define EXIT(n) return(n)
+# define EXIT(n) return(n)
# 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
*/
-# 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; \
- 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 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()
(((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.