-/* $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 <jsing@openbsd.org>
*
}
ret = PKCS12_parse(p12, pass, pkey, cert, ca);
-die:
+ die:
PKCS12_free(p12);
return ret;
}
goto end;
}
-end:
+ end:
if (x == NULL) {
BIO_printf(err, "unable to load certificate\n");
ERR_print_errors(err);
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);
goto end;
}
-end:
+ end:
BIO_free(key);
if (pkey == NULL)
BIO_printf(err, "unable to load %s\n", key_descrip);
EVP_PKEY_set1_RSA(pkey, rsa);
return pkey;
-error:
+ error:
BUF_MEM_free(buf);
EVP_PKEY_free(pkey);
return NULL;
if (pcrls && sk_X509_CRL_num(*pcrls) > 0)
rv = 1;
-end:
+ end:
sk_X509_INFO_pop_free(xis, X509_INFO_free);
if (rv == 0) {
ret = 1;
-end:
+ end:
sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
return ret;
ERR_clear_error();
return store;
-end:
+ end:
X509_STORE_free(store);
return NULL;
}
ai = NULL;
}
-err:
+ err:
BIO_free(in);
ASN1_INTEGER_free(ai);
return (ret);
ai = NULL;
}
-err:
+ err:
BIO_free_all(out);
ASN1_INTEGER_free(ai);
return (ret);
}
return 1;
-err:
+ err:
return 0;
}
ret = 1;
-error:
+ error:
BN_free(btmp);
return ret;
}
}
-err:
+ err:
NCONF_free(dbattr_conf);
TXT_DB_free(tmpdb);
BIO_free_all(in);
return 1;
-err:
+ err:
return 0;
}
}
return 1;
-err:
+ err:
return 0;
}
}
goto done;
-error:
+ error:
X509_NAME_free(name);
name = NULL;
-done:
+ done:
free(ne_values);
free(ne_types);
free(mval);
if (at_time)
X509_VERIFY_PARAM_set_time(*pm, at_time);
-end:
+ end:
(*pargs)++;
if (pargc)
}
}
-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);
}
-/* $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.
*
goto end;
}
ret = 0;
-end:
+ end:
BIO_free(derout);
BIO_free(in);
BIO_free_all(out);
ASN1_TYPE_free(atyp);
return len;
-conferr:
+ conferr:
if (errline > 0)
BIO_printf(bio, "Error on line %ld of config file '%s'\n",
else
BIO_printf(bio, "Error loading config file '%s'\n", genconf);
-err:
+ err:
NCONF_free(cnf);
ASN1_TYPE_free(atyp);
-/* $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.
*
rev_type = REV_CA_COMPROMISE;
}
else {
-bad:
+ bad:
if (errstr)
BIO_printf(bio_err, "invalid argument %s: %s\n",
*argv, errstr);
/*****************************************************************/
ret = 0;
-err:
+ err:
free(tofree);
BIO_free_all(Cout);
verbose, req, ext_sect, lconf, certopt, nameopt, default_op,
ext_copy, selfsign);
-err:
+ err:
if (req != NULL)
X509_REQ_free(req);
if (in != NULL)
verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op,
ext_copy, 0);
-err:
+ err:
if (rreq != NULL)
X509_REQ_free(rreq);
if (req != NULL)
goto err;
}
ok = 1;
-err:
+ err:
for (i = 0; i < DB_NUMBER; i++)
free(row[i]);
verbose, req, ext_sect, lconf, certopt, nameopt, default_op,
ext_copy, 0);
-err:
+ err:
if (req != NULL)
X509_REQ_free(req);
if (parms != NULL)
}
ok = 1;
-err:
+ err:
for (i = 0; i < DB_NUMBER; i++)
free(row[i]);
ok = -1;
}
-err:
+ err:
for (i = 0; i < DB_NUMBER; i++)
free(row[i]);
}
}
-err:
+ err:
ASN1_UTCTIME_free(a_tm);
free(a_tm_s);
else
ret = 1;
-err:
+ err:
free(tmp);
ASN1_OBJECT_free(hold);
ret = 1;
-err:
+ err:
free(tmp);
if (!phold)
goto done;
-err:
+ err:
hashinfo_free(hi);
hi = NULL;
-done:
+ done:
free(l);
return (hi);
hi = hashinfo(filename, hash, fingerprint);
-err:
+ err:
X509_free(cert);
return (hi);
hi = hashinfo(filename, hash, fingerprint);
-err:
+ err:
X509_CRL_free(crl);
return (hi);
return (0);
-err:
+ err:
hashinfo_free(link);
return (-1);
}
ret = 0;
-err:
+ err:
BIO_free(bio);
return (ret);
goto done;
-err:
+ err:
ret = 1;
-done:
+ done:
hashinfo_chain_free(certs);
hashinfo_chain_free(crls);
hashinfo_chain_free(links);
-/* $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 <jsing@openbsd.org>
*
goto done;
-err:
+ err:
ERR_print_errors_fp(stderr);
rv = 1;
-done:
+ done:
SSL_CTX_free(ssl_ctx);
SSL_free(ssl);
-/* $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.
*
}
ret = 0;
-end:
+ end:
BIO_free_all(out);
BIO_free_all(bio_out);
bio_out = NULL;
goto end;
}
-end:
+ end:
BIO_free(in);
return (x);
}
-/* $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.
*
}
ret = 0;
-end:
+ end:
if (in != NULL)
BIO_free(in);
if (out != NULL)
ret = count;
-end:
+ end:
/* never need to free x */
if (in != NULL)
BIO_free(in);
-/* $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.
*
}
}
-end:
+ end:
freezero(buf, BUFSIZE);
if (in != NULL)
BIO_free(in);
-/* $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.
*
}
ret = 0;
-end:
+ end:
BIO_free(in);
BIO_free_all(out);
DH_free(dh);
-/* $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.
*
}
ret = 0;
-end:
+ end:
BIO_free(in);
BIO_free_all(out);
DH_free(dh);
-/* $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.
*
ERR_print_errors(bio_err);
} else
ret = 0;
-end:
+ end:
BIO_free(in);
BIO_free_all(out);
DSA_free(dsa);
-/* $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.
*
}
ret = 0;
-end:
+ end:
BIO_free(in);
BIO_free_all(out);
DSA_free(dsa);
-/* $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.
*/
ERR_print_errors(bio_err);
} else
ret = 0;
-end:
+ end:
BIO_free(in);
BIO_free_all(out);
EC_KEY_free(eckey);
-/* $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.
*/
}
ret = 0;
-end:
+ end:
BN_free(ec_p);
BN_free(ec_a);
BN_free(ec_b);
-/* $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.
*
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);
-/* $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.
*
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);
-/* $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.
*
}
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
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);
-/* $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
*/
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");
}
ret = 0;
-end:
+ end:
EVP_PKEY_free(pkey);
EVP_PKEY_CTX_free(ctx);
BIO_free_all(out);
*pctx = ctx;
return 1;
-err:
+ err:
BIO_puts(err, "Error initializing context\n");
ERR_print_errors(err);
EVP_PKEY_CTX_free(ctx);
*pctx = ctx;
return 1;
-err:
+ err:
BIO_printf(err, "Error initializing %s context\n", algname);
ERR_print_errors(err);
EVP_PKEY_CTX_free(ctx);
-/* $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.
*
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");
}
ret = 0;
-err:
+ err:
BN_free(bn);
RSA_free(rsa);
BIO_free_all(out);
-/* $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.
*/
PEM_write_bio_X509(out, x509);
}
ret = 0;
-end:
+ end:
BIO_free(in);
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
-/* $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.
*/
ret = 0;
-end:
+ end:
ERR_print_errors(bio_err);
X509_free(signer);
X509_STORE_free(store);
goto err;
return 1;
-err:
+ err:
BIO_printf(bio_err, "Error Creating OCSP request\n");
return 0;
}
goto err;
return 1;
-err:
+ err:
BIO_printf(bio_err, "Error Creating OCSP request\n");
return 0;
}
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs);
-end:
+ end:
ASN1_TIME_free(thisupd);
ASN1_TIME_free(nextupd);
OCSP_CERTID_free(ca_id);
}
return acbio;
-err:
+ err:
BIO_free_all(acbio);
BIO_free(bufbio);
return NULL;
break;
}
}
-err:
+ err:
if (ctx)
OCSP_REQ_CTX_free(ctx);
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)
-/* $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.
*
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",
BIO_printf(bio_err, "bad exit\n");
ret = 1;
-end:
+ end:
free(to_free);
if (config != NULL) {
BIO_printf(bio_err, "\n\n");
ret = 0;
}
-end:
+ end:
return (ret);
}
-/* $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
}
ret = 0;
-err:
+ err:
ERR_print_errors(bio_err);
free(salt_malloc);
BIO_printf(out, "%s\n", hash);
return 1;
-err:
+ err:
return 0;
}
#else
-/* $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.
*/
goto end;
}
ret = 0;
-end:
+ end:
if (p12)
PKCS12_free(p12);
BIO_free(in);
}
ret = 1;
-err:
+ err:
if (asafes)
sk_PKCS7_pop_free(asafes, PKCS7_free);
goto err;
} else
chn = X509_STORE_CTX_get1_chain(&store_ctx);
-err:
+ err:
X509_STORE_CTX_cleanup(&store_ctx);
*chain = chn;
-/* $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.
*
}
}
ret = 0;
-end:
+ end:
if (p7 != NULL)
PKCS7_free(p7);
if (in != NULL)
-/* $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.
*/
}
ret = 0;
-end:
+ end:
X509_SIG_free(p8);
PKCS8_PRIV_KEY_INFO_free(p8inf);
EVP_PKEY_free(pkey);
-/* $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
*/
}
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");
}
ret = 0;
-end:
+ end:
EVP_PKEY_free(pkey);
BIO_free_all(out);
BIO_free(in);
-/* $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
*/
ret = 0;
-end:
+ end:
EVP_PKEY_free(pkey);
BIO_free_all(out);
BIO_free(in);
-/* $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.
*/
else
BIO_write(out, buf_out, buf_outlen);
-end:
+ end:
EVP_PKEY_CTX_free(ctx);
BIO_free(in);
BIO_free_all(out);
EVP_PKEY_CTX_free(ctx);
ctx = NULL;
}
-end:
+ end:
free(passin);
-/* $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.
*
ret = 0;
-end:
+ end:
BN_free(bn);
BIO_free_all(bio_out);
-/* $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.
*
ret = 0;
-err:
+ err:
ERR_print_errors(bio_err);
BIO_free_all(out);
-/* $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.
*
}
if (badops) {
-bad:
+ bad:
BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog);
BIO_printf(bio_err, "where options are\n");
BIO_printf(bio_err, " -inform arg input format - DER or PEM\n");
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()) ==
}
}
ex = 0;
-end:
+ end:
if (ex) {
ERR_print_errors(bio_err);
}
goto err;
ret = 1;
-err:
+ err:
return (ret);
}
}
if (sk_CONF_VALUE_num(dn_sk)) {
i = -1;
-start: for (;;) {
+ start: for (;;) {
int ret;
i++;
if (sk_CONF_VALUE_num(dn_sk) <= i)
{
int i, ret = 0;
char buf[1024];
-start:
+ start:
if (!batch)
BIO_printf(bio_err, "%s [%s]:", text, def);
(void) BIO_flush(bio_err);
(unsigned char *) buf, -1, -1, mval))
goto err;
ret = 1;
-err:
+ err:
return (ret);
}
int i;
static char buf[1024];
-start:
+ start:
if (!batch)
BIO_printf(bio_err, "%s [%s]:", text, def);
(void) BIO_flush(bio_err);
goto err;
}
return (1);
-err:
+ err:
return (0);
}
-/* $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.
*
} else
ret = 0;
-end:
+ end:
BIO_free_all(out);
RSA_free(rsa);
free(passin);
-/* $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.
*/
else
BIO_write(out, rsa_out, rsa_outlen);
-end:
+ end:
RSA_free(rsa);
BIO_free(in);
BIO_free_all(out);
-/* $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.
*
goto bad;
}
if (badop) {
-bad:
+ bad:
if (errstr)
BIO_printf(bio_err, "invalid argument %s: %s\n",
*argv, errstr);
}
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);
-/* $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.
*
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) {
if (resp)
OCSP_RESPONSE_free(resp);
return ret;
-err:
+ err:
ret = SSL_TLSEXT_ERR_ALERT_FATAL;
goto done;
}
argv++;
}
if (badop) {
-bad:
+ bad:
if (errstr)
BIO_printf(bio_err, "invalid argument %s: %s\n",
*argv, errstr);
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);
}
}
}
-err:
+ err:
if (con != NULL) {
BIO_printf(bio_s_out, "shutting down SSL\n");
SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
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);
}
} 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");
-/* $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.
*
}
perror("connect");
-out:
+ out:
if (s != -1)
close(s);
freeaddrinfo(ai_top);
goto err;
*sock = s;
ret = 1;
-err:
+ err:
if ((ret == 0) && (s != -1)) {
shutdown(s, SHUT_RD);
close(s);
socklen_t len;
/* struct linger ling; */
-redoit:
+ redoit:
memset((char *) &from, 0, sizeof(from));
len = sizeof(from);
}
}
-end:
+ end:
*sock = ret;
return (1);
}
-/* $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.
*
* over
*/
-next:
+ next:
if (!(s_time_config.perform & 2))
goto end;
printf("\n\nNow timing with session id reuse.\n");
bytes_read / nConn);
ret = 0;
-end:
+ end:
SSL_free(scon);
if (tm_ctx != NULL) {
-/* $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.
*
}
ret = 0;
-end:
+ end:
BIO_free_all(out);
SSL_SESSION_free(x);
ERR_print_errors(bio_err);
goto end;
}
-end:
+ end:
BIO_free(in);
return (x);
}
-/* $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.
*/
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");
}
}
ret = 0;
-end:
+ end:
if (ret)
ERR_print_errors(bio_err);
sk_X509_pop_free(encerts, X509_free);
-/* $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.
*
mret = 0;
-end:
+ end:
ERR_print_errors(bio_err);
free(buf);
free(buf2);
-/* $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).
ret = 0;
-end:
+ end:
NCONF_free(conf);
NETSCAPE_SPKI_free(spki);
BIO_free(in);
-/* $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.
*/
goto cleanup;
-usage:
+ usage:
BIO_printf(bio_err, "usage:\n"
"ts -query [-config configfile] "
"[-data file_to_hash] [-digest digest_bytes]"
"-CApath ca_path -CAfile ca_file.pem "
"-untrusted cert_file.pem\n");
-cleanup:
+ cleanup:
/* Clean up. */
NCONF_free(conf);
free(password);
ret = 1;
-end:
+ end:
ERR_print_errors(bio_err);
/* Clean up. */
ret = 1;
-err:
+ err:
if (!ret) {
TS_REQ_free(ts_req);
ts_req = NULL;
}
return md_value_len;
-err:
+ err:
return 0;
}
return nonce;
-err:
+ err:
BIO_printf(bio_err, "could not create nonce\n");
ASN1_INTEGER_free(nonce);
return NULL;
ret = 1;
-end:
+ end:
ERR_print_errors(bio_err);
/* Clean up. */
tst_info = NULL; /* Ownership is lost. */
ret = 1;
-end:
+ end:
PKCS7_free(token);
TS_TST_INFO_free(tst_info);
if (!ret) {
goto end;
ret = 1;
-end:
+ end:
if (!ret) {
TS_RESP_free(response);
response = NULL;
goto err;
}
ret = 1;
-err:
+ err:
if (!ret) {
ASN1_INTEGER_free(serial);
serial = NULL;
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);
TS_RESP_verify_token(verify_ctx, token) :
TS_RESP_verify_response(verify_ctx, response);
-end:
+ end:
printf("Verification: ");
if (ret)
printf("OK\n");
goto err;
ret = 1;
-err:
+ err:
if (!ret) {
TS_VERIFY_CTX_free(ctx);
ctx = NULL;
}
}
return cert_ctx;
-err:
+ err:
X509_STORE_free(cert_ctx);
return NULL;
}
-/* $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.
*
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]");
ret = 0;
-end:
+ end:
if (i > 0) {
fprintf(stdout, "OK\n");
ret = 1;
-/* $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.
*
}
if (badops) {
-bad:
+ bad:
for (pp = x509_usage; (*pp != NULL); pp++)
BIO_printf(bio_err, "%s", *pp);
goto end;
}
ret = 0;
-end:
+ end:
OBJ_cleanup();
NCONF_free(extconf);
BIO_free_all(out);
if (!save_serial(buf, NULL, serial, &bs))
goto end;
-end:
+ end:
free(buf);
BN_free(serial);
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);
goto err;
return 1;
-err:
+ err:
ERR_print_errors(bio_err);
return 0;
}