From e31e7ff5632d3b2531531ee717d286161aa02297 Mon Sep 17 00:00:00 2001 From: jsing Date: Thu, 24 Apr 2014 12:22:22 +0000 Subject: [PATCH] When OPENSSL_C is not defined, apps_startup becomes a signal(SIGPIPE, SIG_IGN) and apps_shutdown is a no-op. So just do that instead. ok beck@ --- lib/libssl/src/apps/asn1pars.c | 4 ++-- lib/libssl/src/apps/ca.c | 4 ++-- lib/libssl/src/apps/ciphers.c | 4 ++-- lib/libssl/src/apps/cms.c | 2 +- lib/libssl/src/apps/crl.c | 4 ++-- lib/libssl/src/apps/crl2p7.c | 4 ++-- lib/libssl/src/apps/dgst.c | 4 ++-- lib/libssl/src/apps/dh.c | 4 ++-- lib/libssl/src/apps/dhparam.c | 4 ++-- lib/libssl/src/apps/dsa.c | 4 ++-- lib/libssl/src/apps/dsaparam.c | 4 ++-- lib/libssl/src/apps/ec.c | 4 ++-- lib/libssl/src/apps/ecparam.c | 4 ++-- lib/libssl/src/apps/enc.c | 4 ++-- lib/libssl/src/apps/engine.c | 4 ++-- lib/libssl/src/apps/errstr.c | 4 ++-- lib/libssl/src/apps/gendh.c | 4 ++-- lib/libssl/src/apps/gendsa.c | 4 ++-- lib/libssl/src/apps/genrsa.c | 4 ++-- lib/libssl/src/apps/passwd.c | 4 ++-- lib/libssl/src/apps/pkcs12.c | 4 ++-- lib/libssl/src/apps/pkcs7.c | 4 ++-- lib/libssl/src/apps/prime.c | 2 +- lib/libssl/src/apps/rand.c | 4 ++-- lib/libssl/src/apps/req.c | 4 ++-- lib/libssl/src/apps/rsa.c | 4 ++-- lib/libssl/src/apps/s_client.c | 4 ++-- lib/libssl/src/apps/s_server.c | 4 ++-- lib/libssl/src/apps/s_time.c | 4 ++-- lib/libssl/src/apps/sess_id.c | 4 ++-- lib/libssl/src/apps/smime.c | 2 +- lib/libssl/src/apps/speed.c | 4 ++-- lib/libssl/src/apps/spkac.c | 4 ++-- lib/libssl/src/apps/srp.c | 4 ++-- lib/libssl/src/apps/ts.c | 2 +- lib/libssl/src/apps/verify.c | 4 ++-- lib/libssl/src/apps/version.c | 4 ++-- lib/libssl/src/apps/x509.c | 4 ++-- 38 files changed, 72 insertions(+), 72 deletions(-) diff --git a/lib/libssl/src/apps/asn1pars.c b/lib/libssl/src/apps/asn1pars.c index c52748c2aae..1459a5ac386 100644 --- a/lib/libssl/src/apps/asn1pars.c +++ b/lib/libssl/src/apps/asn1pars.c @@ -100,7 +100,7 @@ asn1parse_main(int argc, char **argv) informat = FORMAT_PEM; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -346,7 +346,7 @@ end: if (osk != NULL) sk_OPENSSL_STRING_free(osk); OBJ_cleanup(); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/ca.c b/lib/libssl/src/apps/ca.c index ccd522571e6..617264bb2f1 100644 --- a/lib/libssl/src/apps/ca.c +++ b/lib/libssl/src/apps/ca.c @@ -322,7 +322,7 @@ ca_main(int argc, char **argv) EF_ALIGNMENT = 0; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); conf = NULL; key = NULL; @@ -1399,7 +1399,7 @@ err: NCONF_free(conf); NCONF_free(extconf); OBJ_cleanup(); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/ciphers.c b/lib/libssl/src/apps/ciphers.c index 72a50e3f578..3e2fb4c4467 100644 --- a/lib/libssl/src/apps/ciphers.c +++ b/lib/libssl/src/apps/ciphers.c @@ -93,7 +93,7 @@ ciphers_main(int argc, char **argv) meth = SSLv3_server_method(); - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); @@ -195,6 +195,6 @@ end: SSL_free(ssl); if (STDout != NULL) BIO_free_all(STDout); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/cms.c b/lib/libssl/src/apps/cms.c index 8828a243c2b..aa59b28e863 100644 --- a/lib/libssl/src/apps/cms.c +++ b/lib/libssl/src/apps/cms.c @@ -144,7 +144,7 @@ cms_main(int argc, char **argv) args = argv + 1; ret = 1; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) { if ((bio_err = BIO_new(BIO_s_file())) != NULL) diff --git a/lib/libssl/src/apps/crl.c b/lib/libssl/src/apps/crl.c index 60ce43df223..864f3ca530c 100644 --- a/lib/libssl/src/apps/crl.c +++ b/lib/libssl/src/apps/crl.c @@ -124,7 +124,7 @@ crl_main(int argc, char **argv) int do_ver = 0; const EVP_MD *md_alg, *digest = EVP_sha1(); - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -380,7 +380,7 @@ end: X509_STORE_CTX_cleanup(&ctx); X509_STORE_free(store); } - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/crl2p7.c b/lib/libssl/src/apps/crl2p7.c index 88b4d46a1be..4d3ff4d4593 100644 --- a/lib/libssl/src/apps/crl2p7.c +++ b/lib/libssl/src/apps/crl2p7.c @@ -96,7 +96,7 @@ crl2pkcs7_main(int argc, char **argv) STACK_OF(X509) * cert_stack = NULL; int ret = 1, nocrl = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -260,7 +260,7 @@ end: if (crl != NULL) X509_CRL_free(crl); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/dgst.c b/lib/libssl/src/apps/dgst.c index e4741855dce..04f49580fa7 100644 --- a/lib/libssl/src/apps/dgst.c +++ b/lib/libssl/src/apps/dgst.c @@ -130,7 +130,7 @@ dgst_main(int argc, char **argv) int non_fips_allow = 0; STACK_OF(OPENSSL_STRING) * sigopts = NULL, *macopts = NULL; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if ((buf = (unsigned char *) malloc(BUFSIZE)) == NULL) { BIO_printf(bio_err, "out of memory\n"); @@ -491,7 +491,7 @@ end: free(sigbuf); if (bmd != NULL) BIO_free(bmd); - apps_shutdown(); + return (err); } diff --git a/lib/libssl/src/apps/dh.c b/lib/libssl/src/apps/dh.c index c841e6826b2..a02bae93c58 100644 --- a/lib/libssl/src/apps/dh.c +++ b/lib/libssl/src/apps/dh.c @@ -96,7 +96,7 @@ dh_main(int argc, char **argv) char *engine; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -310,7 +310,7 @@ end: BIO_free_all(out); if (dh != NULL) DH_free(dh); - apps_shutdown(); + return (ret); } #endif diff --git a/lib/libssl/src/apps/dhparam.c b/lib/libssl/src/apps/dhparam.c index 249d9a7751f..45bfd18f683 100644 --- a/lib/libssl/src/apps/dhparam.c +++ b/lib/libssl/src/apps/dhparam.c @@ -162,7 +162,7 @@ dhparam_main(int argc, char **argv) #endif int num = 0, g = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -475,7 +475,7 @@ end: BIO_free_all(out); if (dh != NULL) DH_free(dh); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/dsa.c b/lib/libssl/src/apps/dsa.c index 9546790c0d0..2a27365adf1 100644 --- a/lib/libssl/src/apps/dsa.c +++ b/lib/libssl/src/apps/dsa.c @@ -113,7 +113,7 @@ dsa_main(int argc, char **argv) int pvk_encr = 2; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -340,7 +340,7 @@ end: free(passin); if (passout) free(passout); - apps_shutdown(); + return (ret); } #endif diff --git a/lib/libssl/src/apps/dsaparam.c b/lib/libssl/src/apps/dsaparam.c index ae501b2d049..21f40e5c153 100644 --- a/lib/libssl/src/apps/dsaparam.c +++ b/lib/libssl/src/apps/dsaparam.c @@ -124,7 +124,7 @@ dsaparam_main(int argc, char **argv) int timebomb = 0; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -397,7 +397,7 @@ end: BIO_free_all(out); if (dsa != NULL) DSA_free(dsa); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/ec.c b/lib/libssl/src/apps/ec.c index 55a65d57862..0fcf81a79e2 100644 --- a/lib/libssl/src/apps/ec.c +++ b/lib/libssl/src/apps/ec.c @@ -100,7 +100,7 @@ ec_main(int argc, char **argv) int asn1_flag = OPENSSL_EC_NAMED_CURVE; int new_asn1_flag = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -344,7 +344,7 @@ end: free(passin); if (passout) free(passout); - apps_shutdown(); + return (ret); } #endif diff --git a/lib/libssl/src/apps/ecparam.c b/lib/libssl/src/apps/ecparam.c index 7a071667c41..49aeab8355e 100644 --- a/lib/libssl/src/apps/ecparam.c +++ b/lib/libssl/src/apps/ecparam.c @@ -134,7 +134,7 @@ ecparam_main(int argc, char **argv) *ec_order = NULL, *ec_cofactor = NULL; unsigned char *buffer = NULL; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -597,7 +597,7 @@ end: BIO_free_all(out); if (group != NULL) EC_GROUP_free(group); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/enc.c b/lib/libssl/src/apps/enc.c index 5a0dca5cfee..e2e6fecba68 100644 --- a/lib/libssl/src/apps/enc.c +++ b/lib/libssl/src/apps/enc.c @@ -131,7 +131,7 @@ enc_main(int argc, char **argv) const EVP_MD *dgst = NULL; int non_fips_allow = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -635,7 +635,7 @@ end: #endif if (pass) free(pass); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/engine.c b/lib/libssl/src/apps/engine.c index 3bf81ab0177..6134de94cb5 100644 --- a/lib/libssl/src/apps/engine.c +++ b/lib/libssl/src/apps/engine.c @@ -336,7 +336,7 @@ engine_main(int argc, char **argv) BIO *bio_out = NULL; const char *indent = " "; - apps_startup(); + signal(SIGPIPE, SIG_IGN); SSL_load_error_strings(); if (bio_err == NULL) @@ -499,7 +499,7 @@ end: sk_OPENSSL_STRING_pop_free(post_cmds, identity); if (bio_out != NULL) BIO_free_all(bio_out); - apps_shutdown(); + return (ret); } #endif diff --git a/lib/libssl/src/apps/errstr.c b/lib/libssl/src/apps/errstr.c index 71470847043..9766a54b089 100644 --- a/lib/libssl/src/apps/errstr.c +++ b/lib/libssl/src/apps/errstr.c @@ -75,7 +75,7 @@ errstr_main(int argc, char **argv) char buf[256]; unsigned long l; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -110,6 +110,6 @@ errstr_main(int argc, char **argv) ret++; } } - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/gendh.c b/lib/libssl/src/apps/gendh.c index 94c48272797..f93e044a6dd 100644 --- a/lib/libssl/src/apps/gendh.c +++ b/lib/libssl/src/apps/gendh.c @@ -98,7 +98,7 @@ gendh_main(int argc, char **argv) #endif BIO *out = NULL; - apps_startup(); + signal(SIGPIPE, SIG_IGN); BN_GENCB_set(&cb, dh_cb, bio_err); if (bio_err == NULL) @@ -192,7 +192,7 @@ end: BIO_free_all(out); if (dh != NULL) DH_free(dh); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/gendsa.c b/lib/libssl/src/apps/gendsa.c index f21036a608e..8a0d3ecbed9 100644 --- a/lib/libssl/src/apps/gendsa.c +++ b/lib/libssl/src/apps/gendsa.c @@ -88,7 +88,7 @@ gendsa_main(int argc, char **argv) char *engine = NULL; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -247,7 +247,7 @@ end: DSA_free(dsa); if (passout) free(passout); - apps_shutdown(); + return (ret); } #endif diff --git a/lib/libssl/src/apps/genrsa.c b/lib/libssl/src/apps/genrsa.c index 020bc49aafc..79c228f2d39 100644 --- a/lib/libssl/src/apps/genrsa.c +++ b/lib/libssl/src/apps/genrsa.c @@ -109,7 +109,7 @@ genrsa_main(int argc, char **argv) if (!bn) goto err; - apps_startup(); + signal(SIGPIPE, SIG_IGN); BN_GENCB_set(&cb, genrsa_cb, bio_err); if (bio_err == NULL) @@ -284,7 +284,7 @@ err: free(passout); if (ret != 0) ERR_print_errors(bio_err); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/passwd.c b/lib/libssl/src/apps/passwd.c index a08edb240a9..105625b4ed8 100644 --- a/lib/libssl/src/apps/passwd.c +++ b/lib/libssl/src/apps/passwd.c @@ -73,7 +73,7 @@ passwd_main(int argc, char **argv) int usecrypt = 0, use1 = 0, useapr1 = 0; size_t pw_maxlen = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -257,7 +257,7 @@ err: BIO_free(in); if (out) BIO_free_all(out); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/pkcs12.c b/lib/libssl/src/apps/pkcs12.c index 44ee6986054..55a5779360d 100644 --- a/lib/libssl/src/apps/pkcs12.c +++ b/lib/libssl/src/apps/pkcs12.c @@ -130,7 +130,7 @@ pkcs12_main(int argc, char **argv) char *engine = NULL; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC; @@ -710,7 +710,7 @@ end: free(passin); if (passout) free(passout); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/pkcs7.c b/lib/libssl/src/apps/pkcs7.c index 41c9689cc7d..c2093ddd121 100644 --- a/lib/libssl/src/apps/pkcs7.c +++ b/lib/libssl/src/apps/pkcs7.c @@ -92,7 +92,7 @@ pkcs7_main(int argc, char **argv) char *engine = NULL; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -287,6 +287,6 @@ end: BIO_free(in); if (out != NULL) BIO_free_all(out); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/prime.c b/lib/libssl/src/apps/prime.c index 44998cde0fe..5d15f5fbd7c 100644 --- a/lib/libssl/src/apps/prime.c +++ b/lib/libssl/src/apps/prime.c @@ -67,7 +67,7 @@ prime_main(int argc, char **argv) BIGNUM *bn = NULL; BIO *bio_out; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) diff --git a/lib/libssl/src/apps/rand.c b/lib/libssl/src/apps/rand.c index fa8a65a267b..458d5ac7b88 100644 --- a/lib/libssl/src/apps/rand.c +++ b/lib/libssl/src/apps/rand.c @@ -88,7 +88,7 @@ rand_main(int argc, char **argv) char *engine = NULL; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -207,6 +207,6 @@ err: ERR_print_errors(bio_err); if (out) BIO_free_all(out); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/req.c b/lib/libssl/src/apps/req.c index a4a3414b95e..1ff0b63b8ca 100644 --- a/lib/libssl/src/apps/req.c +++ b/lib/libssl/src/apps/req.c @@ -188,7 +188,7 @@ req_main(int argc, char **argv) #ifndef OPENSSL_NO_DES cipher = EVP_des_ede3_cbc(); #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -922,7 +922,7 @@ end: if (passargout && passout) free(passout); OBJ_cleanup(); - apps_shutdown(); + return (ex); } diff --git a/lib/libssl/src/apps/rsa.c b/lib/libssl/src/apps/rsa.c index eef0a921534..21bc3ba93ce 100644 --- a/lib/libssl/src/apps/rsa.c +++ b/lib/libssl/src/apps/rsa.c @@ -116,7 +116,7 @@ rsa_main(int argc, char **argv) int pvk_encr = 2; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -399,7 +399,7 @@ end: free(passin); if (passout) free(passout); - apps_shutdown(); + return (ret); } #endif diff --git a/lib/libssl/src/apps/s_client.c b/lib/libssl/src/apps/s_client.c index 871e6966d54..4bfdcab9181 100644 --- a/lib/libssl/src/apps/s_client.c +++ b/lib/libssl/src/apps/s_client.c @@ -608,7 +608,7 @@ s_client_main(int argc, char **argv) meth = SSLv23_client_method(); - apps_startup(); + signal(SIGPIPE, SIG_IGN); c_Pause = 0; c_quiet = 0; c_ign_eof = 0; @@ -1672,7 +1672,7 @@ end: BIO_free(bio_c_out); bio_c_out = NULL; } - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/s_server.c b/lib/libssl/src/apps/s_server.c index b6eb1637529..37c6e1b9a75 100644 --- a/lib/libssl/src/apps/s_server.c +++ b/lib/libssl/src/apps/s_server.c @@ -789,7 +789,7 @@ s_server_main(int argc, char *argv[]) local_argc = argc; local_argv = argv; - apps_startup(); + signal(SIGPIPE, SIG_IGN); s_server_init(); if (bio_err == NULL) @@ -1612,7 +1612,7 @@ end: BIO_free(bio_s_out); bio_s_out = NULL; } - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/s_time.c b/lib/libssl/src/apps/s_time.c index a532a3f385c..e048a551b29 100644 --- a/lib/libssl/src/apps/s_time.c +++ b/lib/libssl/src/apps/s_time.c @@ -325,7 +325,7 @@ s_time_main(int argc, char **argv) char buf[1024 * 8]; int ver; - apps_startup(); + signal(SIGPIPE, SIG_IGN); s_time_init(); if (bio_err == NULL) @@ -525,7 +525,7 @@ end: SSL_CTX_free(tm_ctx); tm_ctx = NULL; } - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/sess_id.c b/lib/libssl/src/apps/sess_id.c index 5ea5c979727..95bc71fe70b 100644 --- a/lib/libssl/src/apps/sess_id.c +++ b/lib/libssl/src/apps/sess_id.c @@ -97,7 +97,7 @@ sess_id_main(int argc, char **argv) int cert = 0, noout = 0, text = 0; const char **pp; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -245,7 +245,7 @@ end: BIO_free_all(out); if (x != NULL) SSL_SESSION_free(x); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/smime.c b/lib/libssl/src/apps/smime.c index 1b4a8aa9c2b..a241231b08d 100644 --- a/lib/libssl/src/apps/smime.c +++ b/lib/libssl/src/apps/smime.c @@ -120,7 +120,7 @@ smime_main(int argc, char **argv) args = argv + 1; ret = 1; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) { if ((bio_err = BIO_new(BIO_s_file())) != NULL) diff --git a/lib/libssl/src/apps/speed.c b/lib/libssl/src/apps/speed.c index 56abf47c0e3..7271f3ba504 100644 --- a/lib/libssl/src/apps/speed.c +++ b/lib/libssl/src/apps/speed.c @@ -533,7 +533,7 @@ speed_main(int argc, char **argv) usertime = -1; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); memset(results, 0, sizeof(results)); #ifndef OPENSSL_NO_DSA memset(dsa_key, 0, sizeof(dsa_key)); @@ -2111,7 +2111,7 @@ end: } #endif - apps_shutdown(); + return (mret); } diff --git a/lib/libssl/src/apps/spkac.c b/lib/libssl/src/apps/spkac.c index aa6be24361c..7de9450b875 100644 --- a/lib/libssl/src/apps/spkac.c +++ b/lib/libssl/src/apps/spkac.c @@ -96,7 +96,7 @@ spkac_main(int argc, char **argv) char *engine = NULL; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); @@ -283,6 +283,6 @@ end: EVP_PKEY_free(pkey); if (passin) free(passin); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/srp.c b/lib/libssl/src/apps/srp.c index 9c3dcdb1d65..24b7f317c37 100644 --- a/lib/libssl/src/apps/srp.c +++ b/lib/libssl/src/apps/srp.c @@ -295,7 +295,7 @@ srp_main(int argc, char **argv) EF_ALIGNMENT = 0; #endif - apps_startup(); + signal(SIGPIPE, SIG_IGN); conf = NULL; section = NULL; @@ -660,7 +660,7 @@ err: free_index(db); OBJ_cleanup(); - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/ts.c b/lib/libssl/src/apps/ts.c index bfd675bbc77..d154616a858 100644 --- a/lib/libssl/src/apps/ts.c +++ b/lib/libssl/src/apps/ts.c @@ -156,7 +156,7 @@ ts_main(int argc, char **argv) int free_bio_err = 0; ERR_load_crypto_strings(); - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL && (bio_err = BIO_new(BIO_s_file())) != NULL) { free_bio_err = 1; diff --git a/lib/libssl/src/apps/verify.c b/lib/libssl/src/apps/verify.c index 70949891779..e2d34bccb3e 100644 --- a/lib/libssl/src/apps/verify.c +++ b/lib/libssl/src/apps/verify.c @@ -97,7 +97,7 @@ verify_main(int argc, char **argv) ERR_load_crypto_strings(); - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -246,7 +246,7 @@ end: sk_X509_pop_free(untrusted, X509_free); sk_X509_pop_free(trusted, X509_free); sk_X509_CRL_pop_free(crls, X509_CRL_free); - apps_shutdown(); + return (ret < 0 ? 2 : ret); } diff --git a/lib/libssl/src/apps/version.c b/lib/libssl/src/apps/version.c index 91a27326b5c..bd21f5d0171 100644 --- a/lib/libssl/src/apps/version.c +++ b/lib/libssl/src/apps/version.c @@ -142,7 +142,7 @@ version_main(int argc, char **argv) int cflags = 0, version = 0, date = 0, options = 0, platform = 0, dir = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -210,6 +210,6 @@ version_main(int argc, char **argv) if (dir) printf("%s\n", SSLeay_version(SSLEAY_DIR)); end: - apps_shutdown(); + return (ret); } diff --git a/lib/libssl/src/apps/x509.c b/lib/libssl/src/apps/x509.c index 319f288c31c..fb301d3ea8a 100644 --- a/lib/libssl/src/apps/x509.c +++ b/lib/libssl/src/apps/x509.c @@ -209,7 +209,7 @@ x509_main(int argc, char **argv) reqfile = 0; - apps_startup(); + signal(SIGPIPE, SIG_IGN); if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); @@ -948,7 +948,7 @@ end: sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free); if (passin) free(passin); - apps_shutdown(); + return (ret); } -- 2.20.1