From 1020b5f17adfedd0236b2a9636e2b3348d1f1e1b Mon Sep 17 00:00:00 2001 From: jsing Date: Wed, 7 Feb 2018 05:47:55 +0000 Subject: [PATCH] Indent labels with a single space so that diff prototypes are more useful. --- usr.bin/openssl/apps.c | 44 ++++++++++++++++++------------------- usr.bin/openssl/asn1pars.c | 8 +++---- usr.bin/openssl/ca.c | 24 ++++++++++---------- usr.bin/openssl/certhash.c | 16 +++++++------- usr.bin/openssl/ciphers.c | 6 ++--- usr.bin/openssl/crl.c | 6 ++--- usr.bin/openssl/crl2p7.c | 6 ++--- usr.bin/openssl/dgst.c | 4 ++-- usr.bin/openssl/dh.c | 4 ++-- usr.bin/openssl/dhparam.c | 4 ++-- usr.bin/openssl/dsa.c | 4 ++-- usr.bin/openssl/dsaparam.c | 4 ++-- usr.bin/openssl/ec.c | 4 ++-- usr.bin/openssl/ecparam.c | 4 ++-- usr.bin/openssl/enc.c | 4 ++-- usr.bin/openssl/gendh.c | 4 ++-- usr.bin/openssl/gendsa.c | 6 ++--- usr.bin/openssl/genpkey.c | 10 ++++----- usr.bin/openssl/genrsa.c | 6 ++--- usr.bin/openssl/nseq.c | 4 ++-- usr.bin/openssl/ocsp.c | 16 +++++++------- usr.bin/openssl/openssl.c | 8 +++---- usr.bin/openssl/passwd.c | 6 ++--- usr.bin/openssl/pkcs12.c | 8 +++---- usr.bin/openssl/pkcs7.c | 4 ++-- usr.bin/openssl/pkcs8.c | 4 ++-- usr.bin/openssl/pkey.c | 6 ++--- usr.bin/openssl/pkeyparam.c | 4 ++-- usr.bin/openssl/pkeyutl.c | 6 ++--- usr.bin/openssl/prime.c | 4 ++-- usr.bin/openssl/rand.c | 4 ++-- usr.bin/openssl/req.c | 20 ++++++++--------- usr.bin/openssl/rsa.c | 4 ++-- usr.bin/openssl/rsautl.c | 4 ++-- usr.bin/openssl/s_client.c | 8 +++---- usr.bin/openssl/s_server.c | 18 +++++++-------- usr.bin/openssl/s_socket.c | 10 ++++----- usr.bin/openssl/s_time.c | 6 ++--- usr.bin/openssl/sess_id.c | 6 ++--- usr.bin/openssl/smime.c | 6 ++--- usr.bin/openssl/speed.c | 4 ++-- usr.bin/openssl/spkac.c | 4 ++-- usr.bin/openssl/ts.c | 30 ++++++++++++------------- usr.bin/openssl/verify.c | 6 ++--- usr.bin/openssl/x509.c | 12 +++++----- 45 files changed, 190 insertions(+), 190 deletions(-) diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index 2dab036b320..22b6b2838bf 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.45 2018/02/07 04:25:19 jsing Exp $ */ +/* $OpenBSD: apps.c,v 1.46 2018/02/07 05:47:55 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -583,7 +583,7 @@ load_pkcs12(BIO *err, BIO *in, const char *desc, pem_password_cb *pem_cb, } ret = PKCS12_parse(p12, pass, pkey, cert, ca); -die: + die: PKCS12_free(p12); return ret; } @@ -642,7 +642,7 @@ load_cert(BIO *err, const char *file, int format, const char *pass, goto end; } -end: + end: if (x == NULL) { BIO_printf(err, "unable to load certificate\n"); ERR_print_errors(err); @@ -705,7 +705,7 @@ load_key(BIO *err, const char *file, int format, int maybe_stdin, BIO_printf(err, "bad input format specified for key file\n"); goto end; } -end: + end: BIO_free(key); if (pkey == NULL) { BIO_printf(err, "unable to load %s\n", key_descrip); @@ -782,7 +782,7 @@ load_pubkey(BIO *err, const char *file, int format, int maybe_stdin, goto end; } -end: + end: BIO_free(key); if (pkey == NULL) BIO_printf(err, "unable to load %s\n", key_descrip); @@ -827,7 +827,7 @@ load_netscape_key(BIO *err, BIO *key, const char *file, EVP_PKEY_set1_RSA(pkey, rsa); return pkey; -error: + error: BUF_MEM_free(buf); EVP_PKEY_free(pkey); return NULL; @@ -898,7 +898,7 @@ load_certs_crls(BIO *err, const char *file, int format, const char *pass, if (pcrls && sk_X509_CRL_num(*pcrls) > 0) rv = 1; -end: + end: sk_X509_INFO_pop_free(xis, X509_INFO_free); if (rv == 0) { @@ -1064,7 +1064,7 @@ copy_extensions(X509 *x, X509_REQ *req, int copy_type) ret = 1; -end: + end: sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); return ret; @@ -1179,7 +1179,7 @@ setup_verify(BIO *bp, char *CAfile, char *CApath) ERR_clear_error(); return store; -end: + end: X509_STORE_free(store); return NULL; } @@ -1308,7 +1308,7 @@ load_serial(char *serialfile, int create, ASN1_INTEGER **retai) ai = NULL; } -err: + err: BIO_free(in); ASN1_INTEGER_free(ai); return (ret); @@ -1354,7 +1354,7 @@ save_serial(char *serialfile, char *suffix, BIGNUM *serial, ai = NULL; } -err: + err: BIO_free_all(out); ASN1_INTEGER_free(ai); return (ret); @@ -1399,7 +1399,7 @@ rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) } return 1; -err: + err: return 0; } @@ -1424,7 +1424,7 @@ rand_serial(BIGNUM *b, ASN1_INTEGER *ai) ret = 1; -error: + error: BN_free(btmp); return ret; @@ -1489,7 +1489,7 @@ load_index(char *dbfile, DB_ATTR *db_attr) } } -err: + err: NCONF_free(dbattr_conf); TXT_DB_free(tmpdb); BIO_free_all(in); @@ -1562,7 +1562,7 @@ save_index(const char *file, const char *suffix, CA_DB *db) return 1; -err: + err: return 0; } @@ -1657,7 +1657,7 @@ rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) } return 1; -err: + err: return 0; } @@ -1820,11 +1820,11 @@ parse_name(char *subject, long chtype, int multirdn) } goto done; -error: + error: X509_NAME_free(name); name = NULL; -done: + done: free(ne_values); free(ne_types); free(mval); @@ -1958,7 +1958,7 @@ args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, if (at_time) X509_VERIFY_PARAM_set_time(*pm, at_time); -end: + end: (*pargs)++; if (pargc) @@ -2304,17 +2304,17 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed, } } -done: + done: if (argsused != NULL) *argsused = i; return (0); -toomany: + toomany: fprintf(stderr, "too many arguments\n"); return (1); -unknown: + unknown: fprintf(stderr, "unknown option '%s'\n", arg); return (1); } diff --git a/usr.bin/openssl/asn1pars.c b/usr.bin/openssl/asn1pars.c index 0f432c246bc..a17584e8a32 100644 --- a/usr.bin/openssl/asn1pars.c +++ b/usr.bin/openssl/asn1pars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1pars.c,v 1.8 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: asn1pars.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -408,7 +408,7 @@ asn1parse_main(int argc, char **argv) goto end; } ret = 0; -end: + end: BIO_free(derout); BIO_free(in); BIO_free_all(out); @@ -464,7 +464,7 @@ do_generate(BIO * bio, char *genstr, char *genconf, BUF_MEM * buf) ASN1_TYPE_free(atyp); return len; -conferr: + conferr: if (errline > 0) BIO_printf(bio, "Error on line %ld of config file '%s'\n", @@ -472,7 +472,7 @@ conferr: else BIO_printf(bio, "Error loading config file '%s'\n", genconf); -err: + err: NCONF_free(cnf); ASN1_TYPE_free(atyp); diff --git a/usr.bin/openssl/ca.c b/usr.bin/openssl/ca.c index 5414a921d40..2e798495723 100644 --- a/usr.bin/openssl/ca.c +++ b/usr.bin/openssl/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.25 2017/05/08 21:12:36 beck Exp $ */ +/* $OpenBSD: ca.c,v 1.26 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -497,7 +497,7 @@ ca_main(int argc, char **argv) rev_type = REV_CA_COMPROMISE; } else { -bad: + bad: if (errstr) BIO_printf(bio_err, "invalid argument %s: %s\n", *argv, errstr); @@ -1310,7 +1310,7 @@ bad: /*****************************************************************/ ret = 0; -err: + err: free(tofree); BIO_free_all(Cout); @@ -1407,7 +1407,7 @@ certify(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, verbose, req, ext_sect, lconf, certopt, nameopt, default_op, ext_copy, selfsign); -err: + err: if (req != NULL) X509_REQ_free(req); if (in != NULL) @@ -1464,7 +1464,7 @@ certify_cert(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op, ext_copy, 0); -err: + err: if (rreq != NULL) X509_REQ_free(rreq); if (req != NULL) @@ -1969,7 +1969,7 @@ again2: goto err; } ok = 1; -err: + err: for (i = 0; i < DB_NUMBER; i++) free(row[i]); @@ -2126,7 +2126,7 @@ certify_spkac(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, verbose, req, ext_sect, lconf, certopt, nameopt, default_op, ext_copy, 0); -err: + err: if (req != NULL) X509_REQ_free(req); if (parms != NULL) @@ -2248,7 +2248,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value) } ok = 1; -err: + err: for (i = 0; i < DB_NUMBER; i++) free(row[i]); @@ -2320,7 +2320,7 @@ get_certificate_status(const char *serial, CA_DB * db) ok = -1; } -err: + err: for (i = 0; i < DB_NUMBER; i++) free(row[i]); @@ -2383,7 +2383,7 @@ do_updatedb(CA_DB * db) } } -err: + err: ASN1_UTCTIME_free(a_tm); free(a_tm_s); @@ -2534,7 +2534,7 @@ make_revoked(X509_REVOKED * rev, const char *str) else ret = 1; -err: + err: free(tmp); ASN1_OBJECT_free(hold); @@ -2681,7 +2681,7 @@ unpack_revinfo(ASN1_TIME ** prevtm, int *preason, ASN1_OBJECT ** phold, ret = 1; -err: + err: free(tmp); if (!phold) diff --git a/usr.bin/openssl/certhash.c b/usr.bin/openssl/certhash.c index fdd719ea48b..5838f0209b2 100644 --- a/usr.bin/openssl/certhash.c +++ b/usr.bin/openssl/certhash.c @@ -285,11 +285,11 @@ hashinfo_from_linkname(const char *linkname, const char *target) goto done; -err: + err: hashinfo_free(hi); hi = NULL; -done: + done: free(l); return (hi); @@ -318,7 +318,7 @@ certhash_cert(BIO *bio, const char *filename) hi = hashinfo(filename, hash, fingerprint); -err: + err: X509_free(cert); return (hi); @@ -347,7 +347,7 @@ certhash_crl(BIO *bio, const char *filename) hi = hashinfo(filename, hash, fingerprint); -err: + err: X509_CRL_free(crl); return (hi); @@ -371,7 +371,7 @@ certhash_addlink(struct hashinfo **links, struct hashinfo *hi) return (0); -err: + err: hashinfo_free(link); return (-1); } @@ -545,7 +545,7 @@ certhash_file(struct dirent *dep, struct hashinfo **certs, ret = 0; -err: + err: BIO_free(bio); return (ret); @@ -622,10 +622,10 @@ certhash_directory(const char *path) goto done; -err: + err: ret = 1; -done: + done: hashinfo_chain_free(certs); hashinfo_chain_free(crls); hashinfo_chain_free(links); diff --git a/usr.bin/openssl/ciphers.c b/usr.bin/openssl/ciphers.c index 72e12a3aae1..2b8ad5ba85a 100644 --- a/usr.bin/openssl/ciphers.c +++ b/usr.bin/openssl/ciphers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciphers.c,v 1.8 2015/10/17 15:00:11 doug Exp $ */ +/* $OpenBSD: ciphers.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -140,11 +140,11 @@ ciphers_main(int argc, char **argv) goto done; -err: + err: ERR_print_errors_fp(stderr); rv = 1; -done: + done: SSL_CTX_free(ssl_ctx); SSL_free(ssl); diff --git a/usr.bin/openssl/crl.c b/usr.bin/openssl/crl.c index bb7ff627751..645b16ea540 100644 --- a/usr.bin/openssl/crl.c +++ b/usr.bin/openssl/crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crl.c,v 1.10 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: crl.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -424,7 +424,7 @@ crl_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free_all(out); BIO_free_all(bio_out); bio_out = NULL; @@ -471,7 +471,7 @@ load_crl(char *infile, int format) goto end; } -end: + end: BIO_free(in); return (x); } diff --git a/usr.bin/openssl/crl2p7.c b/usr.bin/openssl/crl2p7.c index 9fceee80982..a9c48a3da0e 100644 --- a/usr.bin/openssl/crl2p7.c +++ b/usr.bin/openssl/crl2p7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crl2p7.c,v 1.7 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: crl2p7.c,v 1.8 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -277,7 +277,7 @@ crl2pkcs7_main(int argc, char **argv) } ret = 0; -end: + end: if (in != NULL) BIO_free(in); if (out != NULL) @@ -323,7 +323,7 @@ add_certs_from_file(STACK_OF(X509) *stack, char *certfile) ret = count; -end: + end: /* never need to free x */ if (in != NULL) BIO_free(in); diff --git a/usr.bin/openssl/dgst.c b/usr.bin/openssl/dgst.c index bcc9f1c7610..0bd8d66fc8a 100644 --- a/usr.bin/openssl/dgst.c +++ b/usr.bin/openssl/dgst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dgst.c,v 1.11 2017/04/18 02:15:50 deraadt Exp $ */ +/* $OpenBSD: dgst.c,v 1.12 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -447,7 +447,7 @@ mac_end: } } -end: + end: freezero(buf, BUFSIZE); if (in != NULL) BIO_free(in); diff --git a/usr.bin/openssl/dh.c b/usr.bin/openssl/dh.c index b8d4054e563..827ca9c7eac 100644 --- a/usr.bin/openssl/dh.c +++ b/usr.bin/openssl/dh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: dh.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -288,7 +288,7 @@ dh_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); DH_free(dh); diff --git a/usr.bin/openssl/dhparam.c b/usr.bin/openssl/dhparam.c index 13e8a49a1cd..f27a5c9e819 100644 --- a/usr.bin/openssl/dhparam.c +++ b/usr.bin/openssl/dhparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhparam.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: dhparam.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -466,7 +466,7 @@ dhparam_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); DH_free(dh); diff --git a/usr.bin/openssl/dsa.c b/usr.bin/openssl/dsa.c index 34b29eee3ea..0b99dedca63 100644 --- a/usr.bin/openssl/dsa.c +++ b/usr.bin/openssl/dsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: dsa.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -360,7 +360,7 @@ dsa_main(int argc, char **argv) ERR_print_errors(bio_err); } else ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); DSA_free(dsa); diff --git a/usr.bin/openssl/dsaparam.c b/usr.bin/openssl/dsaparam.c index dfafc2e077a..8b189cf559b 100644 --- a/usr.bin/openssl/dsaparam.c +++ b/usr.bin/openssl/dsaparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsaparam.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: dsaparam.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -338,7 +338,7 @@ dsaparam_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); DSA_free(dsa); diff --git a/usr.bin/openssl/ec.c b/usr.bin/openssl/ec.c index 7ef2ac8de11..f2dad6dfef2 100644 --- a/usr.bin/openssl/ec.c +++ b/usr.bin/openssl/ec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: ec.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -392,7 +392,7 @@ ec_main(int argc, char **argv) ERR_print_errors(bio_err); } else ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); EC_KEY_free(eckey); diff --git a/usr.bin/openssl/ecparam.c b/usr.bin/openssl/ecparam.c index 6c497bd3556..b1e52fadaff 100644 --- a/usr.bin/openssl/ecparam.c +++ b/usr.bin/openssl/ecparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecparam.c,v 1.16 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: ecparam.c,v 1.17 2018/02/07 05:47:55 jsing Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -572,7 +572,7 @@ ecparam_main(int argc, char **argv) } ret = 0; -end: + end: BN_free(ec_p); BN_free(ec_a); BN_free(ec_b); diff --git a/usr.bin/openssl/enc.c b/usr.bin/openssl/enc.c index 7f06fcc0644..39081601700 100644 --- a/usr.bin/openssl/enc.c +++ b/usr.bin/openssl/enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enc.c,v 1.13 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: enc.c,v 1.14 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -717,7 +717,7 @@ enc_main(int argc, char **argv) BIO_printf(bio_err, "bytes read :%8ld\n", BIO_number_read(in)); BIO_printf(bio_err, "bytes written:%8ld\n", BIO_number_written(out)); } -end: + end: ERR_print_errors(bio_err); free(strbuf); free(buff); diff --git a/usr.bin/openssl/gendh.c b/usr.bin/openssl/gendh.c index 9cbbe42b19c..18ff504e446 100644 --- a/usr.bin/openssl/gendh.c +++ b/usr.bin/openssl/gendh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gendh.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: gendh.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -186,7 +186,7 @@ gendh_main(int argc, char **argv) if (!PEM_write_bio_DHparams(out, dh)) goto end; ret = 0; -end: + end: if (ret != 0) ERR_print_errors(bio_err); BIO_free_all(out); diff --git a/usr.bin/openssl/gendsa.c b/usr.bin/openssl/gendsa.c index 1e6a6061e18..3197e7be7c2 100644 --- a/usr.bin/openssl/gendsa.c +++ b/usr.bin/openssl/gendsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gendsa.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: gendsa.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -143,7 +143,7 @@ gendsa_main(int argc, char **argv) } if (dsaparams == NULL) { -bad: + bad: BIO_printf(bio_err, "usage: gendsa [args] dsaparam-file\n"); BIO_printf(bio_err, " -out file - output the key to 'file'\n"); #ifndef OPENSSL_NO_DES @@ -202,7 +202,7 @@ bad: if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout)) goto end; ret = 0; -end: + end: if (ret != 0) ERR_print_errors(bio_err); BIO_free(in); diff --git a/usr.bin/openssl/genpkey.c b/usr.bin/openssl/genpkey.c index f161c55f7b1..9e8e08aef4e 100644 --- a/usr.bin/openssl/genpkey.c +++ b/usr.bin/openssl/genpkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: genpkey.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: genpkey.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -161,7 +161,7 @@ genpkey_main(int argc, char **argv) badarg = 1; if (badarg) { -bad: + bad: BIO_printf(bio_err, "Usage: genpkey [options]\n"); BIO_printf(bio_err, "where options may be\n"); BIO_printf(bio_err, "-out file output file\n"); @@ -237,7 +237,7 @@ bad: } ret = 0; -end: + end: EVP_PKEY_free(pkey); EVP_PKEY_CTX_free(ctx); BIO_free_all(out); @@ -279,7 +279,7 @@ init_keygen_file(BIO * err, EVP_PKEY_CTX ** pctx, *pctx = ctx; return 1; -err: + err: BIO_puts(err, "Error initializing context\n"); ERR_print_errors(err); EVP_PKEY_CTX_free(ctx); @@ -324,7 +324,7 @@ init_gen_str(BIO * err, EVP_PKEY_CTX ** pctx, *pctx = ctx; return 1; -err: + err: BIO_printf(err, "Error initializing %s context\n", algname); ERR_print_errors(err); EVP_PKEY_CTX_free(ctx); diff --git a/usr.bin/openssl/genrsa.c b/usr.bin/openssl/genrsa.c index 2780b74a03e..fdcd0c1105d 100644 --- a/usr.bin/openssl/genrsa.c +++ b/usr.bin/openssl/genrsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: genrsa.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: genrsa.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -165,7 +165,7 @@ genrsa_main(int argc, char **argv) argc--; } if ((argc >= 1) && ((sscanf(*argv, "%d", &num) == 0) || (num < 0))) { -bad: + bad: BIO_printf(bio_err, "usage: genrsa [args] [numbits]\n"); BIO_printf(bio_err, " -des encrypt the generated key with DES in cbc mode\n"); BIO_printf(bio_err, " -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n"); @@ -233,7 +233,7 @@ bad: } ret = 0; -err: + err: BN_free(bn); RSA_free(rsa); BIO_free_all(out); diff --git a/usr.bin/openssl/nseq.c b/usr.bin/openssl/nseq.c index 46691474166..d50bace12fb 100644 --- a/usr.bin/openssl/nseq.c +++ b/usr.bin/openssl/nseq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nseq.c,v 1.7 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: nseq.c,v 1.8 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -167,7 +167,7 @@ nseq_main(int argc, char **argv) PEM_write_bio_X509(out, x509); } ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); NETSCAPE_CERT_SEQUENCE_free(seq); diff --git a/usr.bin/openssl/ocsp.c b/usr.bin/openssl/ocsp.c index ad657b8a66e..60a53f0ca55 100644 --- a/usr.bin/openssl/ocsp.c +++ b/usr.bin/openssl/ocsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp.c,v 1.13 2017/11/29 23:47:18 guenther Exp $ */ +/* $OpenBSD: ocsp.c,v 1.14 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -732,7 +732,7 @@ done_resp: ret = 0; -end: + end: ERR_print_errors(bio_err); X509_free(signer); X509_STORE_free(store); @@ -783,7 +783,7 @@ add_ocsp_cert(OCSP_REQUEST ** req, X509 * cert, const EVP_MD * cert_id_md, X509 goto err; return 1; -err: + err: BIO_printf(bio_err, "Error Creating OCSP request\n"); return 0; } @@ -819,7 +819,7 @@ add_ocsp_serial(OCSP_REQUEST ** req, char *serial, const EVP_MD * cert_id_md, X5 goto err; return 1; -err: + err: BIO_printf(bio_err, "Error Creating OCSP request\n"); return 0; } @@ -977,7 +977,7 @@ make_ocsp_response(OCSP_RESPONSE ** resp, OCSP_REQUEST * req, CA_DB * db, *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs); -end: + end: ASN1_TIME_free(thisupd); ASN1_TIME_free(nextupd); OCSP_CERTID_free(ca_id); @@ -1030,7 +1030,7 @@ init_responder(char *port) } return acbio; -err: + err: BIO_free_all(acbio); BIO_free(bufbio); return NULL; @@ -1173,7 +1173,7 @@ query_responder(BIO * err, BIO * cbio, char *path, break; } } -err: + err: if (ctx) OCSP_REQ_CTX_free(ctx); @@ -1210,7 +1210,7 @@ process_responder(BIO * err, OCSP_REQUEST * req, resp = query_responder(err, cbio, path, headers, req, req_timeout); if (!resp) BIO_printf(bio_err, "Error querying OCSP responder\n"); -end: + end: if (cbio) BIO_free_all(cbio); if (ctx) diff --git a/usr.bin/openssl/openssl.c b/usr.bin/openssl/openssl.c index 346b1d83c79..b3e85d63baa 100644 --- a/usr.bin/openssl/openssl.c +++ b/usr.bin/openssl/openssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openssl.c,v 1.25 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: openssl.c,v 1.26 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -385,7 +385,7 @@ lock_dbg_cb(int mode, int type, const char *file, int line) goto err; } -err: + err: if (errstr) { /* we cannot use bio_err here */ fprintf(stderr, "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n", @@ -560,7 +560,7 @@ main(int argc, char **argv) BIO_printf(bio_err, "bad exit\n"); ret = 1; -end: + end: free(to_free); if (config != NULL) { @@ -707,7 +707,7 @@ do_cmd(LHASH_OF(FUNCTION) * prog, int argc, char *argv[]) BIO_printf(bio_err, "\n\n"); ret = 0; } -end: + end: return (ret); } diff --git a/usr.bin/openssl/passwd.c b/usr.bin/openssl/passwd.c index af5360448c5..428f75a7ca6 100644 --- a/usr.bin/openssl/passwd.c +++ b/usr.bin/openssl/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: passwd.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ #if defined OPENSSL_NO_MD5 #define NO_MD5CRYPT_1 @@ -273,7 +273,7 @@ passwd_main(int argc, char **argv) } ret = 0; -err: + err: ERR_print_errors(bio_err); free(salt_malloc); @@ -477,7 +477,7 @@ do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, BIO_printf(out, "%s\n", hash); return 1; -err: + err: return 0; } #else diff --git a/usr.bin/openssl/pkcs12.c b/usr.bin/openssl/pkcs12.c index 69d2d0a9508..2e852cebc73 100644 --- a/usr.bin/openssl/pkcs12.c +++ b/usr.bin/openssl/pkcs12.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkcs12.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -584,7 +584,7 @@ export_end: goto end; } ret = 0; -end: + end: if (p12) PKCS12_free(p12); BIO_free(in); @@ -637,7 +637,7 @@ dump_certs_keys_p12(BIO * out, PKCS12 * p12, char *pass, } ret = 1; -err: + err: if (asafes) sk_PKCS7_pop_free(asafes, PKCS7_free); @@ -768,7 +768,7 @@ get_cert_chain(X509 * cert, X509_STORE * store, STACK_OF(X509) ** chain) goto err; } else chn = X509_STORE_CTX_get1_chain(&store_ctx); -err: + err: X509_STORE_CTX_cleanup(&store_ctx); *chain = chn; diff --git a/usr.bin/openssl/pkcs7.c b/usr.bin/openssl/pkcs7.c index 32d1682ff10..f1edc9e4897 100644 --- a/usr.bin/openssl/pkcs7.c +++ b/usr.bin/openssl/pkcs7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs7.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkcs7.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -277,7 +277,7 @@ pkcs7_main(int argc, char **argv) } } ret = 0; -end: + end: if (p7 != NULL) PKCS7_free(p7); if (in != NULL) diff --git a/usr.bin/openssl/pkcs8.c b/usr.bin/openssl/pkcs8.c index 5d1c2023af0..a0dac887729 100644 --- a/usr.bin/openssl/pkcs8.c +++ b/usr.bin/openssl/pkcs8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs8.c,v 1.10 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkcs8.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999-2004. */ @@ -406,7 +406,7 @@ pkcs8_main(int argc, char **argv) } ret = 0; -end: + end: X509_SIG_free(p8); PKCS8_PRIV_KEY_INFO_free(p8inf); EVP_PKEY_free(pkey); diff --git a/usr.bin/openssl/pkey.c b/usr.bin/openssl/pkey.c index e91bc790906..49782317ee0 100644 --- a/usr.bin/openssl/pkey.c +++ b/usr.bin/openssl/pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkey.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkey.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -149,7 +149,7 @@ pkey_main(int argc, char **argv) } if (badarg) { -bad: + bad: BIO_printf(bio_err, "Usage pkey [options]\n"); BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, "-in file input file\n"); @@ -209,7 +209,7 @@ bad: } ret = 0; -end: + end: EVP_PKEY_free(pkey); BIO_free_all(out); BIO_free(in); diff --git a/usr.bin/openssl/pkeyparam.c b/usr.bin/openssl/pkeyparam.c index 698c105141e..51ea2b55fb5 100644 --- a/usr.bin/openssl/pkeyparam.c +++ b/usr.bin/openssl/pkeyparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkeyparam.c,v 1.10 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkeyparam.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -165,7 +165,7 @@ pkeyparam_main(int argc, char **argv) ret = 0; -end: + end: EVP_PKEY_free(pkey); BIO_free_all(out); BIO_free(in); diff --git a/usr.bin/openssl/pkeyutl.c b/usr.bin/openssl/pkeyutl.c index 659c2b2916c..87a9eeb6f5b 100644 --- a/usr.bin/openssl/pkeyutl.c +++ b/usr.bin/openssl/pkeyutl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkeyutl.c,v 1.13 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: pkeyutl.c,v 1.14 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -309,7 +309,7 @@ pkeyutl_main(int argc, char **argv) else BIO_write(out, buf_out, buf_outlen); -end: + end: EVP_PKEY_CTX_free(ctx); BIO_free(in); BIO_free_all(out); @@ -427,7 +427,7 @@ init_ctx(int *pkeysize, EVP_PKEY_CTX_free(ctx); ctx = NULL; } -end: + end: free(passin); diff --git a/usr.bin/openssl/prime.c b/usr.bin/openssl/prime.c index c9bf33bff94..280ccef5fc4 100644 --- a/usr.bin/openssl/prime.c +++ b/usr.bin/openssl/prime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prime.c,v 1.10 2015/10/17 15:00:11 doug Exp $ */ +/* $OpenBSD: prime.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved. * @@ -191,7 +191,7 @@ prime_main(int argc, char **argv) ret = 0; -end: + end: BN_free(bn); BIO_free_all(bio_out); diff --git a/usr.bin/openssl/rand.c b/usr.bin/openssl/rand.c index 6e4517ac0b6..0f91dde8b4e 100644 --- a/usr.bin/openssl/rand.c +++ b/usr.bin/openssl/rand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rand.c,v 1.12 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: rand.c,v 1.13 2018/02/07 05:47:55 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. * @@ -176,7 +176,7 @@ rand_main(int argc, char **argv) ret = 0; -err: + err: ERR_print_errors(bio_err); BIO_free_all(out); diff --git a/usr.bin/openssl/req.c b/usr.bin/openssl/req.c index 352e38b226a..c5cae4df897 100644 --- a/usr.bin/openssl/req.c +++ b/usr.bin/openssl/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: req.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -340,7 +340,7 @@ req_main(int argc, char **argv) } if (badops) { -bad: + bad: BIO_printf(bio_err, "%s [options] outfile\n", prog); BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, " -inform arg input format - DER or PEM\n"); @@ -591,7 +591,7 @@ bad: cipher = NULL; i = 0; -loop: + loop: if (!PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0, NULL, passout)) { if ((ERR_GET_REASON(ERR_peek_error()) == @@ -858,7 +858,7 @@ loop: } } ex = 0; -end: + end: if (ex) { ERR_print_errors(bio_err); } @@ -943,7 +943,7 @@ make_REQ(X509_REQ * req, EVP_PKEY * pkey, char *subj, int multirdn, goto err; ret = 1; -err: + err: return (ret); } @@ -996,7 +996,7 @@ prompt_info(X509_REQ * req, } if (sk_CONF_VALUE_num(dn_sk)) { i = -1; -start: for (;;) { + start: for (;;) { int ret; i++; if (sk_CONF_VALUE_num(dn_sk) <= i) @@ -1214,7 +1214,7 @@ add_DN_object(X509_NAME * n, char *text, const char *def, char *value, { int i, ret = 0; char buf[1024]; -start: + start: if (!batch) BIO_printf(bio_err, "%s [%s]:", text, def); (void) BIO_flush(bio_err); @@ -1255,7 +1255,7 @@ start: (unsigned char *) buf, -1, -1, mval)) goto err; ret = 1; -err: + err: return (ret); } @@ -1267,7 +1267,7 @@ add_attribute_object(X509_REQ * req, char *text, const char *def, int i; static char buf[1024]; -start: + start: if (!batch) BIO_printf(bio_err, "%s [%s]:", text, def); (void) BIO_flush(bio_err); @@ -1312,7 +1312,7 @@ start: goto err; } return (1); -err: + err: return (0); } diff --git a/usr.bin/openssl/rsa.c b/usr.bin/openssl/rsa.c index 7ad1da13b23..09fe8ef0d6a 100644 --- a/usr.bin/openssl/rsa.c +++ b/usr.bin/openssl/rsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: rsa.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -439,7 +439,7 @@ rsa_main(int argc, char **argv) } else ret = 0; -end: + end: BIO_free_all(out); RSA_free(rsa); free(passin); diff --git a/usr.bin/openssl/rsautl.c b/usr.bin/openssl/rsautl.c index 1c22e5df0f2..1e420b391d7 100644 --- a/usr.bin/openssl/rsautl.c +++ b/usr.bin/openssl/rsautl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsautl.c,v 1.12 2017/08/28 17:50:58 jsing Exp $ */ +/* $OpenBSD: rsautl.c,v 1.13 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -297,7 +297,7 @@ rsautl_main(int argc, char **argv) else BIO_write(out, rsa_out, rsa_outlen); -end: + end: RSA_free(rsa); BIO_free(in); BIO_free_all(out); diff --git a/usr.bin/openssl/s_client.c b/usr.bin/openssl/s_client.c index 158992aa04c..cedc495218b 100644 --- a/usr.bin/openssl/s_client.c +++ b/usr.bin/openssl/s_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_client.c,v 1.34 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: s_client.c,v 1.35 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -592,7 +592,7 @@ s_client_main(int argc, char **argv) goto bad; } if (badop) { -bad: + bad: if (errstr) BIO_printf(bio_err, "invalid argument %s: %s\n", *argv, errstr); @@ -1200,13 +1200,13 @@ re_start: } ret = 0; -shut: + shut: if (in_init) print_stuff(bio_c_out, con, full_log); SSL_shutdown(con); shutdown(SSL_get_fd(con), SHUT_RD); close(SSL_get_fd(con)); -end: + end: if (con != NULL) { if (prexit != 0) print_stuff(bio_c_out, con, 1); diff --git a/usr.bin/openssl/s_server.c b/usr.bin/openssl/s_server.c index 140ab923519..4bdafaf6822 100644 --- a/usr.bin/openssl/s_server.c +++ b/usr.bin/openssl/s_server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_server.c,v 1.29 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: s_server.c,v 1.30 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -487,7 +487,7 @@ cert_status_cb(SSL * s, void *arg) OCSP_RESPONSE_print(err, resp, 2); } ret = SSL_TLSEXT_ERR_OK; -done: + done: if (ret != SSL_TLSEXT_ERR_OK) ERR_print_errors(err); if (aia) { @@ -503,7 +503,7 @@ done: if (resp) OCSP_RESPONSE_free(resp); return ret; -err: + err: ret = SSL_TLSEXT_ERR_ALERT_FATAL; goto done; } @@ -858,7 +858,7 @@ s_server_main(int argc, char *argv[]) argv++; } if (badop) { -bad: + bad: if (errstr) BIO_printf(bio_err, "invalid argument %s: %s\n", *argv, errstr); @@ -1198,7 +1198,7 @@ bad: do_server(port, socket_type, &accept_socket, sv_body, context); print_stats(bio_s_out, ctx); ret = 0; -end: + end: SSL_CTX_free(ctx); X509_free(s_cert); X509_free(s_dcert); @@ -1540,7 +1540,7 @@ sv_body(char *hostname, int s, unsigned char *context) } } } -err: + err: if (con != NULL) { BIO_printf(bio_s_out, "shutting down SSL\n"); SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); @@ -1655,7 +1655,7 @@ load_dh_param(const char *dhfile) if ((bio = BIO_new_file(dhfile, "r")) == NULL) goto err; ret = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); -err: + err: BIO_free(bio); return (ret); } @@ -1940,11 +1940,11 @@ www_body(char *hostname, int s, unsigned char *context) } else break; } -end: + end: /* make sure we re-use sessions */ SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); -err: + err: if (ret >= 0) BIO_printf(bio_s_out, "ACCEPT\n"); diff --git a/usr.bin/openssl/s_socket.c b/usr.bin/openssl/s_socket.c index 869211de735..d3aff1b3bb5 100644 --- a/usr.bin/openssl/s_socket.c +++ b/usr.bin/openssl/s_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_socket.c,v 1.8 2015/09/10 02:23:29 lteo Exp $ */ +/* $OpenBSD: s_socket.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,7 +122,7 @@ init_client(int *sock, char *host, char *port, int type, int af) } perror("connect"); -out: + out: if (s != -1) close(s); freeaddrinfo(ai_top); @@ -210,7 +210,7 @@ init_server_long(int *sock, int port, char *ip, int type) goto err; *sock = s; ret = 1; -err: + err: if ((ret == 0) && (s != -1)) { shutdown(s, SHUT_RD); close(s); @@ -233,7 +233,7 @@ do_accept(int acc_sock, int *sock, char **host) socklen_t len; /* struct linger ling; */ -redoit: + redoit: memset((char *) &from, 0, sizeof(from)); len = sizeof(from); @@ -285,7 +285,7 @@ redoit: } } -end: + end: *sock = ret; return (1); } diff --git a/usr.bin/openssl/s_time.c b/usr.bin/openssl/s_time.c index e8e8a273a7f..ed89160b23d 100644 --- a/usr.bin/openssl/s_time.c +++ b/usr.bin/openssl/s_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_time.c,v 1.22 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: s_time.c,v 1.23 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -388,7 +388,7 @@ s_time_main(int argc, char **argv) * over */ -next: + next: if (!(s_time_config.perform & 2)) goto end; printf("\n\nNow timing with session id reuse.\n"); @@ -472,7 +472,7 @@ next: bytes_read / nConn); ret = 0; -end: + end: SSL_free(scon); if (tm_ctx != NULL) { diff --git a/usr.bin/openssl/sess_id.c b/usr.bin/openssl/sess_id.c index 3670f5404f7..e739d99d948 100644 --- a/usr.bin/openssl/sess_id.c +++ b/usr.bin/openssl/sess_id.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sess_id.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: sess_id.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -249,7 +249,7 @@ sess_id_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free_all(out); SSL_SESSION_free(x); @@ -289,7 +289,7 @@ load_sess_id(char *infile, int format) ERR_print_errors(bio_err); goto end; } -end: + end: BIO_free(in); return (x); } diff --git a/usr.bin/openssl/smime.c b/usr.bin/openssl/smime.c index 4222e24bc1b..e8f5201e1b4 100644 --- a/usr.bin/openssl/smime.c +++ b/usr.bin/openssl/smime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smime.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: smime.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -342,7 +342,7 @@ smime_main(int argc, char **argv) badarg = 1; if (badarg) { -argerr: + argerr: BIO_printf(bio_err, "Usage smime [options] cert.pem ...\n"); BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, "-encrypt encrypt message\n"); @@ -620,7 +620,7 @@ argerr: } } ret = 0; -end: + end: if (ret) ERR_print_errors(bio_err); sk_X509_pop_free(encerts, X509_free); diff --git a/usr.bin/openssl/speed.c b/usr.bin/openssl/speed.c index 4238b15f614..a21f67b5cfe 100644 --- a/usr.bin/openssl/speed.c +++ b/usr.bin/openssl/speed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: speed.c,v 1.21 2017/12/05 15:02:06 jca Exp $ */ +/* $OpenBSD: speed.c,v 1.22 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1897,7 +1897,7 @@ show_res: mret = 0; -end: + end: ERR_print_errors(bio_err); free(buf); free(buf2); diff --git a/usr.bin/openssl/spkac.c b/usr.bin/openssl/spkac.c index 77f3e3479c6..549a220589e 100644 --- a/usr.bin/openssl/spkac.c +++ b/usr.bin/openssl/spkac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spkac.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: spkac.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. Based on an original idea by Massimiliano Pala * (madwolf@openca.org). @@ -301,7 +301,7 @@ spkac_main(int argc, char **argv) ret = 0; -end: + end: NCONF_free(conf); NETSCAPE_SPKI_free(spki); BIO_free(in); diff --git a/usr.bin/openssl/ts.c b/usr.bin/openssl/ts.c index 28462430a2e..cac10d0d3f8 100644 --- a/usr.bin/openssl/ts.c +++ b/usr.bin/openssl/ts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: ts.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -301,7 +301,7 @@ ts_main(int argc, char **argv) goto cleanup; -usage: + usage: BIO_printf(bio_err, "usage:\n" "ts -query [-config configfile] " "[-data file_to_hash] [-digest digest_bytes]" @@ -322,7 +322,7 @@ usage: "-CApath ca_path -CAfile ca_file.pem " "-untrusted cert_file.pem\n"); -cleanup: + cleanup: /* Clean up. */ NCONF_free(conf); free(password); @@ -435,7 +435,7 @@ query_command(const char *data, char *digest, const EVP_MD * md, ret = 1; -end: + end: ERR_print_errors(bio_err); /* Clean up. */ @@ -521,7 +521,7 @@ create_query(BIO * data_bio, char *digest, const EVP_MD * md, ret = 1; -err: + err: if (!ret) { TS_REQ_free(ts_req); ts_req = NULL; @@ -574,7 +574,7 @@ create_digest(BIO * input, char *digest, const EVP_MD * md, } return md_value_len; -err: + err: return 0; } @@ -605,7 +605,7 @@ create_nonce(int bits) return nonce; -err: + err: BIO_printf(bio_err, "could not create nonce\n"); ASN1_INTEGER_free(nonce); return NULL; @@ -680,7 +680,7 @@ reply_command(CONF * conf, char *section, char *queryfile, ret = 1; -end: + end: ERR_print_errors(bio_err); /* Clean up. */ @@ -728,7 +728,7 @@ read_PKCS7(BIO * in_bio) tst_info = NULL; /* Ownership is lost. */ ret = 1; -end: + end: PKCS7_free(token); TS_TST_INFO_free(tst_info); if (!ret) { @@ -813,7 +813,7 @@ create_response(CONF * conf, const char *section, goto end; ret = 1; -end: + end: if (!ret) { TS_RESP_free(response); response = NULL; @@ -876,7 +876,7 @@ next_serial(const char *serialfile) goto err; } ret = 1; -err: + err: if (!ret) { ASN1_INTEGER_free(serial); serial = NULL; @@ -899,7 +899,7 @@ save_ts_serial(const char *serialfile, ASN1_INTEGER * serial) if (BIO_puts(out, "\n") <= 0) goto err; ret = 1; -err: + err: if (!ret) BIO_printf(bio_err, "could not save serial number to %s\n", serialfile); @@ -941,7 +941,7 @@ verify_command(char *data, char *digest, char *queryfile, char *in, TS_RESP_verify_token(verify_ctx, token) : TS_RESP_verify_response(verify_ctx, response); -end: + end: printf("Verification: "); if (ret) printf("OK\n"); @@ -1012,7 +1012,7 @@ create_verify_ctx(char *data, char *digest, char *queryfile, char *ca_path, goto err; ret = 1; -err: + err: if (!ret) { TS_VERIFY_CTX_free(ctx); ctx = NULL; @@ -1064,7 +1064,7 @@ create_cert_store(char *ca_path, char *ca_file) } } return cert_ctx; -err: + err: X509_STORE_free(cert_ctx); return NULL; } diff --git a/usr.bin/openssl/verify.c b/usr.bin/openssl/verify.c index d9b5ef97954..f616e3c440d 100644 --- a/usr.bin/openssl/verify.c +++ b/usr.bin/openssl/verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verify.c,v 1.6 2015/10/17 15:00:11 doug Exp $ */ +/* $OpenBSD: verify.c,v 1.7 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -201,7 +201,7 @@ verify_main(int argc, char **argv) ret = -1; } -end: + end: if (ret == 1) { BIO_printf(bio_err, "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); BIO_printf(bio_err, " [-attime timestamp]"); @@ -259,7 +259,7 @@ check(X509_STORE * ctx, char *file, STACK_OF(X509) * uchain, ret = 0; -end: + end: if (i > 0) { fprintf(stdout, "OK\n"); ret = 1; diff --git a/usr.bin/openssl/x509.c b/usr.bin/openssl/x509.c index 8d3dc07090e..84aeed3c074 100644 --- a/usr.bin/openssl/x509.c +++ b/usr.bin/openssl/x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.c,v 1.15 2018/02/07 04:57:06 jsing Exp $ */ +/* $OpenBSD: x509.c,v 1.16 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -429,7 +429,7 @@ x509_main(int argc, char **argv) } if (badops) { -bad: + bad: for (pp = x509_usage; (*pp != NULL); pp++) BIO_printf(bio_err, "%s", *pp); goto end; @@ -905,7 +905,7 @@ bad: } ret = 0; -end: + end: OBJ_cleanup(); NCONF_free(extconf); BIO_free_all(out); @@ -963,7 +963,7 @@ x509_load_serial(char *CAfile, char *serialfile, int create) if (!save_serial(buf, NULL, serial, &bs)) goto end; -end: + end: free(buf); BN_free(serial); @@ -1036,7 +1036,7 @@ x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, X509 *x, if (!do_X509_sign(bio_err, x, pkey, digest, sigopts)) goto end; ret = 1; -end: + end: X509_STORE_CTX_cleanup(&xsc); if (!ret) ERR_print_errors(bio_err); @@ -1122,7 +1122,7 @@ sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest, goto err; return 1; -err: + err: ERR_print_errors(bio_err); return 0; } -- 2.20.1