diff options
author | jsing <> | 2018-02-07 05:47:55 +0000 |
---|---|---|
committer | jsing <> | 2018-02-07 05:47:55 +0000 |
commit | 8b26a12dbe124fea0169712974ac2d8468e92dd9 (patch) | |
tree | 4fc27d43e8a00c73b96eeca6961a12b7a625e0c8 | |
parent | 8af3d9d9a31769e939636e3beaf236d858d41d19 (diff) | |
download | openbsd-8b26a12dbe124fea0169712974ac2d8468e92dd9.tar.gz openbsd-8b26a12dbe124fea0169712974ac2d8468e92dd9.tar.bz2 openbsd-8b26a12dbe124fea0169712974ac2d8468e92dd9.zip |
Indent labels with a single space so that diff prototypes are more useful.
45 files changed, 190 insertions, 190 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index 2dab036b32..22b6b2838b 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: apps.c,v 1.45 2018/02/07 04:25:19 jsing Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.46 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -583,7 +583,7 @@ load_pkcs12(BIO *err, BIO *in, const char *desc, pem_password_cb *pem_cb, | |||
583 | } | 583 | } |
584 | ret = PKCS12_parse(p12, pass, pkey, cert, ca); | 584 | ret = PKCS12_parse(p12, pass, pkey, cert, ca); |
585 | 585 | ||
586 | die: | 586 | die: |
587 | PKCS12_free(p12); | 587 | PKCS12_free(p12); |
588 | return ret; | 588 | return ret; |
589 | } | 589 | } |
@@ -642,7 +642,7 @@ load_cert(BIO *err, const char *file, int format, const char *pass, | |||
642 | goto end; | 642 | goto end; |
643 | } | 643 | } |
644 | 644 | ||
645 | end: | 645 | end: |
646 | if (x == NULL) { | 646 | if (x == NULL) { |
647 | BIO_printf(err, "unable to load certificate\n"); | 647 | BIO_printf(err, "unable to load certificate\n"); |
648 | ERR_print_errors(err); | 648 | ERR_print_errors(err); |
@@ -705,7 +705,7 @@ load_key(BIO *err, const char *file, int format, int maybe_stdin, | |||
705 | BIO_printf(err, "bad input format specified for key file\n"); | 705 | BIO_printf(err, "bad input format specified for key file\n"); |
706 | goto end; | 706 | goto end; |
707 | } | 707 | } |
708 | end: | 708 | end: |
709 | BIO_free(key); | 709 | BIO_free(key); |
710 | if (pkey == NULL) { | 710 | if (pkey == NULL) { |
711 | BIO_printf(err, "unable to load %s\n", key_descrip); | 711 | 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, | |||
782 | goto end; | 782 | goto end; |
783 | } | 783 | } |
784 | 784 | ||
785 | end: | 785 | end: |
786 | BIO_free(key); | 786 | BIO_free(key); |
787 | if (pkey == NULL) | 787 | if (pkey == NULL) |
788 | BIO_printf(err, "unable to load %s\n", key_descrip); | 788 | BIO_printf(err, "unable to load %s\n", key_descrip); |
@@ -827,7 +827,7 @@ load_netscape_key(BIO *err, BIO *key, const char *file, | |||
827 | EVP_PKEY_set1_RSA(pkey, rsa); | 827 | EVP_PKEY_set1_RSA(pkey, rsa); |
828 | return pkey; | 828 | return pkey; |
829 | 829 | ||
830 | error: | 830 | error: |
831 | BUF_MEM_free(buf); | 831 | BUF_MEM_free(buf); |
832 | EVP_PKEY_free(pkey); | 832 | EVP_PKEY_free(pkey); |
833 | return NULL; | 833 | return NULL; |
@@ -898,7 +898,7 @@ load_certs_crls(BIO *err, const char *file, int format, const char *pass, | |||
898 | if (pcrls && sk_X509_CRL_num(*pcrls) > 0) | 898 | if (pcrls && sk_X509_CRL_num(*pcrls) > 0) |
899 | rv = 1; | 899 | rv = 1; |
900 | 900 | ||
901 | end: | 901 | end: |
902 | sk_X509_INFO_pop_free(xis, X509_INFO_free); | 902 | sk_X509_INFO_pop_free(xis, X509_INFO_free); |
903 | 903 | ||
904 | if (rv == 0) { | 904 | if (rv == 0) { |
@@ -1064,7 +1064,7 @@ copy_extensions(X509 *x, X509_REQ *req, int copy_type) | |||
1064 | 1064 | ||
1065 | ret = 1; | 1065 | ret = 1; |
1066 | 1066 | ||
1067 | end: | 1067 | end: |
1068 | sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); | 1068 | sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); |
1069 | 1069 | ||
1070 | return ret; | 1070 | return ret; |
@@ -1179,7 +1179,7 @@ setup_verify(BIO *bp, char *CAfile, char *CApath) | |||
1179 | ERR_clear_error(); | 1179 | ERR_clear_error(); |
1180 | return store; | 1180 | return store; |
1181 | 1181 | ||
1182 | end: | 1182 | end: |
1183 | X509_STORE_free(store); | 1183 | X509_STORE_free(store); |
1184 | return NULL; | 1184 | return NULL; |
1185 | } | 1185 | } |
@@ -1308,7 +1308,7 @@ load_serial(char *serialfile, int create, ASN1_INTEGER **retai) | |||
1308 | ai = NULL; | 1308 | ai = NULL; |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | err: | 1311 | err: |
1312 | BIO_free(in); | 1312 | BIO_free(in); |
1313 | ASN1_INTEGER_free(ai); | 1313 | ASN1_INTEGER_free(ai); |
1314 | return (ret); | 1314 | return (ret); |
@@ -1354,7 +1354,7 @@ save_serial(char *serialfile, char *suffix, BIGNUM *serial, | |||
1354 | ai = NULL; | 1354 | ai = NULL; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | err: | 1357 | err: |
1358 | BIO_free_all(out); | 1358 | BIO_free_all(out); |
1359 | ASN1_INTEGER_free(ai); | 1359 | ASN1_INTEGER_free(ai); |
1360 | return (ret); | 1360 | return (ret); |
@@ -1399,7 +1399,7 @@ rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) | |||
1399 | } | 1399 | } |
1400 | return 1; | 1400 | return 1; |
1401 | 1401 | ||
1402 | err: | 1402 | err: |
1403 | return 0; | 1403 | return 0; |
1404 | } | 1404 | } |
1405 | 1405 | ||
@@ -1424,7 +1424,7 @@ rand_serial(BIGNUM *b, ASN1_INTEGER *ai) | |||
1424 | 1424 | ||
1425 | ret = 1; | 1425 | ret = 1; |
1426 | 1426 | ||
1427 | error: | 1427 | error: |
1428 | BN_free(btmp); | 1428 | BN_free(btmp); |
1429 | 1429 | ||
1430 | return ret; | 1430 | return ret; |
@@ -1489,7 +1489,7 @@ load_index(char *dbfile, DB_ATTR *db_attr) | |||
1489 | } | 1489 | } |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | err: | 1492 | err: |
1493 | NCONF_free(dbattr_conf); | 1493 | NCONF_free(dbattr_conf); |
1494 | TXT_DB_free(tmpdb); | 1494 | TXT_DB_free(tmpdb); |
1495 | BIO_free_all(in); | 1495 | BIO_free_all(in); |
@@ -1562,7 +1562,7 @@ save_index(const char *file, const char *suffix, CA_DB *db) | |||
1562 | 1562 | ||
1563 | return 1; | 1563 | return 1; |
1564 | 1564 | ||
1565 | err: | 1565 | err: |
1566 | return 0; | 1566 | return 0; |
1567 | } | 1567 | } |
1568 | 1568 | ||
@@ -1657,7 +1657,7 @@ rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) | |||
1657 | } | 1657 | } |
1658 | return 1; | 1658 | return 1; |
1659 | 1659 | ||
1660 | err: | 1660 | err: |
1661 | return 0; | 1661 | return 0; |
1662 | } | 1662 | } |
1663 | 1663 | ||
@@ -1820,11 +1820,11 @@ parse_name(char *subject, long chtype, int multirdn) | |||
1820 | } | 1820 | } |
1821 | goto done; | 1821 | goto done; |
1822 | 1822 | ||
1823 | error: | 1823 | error: |
1824 | X509_NAME_free(name); | 1824 | X509_NAME_free(name); |
1825 | name = NULL; | 1825 | name = NULL; |
1826 | 1826 | ||
1827 | done: | 1827 | done: |
1828 | free(ne_values); | 1828 | free(ne_values); |
1829 | free(ne_types); | 1829 | free(ne_types); |
1830 | free(mval); | 1830 | free(mval); |
@@ -1958,7 +1958,7 @@ args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, | |||
1958 | if (at_time) | 1958 | if (at_time) |
1959 | X509_VERIFY_PARAM_set_time(*pm, at_time); | 1959 | X509_VERIFY_PARAM_set_time(*pm, at_time); |
1960 | 1960 | ||
1961 | end: | 1961 | end: |
1962 | (*pargs)++; | 1962 | (*pargs)++; |
1963 | 1963 | ||
1964 | if (pargc) | 1964 | if (pargc) |
@@ -2304,17 +2304,17 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed, | |||
2304 | } | 2304 | } |
2305 | } | 2305 | } |
2306 | 2306 | ||
2307 | done: | 2307 | done: |
2308 | if (argsused != NULL) | 2308 | if (argsused != NULL) |
2309 | *argsused = i; | 2309 | *argsused = i; |
2310 | 2310 | ||
2311 | return (0); | 2311 | return (0); |
2312 | 2312 | ||
2313 | toomany: | 2313 | toomany: |
2314 | fprintf(stderr, "too many arguments\n"); | 2314 | fprintf(stderr, "too many arguments\n"); |
2315 | return (1); | 2315 | return (1); |
2316 | 2316 | ||
2317 | unknown: | 2317 | unknown: |
2318 | fprintf(stderr, "unknown option '%s'\n", arg); | 2318 | fprintf(stderr, "unknown option '%s'\n", arg); |
2319 | return (1); | 2319 | return (1); |
2320 | } | 2320 | } |
diff --git a/src/usr.bin/openssl/asn1pars.c b/src/usr.bin/openssl/asn1pars.c index 0f432c246b..a17584e8a3 100644 --- a/src/usr.bin/openssl/asn1pars.c +++ b/src/usr.bin/openssl/asn1pars.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1pars.c,v 1.8 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: asn1pars.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -408,7 +408,7 @@ asn1parse_main(int argc, char **argv) | |||
408 | goto end; | 408 | goto end; |
409 | } | 409 | } |
410 | ret = 0; | 410 | ret = 0; |
411 | end: | 411 | end: |
412 | BIO_free(derout); | 412 | BIO_free(derout); |
413 | BIO_free(in); | 413 | BIO_free(in); |
414 | BIO_free_all(out); | 414 | BIO_free_all(out); |
@@ -464,7 +464,7 @@ do_generate(BIO * bio, char *genstr, char *genconf, BUF_MEM * buf) | |||
464 | ASN1_TYPE_free(atyp); | 464 | ASN1_TYPE_free(atyp); |
465 | return len; | 465 | return len; |
466 | 466 | ||
467 | conferr: | 467 | conferr: |
468 | 468 | ||
469 | if (errline > 0) | 469 | if (errline > 0) |
470 | BIO_printf(bio, "Error on line %ld of config file '%s'\n", | 470 | BIO_printf(bio, "Error on line %ld of config file '%s'\n", |
@@ -472,7 +472,7 @@ conferr: | |||
472 | else | 472 | else |
473 | BIO_printf(bio, "Error loading config file '%s'\n", genconf); | 473 | BIO_printf(bio, "Error loading config file '%s'\n", genconf); |
474 | 474 | ||
475 | err: | 475 | err: |
476 | NCONF_free(cnf); | 476 | NCONF_free(cnf); |
477 | ASN1_TYPE_free(atyp); | 477 | ASN1_TYPE_free(atyp); |
478 | 478 | ||
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c index 5414a921d4..2e79849572 100644 --- a/src/usr.bin/openssl/ca.c +++ b/src/usr.bin/openssl/ca.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ca.c,v 1.25 2017/05/08 21:12:36 beck Exp $ */ | 1 | /* $OpenBSD: ca.c,v 1.26 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -497,7 +497,7 @@ ca_main(int argc, char **argv) | |||
497 | rev_type = REV_CA_COMPROMISE; | 497 | rev_type = REV_CA_COMPROMISE; |
498 | } | 498 | } |
499 | else { | 499 | else { |
500 | bad: | 500 | bad: |
501 | if (errstr) | 501 | if (errstr) |
502 | BIO_printf(bio_err, "invalid argument %s: %s\n", | 502 | BIO_printf(bio_err, "invalid argument %s: %s\n", |
503 | *argv, errstr); | 503 | *argv, errstr); |
@@ -1310,7 +1310,7 @@ bad: | |||
1310 | /*****************************************************************/ | 1310 | /*****************************************************************/ |
1311 | ret = 0; | 1311 | ret = 0; |
1312 | 1312 | ||
1313 | err: | 1313 | err: |
1314 | free(tofree); | 1314 | free(tofree); |
1315 | 1315 | ||
1316 | BIO_free_all(Cout); | 1316 | BIO_free_all(Cout); |
@@ -1407,7 +1407,7 @@ certify(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, | |||
1407 | verbose, req, ext_sect, lconf, certopt, nameopt, default_op, | 1407 | verbose, req, ext_sect, lconf, certopt, nameopt, default_op, |
1408 | ext_copy, selfsign); | 1408 | ext_copy, selfsign); |
1409 | 1409 | ||
1410 | err: | 1410 | err: |
1411 | if (req != NULL) | 1411 | if (req != NULL) |
1412 | X509_REQ_free(req); | 1412 | X509_REQ_free(req); |
1413 | if (in != NULL) | 1413 | if (in != NULL) |
@@ -1464,7 +1464,7 @@ certify_cert(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, | |||
1464 | verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op, | 1464 | verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op, |
1465 | ext_copy, 0); | 1465 | ext_copy, 0); |
1466 | 1466 | ||
1467 | err: | 1467 | err: |
1468 | if (rreq != NULL) | 1468 | if (rreq != NULL) |
1469 | X509_REQ_free(rreq); | 1469 | X509_REQ_free(rreq); |
1470 | if (req != NULL) | 1470 | if (req != NULL) |
@@ -1969,7 +1969,7 @@ again2: | |||
1969 | goto err; | 1969 | goto err; |
1970 | } | 1970 | } |
1971 | ok = 1; | 1971 | ok = 1; |
1972 | err: | 1972 | err: |
1973 | for (i = 0; i < DB_NUMBER; i++) | 1973 | for (i = 0; i < DB_NUMBER; i++) |
1974 | free(row[i]); | 1974 | free(row[i]); |
1975 | 1975 | ||
@@ -2126,7 +2126,7 @@ certify_spkac(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, | |||
2126 | verbose, req, ext_sect, lconf, certopt, nameopt, default_op, | 2126 | verbose, req, ext_sect, lconf, certopt, nameopt, default_op, |
2127 | ext_copy, 0); | 2127 | ext_copy, 0); |
2128 | 2128 | ||
2129 | err: | 2129 | err: |
2130 | if (req != NULL) | 2130 | if (req != NULL) |
2131 | X509_REQ_free(req); | 2131 | X509_REQ_free(req); |
2132 | if (parms != NULL) | 2132 | if (parms != NULL) |
@@ -2248,7 +2248,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value) | |||
2248 | } | 2248 | } |
2249 | ok = 1; | 2249 | ok = 1; |
2250 | 2250 | ||
2251 | err: | 2251 | err: |
2252 | for (i = 0; i < DB_NUMBER; i++) | 2252 | for (i = 0; i < DB_NUMBER; i++) |
2253 | free(row[i]); | 2253 | free(row[i]); |
2254 | 2254 | ||
@@ -2320,7 +2320,7 @@ get_certificate_status(const char *serial, CA_DB * db) | |||
2320 | ok = -1; | 2320 | ok = -1; |
2321 | } | 2321 | } |
2322 | 2322 | ||
2323 | err: | 2323 | err: |
2324 | for (i = 0; i < DB_NUMBER; i++) | 2324 | for (i = 0; i < DB_NUMBER; i++) |
2325 | free(row[i]); | 2325 | free(row[i]); |
2326 | 2326 | ||
@@ -2383,7 +2383,7 @@ do_updatedb(CA_DB * db) | |||
2383 | } | 2383 | } |
2384 | } | 2384 | } |
2385 | 2385 | ||
2386 | err: | 2386 | err: |
2387 | ASN1_UTCTIME_free(a_tm); | 2387 | ASN1_UTCTIME_free(a_tm); |
2388 | free(a_tm_s); | 2388 | free(a_tm_s); |
2389 | 2389 | ||
@@ -2534,7 +2534,7 @@ make_revoked(X509_REVOKED * rev, const char *str) | |||
2534 | else | 2534 | else |
2535 | ret = 1; | 2535 | ret = 1; |
2536 | 2536 | ||
2537 | err: | 2537 | err: |
2538 | free(tmp); | 2538 | free(tmp); |
2539 | 2539 | ||
2540 | ASN1_OBJECT_free(hold); | 2540 | ASN1_OBJECT_free(hold); |
@@ -2681,7 +2681,7 @@ unpack_revinfo(ASN1_TIME ** prevtm, int *preason, ASN1_OBJECT ** phold, | |||
2681 | 2681 | ||
2682 | ret = 1; | 2682 | ret = 1; |
2683 | 2683 | ||
2684 | err: | 2684 | err: |
2685 | free(tmp); | 2685 | free(tmp); |
2686 | 2686 | ||
2687 | if (!phold) | 2687 | if (!phold) |
diff --git a/src/usr.bin/openssl/certhash.c b/src/usr.bin/openssl/certhash.c index fdd719ea48..5838f0209b 100644 --- a/src/usr.bin/openssl/certhash.c +++ b/src/usr.bin/openssl/certhash.c | |||
@@ -285,11 +285,11 @@ hashinfo_from_linkname(const char *linkname, const char *target) | |||
285 | 285 | ||
286 | goto done; | 286 | goto done; |
287 | 287 | ||
288 | err: | 288 | err: |
289 | hashinfo_free(hi); | 289 | hashinfo_free(hi); |
290 | hi = NULL; | 290 | hi = NULL; |
291 | 291 | ||
292 | done: | 292 | done: |
293 | free(l); | 293 | free(l); |
294 | 294 | ||
295 | return (hi); | 295 | return (hi); |
@@ -318,7 +318,7 @@ certhash_cert(BIO *bio, const char *filename) | |||
318 | 318 | ||
319 | hi = hashinfo(filename, hash, fingerprint); | 319 | hi = hashinfo(filename, hash, fingerprint); |
320 | 320 | ||
321 | err: | 321 | err: |
322 | X509_free(cert); | 322 | X509_free(cert); |
323 | 323 | ||
324 | return (hi); | 324 | return (hi); |
@@ -347,7 +347,7 @@ certhash_crl(BIO *bio, const char *filename) | |||
347 | 347 | ||
348 | hi = hashinfo(filename, hash, fingerprint); | 348 | hi = hashinfo(filename, hash, fingerprint); |
349 | 349 | ||
350 | err: | 350 | err: |
351 | X509_CRL_free(crl); | 351 | X509_CRL_free(crl); |
352 | 352 | ||
353 | return (hi); | 353 | return (hi); |
@@ -371,7 +371,7 @@ certhash_addlink(struct hashinfo **links, struct hashinfo *hi) | |||
371 | 371 | ||
372 | return (0); | 372 | return (0); |
373 | 373 | ||
374 | err: | 374 | err: |
375 | hashinfo_free(link); | 375 | hashinfo_free(link); |
376 | return (-1); | 376 | return (-1); |
377 | } | 377 | } |
@@ -545,7 +545,7 @@ certhash_file(struct dirent *dep, struct hashinfo **certs, | |||
545 | 545 | ||
546 | ret = 0; | 546 | ret = 0; |
547 | 547 | ||
548 | err: | 548 | err: |
549 | BIO_free(bio); | 549 | BIO_free(bio); |
550 | 550 | ||
551 | return (ret); | 551 | return (ret); |
@@ -622,10 +622,10 @@ certhash_directory(const char *path) | |||
622 | 622 | ||
623 | goto done; | 623 | goto done; |
624 | 624 | ||
625 | err: | 625 | err: |
626 | ret = 1; | 626 | ret = 1; |
627 | 627 | ||
628 | done: | 628 | done: |
629 | hashinfo_chain_free(certs); | 629 | hashinfo_chain_free(certs); |
630 | hashinfo_chain_free(crls); | 630 | hashinfo_chain_free(crls); |
631 | hashinfo_chain_free(links); | 631 | hashinfo_chain_free(links); |
diff --git a/src/usr.bin/openssl/ciphers.c b/src/usr.bin/openssl/ciphers.c index 72e12a3aae..2b8ad5ba85 100644 --- a/src/usr.bin/openssl/ciphers.c +++ b/src/usr.bin/openssl/ciphers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ciphers.c,v 1.8 2015/10/17 15:00:11 doug Exp $ */ | 1 | /* $OpenBSD: ciphers.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -140,11 +140,11 @@ ciphers_main(int argc, char **argv) | |||
140 | 140 | ||
141 | goto done; | 141 | goto done; |
142 | 142 | ||
143 | err: | 143 | err: |
144 | ERR_print_errors_fp(stderr); | 144 | ERR_print_errors_fp(stderr); |
145 | rv = 1; | 145 | rv = 1; |
146 | 146 | ||
147 | done: | 147 | done: |
148 | SSL_CTX_free(ssl_ctx); | 148 | SSL_CTX_free(ssl_ctx); |
149 | SSL_free(ssl); | 149 | SSL_free(ssl); |
150 | 150 | ||
diff --git a/src/usr.bin/openssl/crl.c b/src/usr.bin/openssl/crl.c index bb7ff62775..645b16ea54 100644 --- a/src/usr.bin/openssl/crl.c +++ b/src/usr.bin/openssl/crl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crl.c,v 1.10 2017/01/20 08:57:11 deraadt Exp $ */ | 1 | /* $OpenBSD: crl.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -424,7 +424,7 @@ crl_main(int argc, char **argv) | |||
424 | } | 424 | } |
425 | ret = 0; | 425 | ret = 0; |
426 | 426 | ||
427 | end: | 427 | end: |
428 | BIO_free_all(out); | 428 | BIO_free_all(out); |
429 | BIO_free_all(bio_out); | 429 | BIO_free_all(bio_out); |
430 | bio_out = NULL; | 430 | bio_out = NULL; |
@@ -471,7 +471,7 @@ load_crl(char *infile, int format) | |||
471 | goto end; | 471 | goto end; |
472 | } | 472 | } |
473 | 473 | ||
474 | end: | 474 | end: |
475 | BIO_free(in); | 475 | BIO_free(in); |
476 | return (x); | 476 | return (x); |
477 | } | 477 | } |
diff --git a/src/usr.bin/openssl/crl2p7.c b/src/usr.bin/openssl/crl2p7.c index 9fceee8098..a9c48a3da0 100644 --- a/src/usr.bin/openssl/crl2p7.c +++ b/src/usr.bin/openssl/crl2p7.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crl2p7.c,v 1.7 2017/01/20 08:57:11 deraadt Exp $ */ | 1 | /* $OpenBSD: crl2p7.c,v 1.8 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -277,7 +277,7 @@ crl2pkcs7_main(int argc, char **argv) | |||
277 | } | 277 | } |
278 | ret = 0; | 278 | ret = 0; |
279 | 279 | ||
280 | end: | 280 | end: |
281 | if (in != NULL) | 281 | if (in != NULL) |
282 | BIO_free(in); | 282 | BIO_free(in); |
283 | if (out != NULL) | 283 | if (out != NULL) |
@@ -323,7 +323,7 @@ add_certs_from_file(STACK_OF(X509) *stack, char *certfile) | |||
323 | 323 | ||
324 | ret = count; | 324 | ret = count; |
325 | 325 | ||
326 | end: | 326 | end: |
327 | /* never need to free x */ | 327 | /* never need to free x */ |
328 | if (in != NULL) | 328 | if (in != NULL) |
329 | BIO_free(in); | 329 | BIO_free(in); |
diff --git a/src/usr.bin/openssl/dgst.c b/src/usr.bin/openssl/dgst.c index bcc9f1c761..0bd8d66fc8 100644 --- a/src/usr.bin/openssl/dgst.c +++ b/src/usr.bin/openssl/dgst.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dgst.c,v 1.11 2017/04/18 02:15:50 deraadt Exp $ */ | 1 | /* $OpenBSD: dgst.c,v 1.12 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -447,7 +447,7 @@ mac_end: | |||
447 | } | 447 | } |
448 | } | 448 | } |
449 | 449 | ||
450 | end: | 450 | end: |
451 | freezero(buf, BUFSIZE); | 451 | freezero(buf, BUFSIZE); |
452 | if (in != NULL) | 452 | if (in != NULL) |
453 | BIO_free(in); | 453 | BIO_free(in); |
diff --git a/src/usr.bin/openssl/dh.c b/src/usr.bin/openssl/dh.c index b8d4054e56..827ca9c7ea 100644 --- a/src/usr.bin/openssl/dh.c +++ b/src/usr.bin/openssl/dh.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: dh.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -288,7 +288,7 @@ dh_main(int argc, char **argv) | |||
288 | } | 288 | } |
289 | ret = 0; | 289 | ret = 0; |
290 | 290 | ||
291 | end: | 291 | end: |
292 | BIO_free(in); | 292 | BIO_free(in); |
293 | BIO_free_all(out); | 293 | BIO_free_all(out); |
294 | DH_free(dh); | 294 | DH_free(dh); |
diff --git a/src/usr.bin/openssl/dhparam.c b/src/usr.bin/openssl/dhparam.c index 13e8a49a1c..f27a5c9e81 100644 --- a/src/usr.bin/openssl/dhparam.c +++ b/src/usr.bin/openssl/dhparam.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dhparam.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: dhparam.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -466,7 +466,7 @@ dhparam_main(int argc, char **argv) | |||
466 | } | 466 | } |
467 | ret = 0; | 467 | ret = 0; |
468 | 468 | ||
469 | end: | 469 | end: |
470 | BIO_free(in); | 470 | BIO_free(in); |
471 | BIO_free_all(out); | 471 | BIO_free_all(out); |
472 | DH_free(dh); | 472 | DH_free(dh); |
diff --git a/src/usr.bin/openssl/dsa.c b/src/usr.bin/openssl/dsa.c index 34b29eee3e..0b99dedca6 100644 --- a/src/usr.bin/openssl/dsa.c +++ b/src/usr.bin/openssl/dsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: dsa.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -360,7 +360,7 @@ dsa_main(int argc, char **argv) | |||
360 | ERR_print_errors(bio_err); | 360 | ERR_print_errors(bio_err); |
361 | } else | 361 | } else |
362 | ret = 0; | 362 | ret = 0; |
363 | end: | 363 | end: |
364 | BIO_free(in); | 364 | BIO_free(in); |
365 | BIO_free_all(out); | 365 | BIO_free_all(out); |
366 | DSA_free(dsa); | 366 | DSA_free(dsa); |
diff --git a/src/usr.bin/openssl/dsaparam.c b/src/usr.bin/openssl/dsaparam.c index dfafc2e077..8b189cf559 100644 --- a/src/usr.bin/openssl/dsaparam.c +++ b/src/usr.bin/openssl/dsaparam.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsaparam.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: dsaparam.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -338,7 +338,7 @@ dsaparam_main(int argc, char **argv) | |||
338 | } | 338 | } |
339 | ret = 0; | 339 | ret = 0; |
340 | 340 | ||
341 | end: | 341 | end: |
342 | BIO_free(in); | 342 | BIO_free(in); |
343 | BIO_free_all(out); | 343 | BIO_free_all(out); |
344 | DSA_free(dsa); | 344 | DSA_free(dsa); |
diff --git a/src/usr.bin/openssl/ec.c b/src/usr.bin/openssl/ec.c index 7ef2ac8de1..f2dad6dfef 100644 --- a/src/usr.bin/openssl/ec.c +++ b/src/usr.bin/openssl/ec.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: ec.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -392,7 +392,7 @@ ec_main(int argc, char **argv) | |||
392 | ERR_print_errors(bio_err); | 392 | ERR_print_errors(bio_err); |
393 | } else | 393 | } else |
394 | ret = 0; | 394 | ret = 0; |
395 | end: | 395 | end: |
396 | BIO_free(in); | 396 | BIO_free(in); |
397 | BIO_free_all(out); | 397 | BIO_free_all(out); |
398 | EC_KEY_free(eckey); | 398 | EC_KEY_free(eckey); |
diff --git a/src/usr.bin/openssl/ecparam.c b/src/usr.bin/openssl/ecparam.c index 6c497bd355..b1e52fadaf 100644 --- a/src/usr.bin/openssl/ecparam.c +++ b/src/usr.bin/openssl/ecparam.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecparam.c,v 1.16 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: ecparam.c,v 1.17 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -572,7 +572,7 @@ ecparam_main(int argc, char **argv) | |||
572 | } | 572 | } |
573 | ret = 0; | 573 | ret = 0; |
574 | 574 | ||
575 | end: | 575 | end: |
576 | BN_free(ec_p); | 576 | BN_free(ec_p); |
577 | BN_free(ec_a); | 577 | BN_free(ec_a); |
578 | BN_free(ec_b); | 578 | BN_free(ec_b); |
diff --git a/src/usr.bin/openssl/enc.c b/src/usr.bin/openssl/enc.c index 7f06fcc064..3908160170 100644 --- a/src/usr.bin/openssl/enc.c +++ b/src/usr.bin/openssl/enc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: enc.c,v 1.13 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: enc.c,v 1.14 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -717,7 +717,7 @@ enc_main(int argc, char **argv) | |||
717 | BIO_printf(bio_err, "bytes read :%8ld\n", BIO_number_read(in)); | 717 | BIO_printf(bio_err, "bytes read :%8ld\n", BIO_number_read(in)); |
718 | BIO_printf(bio_err, "bytes written:%8ld\n", BIO_number_written(out)); | 718 | BIO_printf(bio_err, "bytes written:%8ld\n", BIO_number_written(out)); |
719 | } | 719 | } |
720 | end: | 720 | end: |
721 | ERR_print_errors(bio_err); | 721 | ERR_print_errors(bio_err); |
722 | free(strbuf); | 722 | free(strbuf); |
723 | free(buff); | 723 | free(buff); |
diff --git a/src/usr.bin/openssl/gendh.c b/src/usr.bin/openssl/gendh.c index 9cbbe42b19..18ff504e44 100644 --- a/src/usr.bin/openssl/gendh.c +++ b/src/usr.bin/openssl/gendh.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gendh.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: gendh.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -186,7 +186,7 @@ gendh_main(int argc, char **argv) | |||
186 | if (!PEM_write_bio_DHparams(out, dh)) | 186 | if (!PEM_write_bio_DHparams(out, dh)) |
187 | goto end; | 187 | goto end; |
188 | ret = 0; | 188 | ret = 0; |
189 | end: | 189 | end: |
190 | if (ret != 0) | 190 | if (ret != 0) |
191 | ERR_print_errors(bio_err); | 191 | ERR_print_errors(bio_err); |
192 | BIO_free_all(out); | 192 | BIO_free_all(out); |
diff --git a/src/usr.bin/openssl/gendsa.c b/src/usr.bin/openssl/gendsa.c index 1e6a6061e1..3197e7be7c 100644 --- a/src/usr.bin/openssl/gendsa.c +++ b/src/usr.bin/openssl/gendsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gendsa.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: gendsa.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -143,7 +143,7 @@ gendsa_main(int argc, char **argv) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | if (dsaparams == NULL) { | 145 | if (dsaparams == NULL) { |
146 | bad: | 146 | bad: |
147 | BIO_printf(bio_err, "usage: gendsa [args] dsaparam-file\n"); | 147 | BIO_printf(bio_err, "usage: gendsa [args] dsaparam-file\n"); |
148 | BIO_printf(bio_err, " -out file - output the key to 'file'\n"); | 148 | BIO_printf(bio_err, " -out file - output the key to 'file'\n"); |
149 | #ifndef OPENSSL_NO_DES | 149 | #ifndef OPENSSL_NO_DES |
@@ -202,7 +202,7 @@ bad: | |||
202 | if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout)) | 202 | if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout)) |
203 | goto end; | 203 | goto end; |
204 | ret = 0; | 204 | ret = 0; |
205 | end: | 205 | end: |
206 | if (ret != 0) | 206 | if (ret != 0) |
207 | ERR_print_errors(bio_err); | 207 | ERR_print_errors(bio_err); |
208 | BIO_free(in); | 208 | BIO_free(in); |
diff --git a/src/usr.bin/openssl/genpkey.c b/src/usr.bin/openssl/genpkey.c index f161c55f7b..9e8e08aef4 100644 --- a/src/usr.bin/openssl/genpkey.c +++ b/src/usr.bin/openssl/genpkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: genpkey.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: genpkey.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006 | 3 | * project 2006 |
4 | */ | 4 | */ |
@@ -161,7 +161,7 @@ genpkey_main(int argc, char **argv) | |||
161 | badarg = 1; | 161 | badarg = 1; |
162 | 162 | ||
163 | if (badarg) { | 163 | if (badarg) { |
164 | bad: | 164 | bad: |
165 | BIO_printf(bio_err, "Usage: genpkey [options]\n"); | 165 | BIO_printf(bio_err, "Usage: genpkey [options]\n"); |
166 | BIO_printf(bio_err, "where options may be\n"); | 166 | BIO_printf(bio_err, "where options may be\n"); |
167 | BIO_printf(bio_err, "-out file output file\n"); | 167 | BIO_printf(bio_err, "-out file output file\n"); |
@@ -237,7 +237,7 @@ bad: | |||
237 | } | 237 | } |
238 | ret = 0; | 238 | ret = 0; |
239 | 239 | ||
240 | end: | 240 | end: |
241 | EVP_PKEY_free(pkey); | 241 | EVP_PKEY_free(pkey); |
242 | EVP_PKEY_CTX_free(ctx); | 242 | EVP_PKEY_CTX_free(ctx); |
243 | BIO_free_all(out); | 243 | BIO_free_all(out); |
@@ -279,7 +279,7 @@ init_keygen_file(BIO * err, EVP_PKEY_CTX ** pctx, | |||
279 | *pctx = ctx; | 279 | *pctx = ctx; |
280 | return 1; | 280 | return 1; |
281 | 281 | ||
282 | err: | 282 | err: |
283 | BIO_puts(err, "Error initializing context\n"); | 283 | BIO_puts(err, "Error initializing context\n"); |
284 | ERR_print_errors(err); | 284 | ERR_print_errors(err); |
285 | EVP_PKEY_CTX_free(ctx); | 285 | EVP_PKEY_CTX_free(ctx); |
@@ -324,7 +324,7 @@ init_gen_str(BIO * err, EVP_PKEY_CTX ** pctx, | |||
324 | *pctx = ctx; | 324 | *pctx = ctx; |
325 | return 1; | 325 | return 1; |
326 | 326 | ||
327 | err: | 327 | err: |
328 | BIO_printf(err, "Error initializing %s context\n", algname); | 328 | BIO_printf(err, "Error initializing %s context\n", algname); |
329 | ERR_print_errors(err); | 329 | ERR_print_errors(err); |
330 | EVP_PKEY_CTX_free(ctx); | 330 | EVP_PKEY_CTX_free(ctx); |
diff --git a/src/usr.bin/openssl/genrsa.c b/src/usr.bin/openssl/genrsa.c index 2780b74a03..fdcd0c1105 100644 --- a/src/usr.bin/openssl/genrsa.c +++ b/src/usr.bin/openssl/genrsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: genrsa.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: genrsa.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -165,7 +165,7 @@ genrsa_main(int argc, char **argv) | |||
165 | argc--; | 165 | argc--; |
166 | } | 166 | } |
167 | if ((argc >= 1) && ((sscanf(*argv, "%d", &num) == 0) || (num < 0))) { | 167 | if ((argc >= 1) && ((sscanf(*argv, "%d", &num) == 0) || (num < 0))) { |
168 | bad: | 168 | bad: |
169 | BIO_printf(bio_err, "usage: genrsa [args] [numbits]\n"); | 169 | BIO_printf(bio_err, "usage: genrsa [args] [numbits]\n"); |
170 | BIO_printf(bio_err, " -des encrypt the generated key with DES in cbc mode\n"); | 170 | BIO_printf(bio_err, " -des encrypt the generated key with DES in cbc mode\n"); |
171 | BIO_printf(bio_err, " -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n"); | 171 | BIO_printf(bio_err, " -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n"); |
@@ -233,7 +233,7 @@ bad: | |||
233 | } | 233 | } |
234 | 234 | ||
235 | ret = 0; | 235 | ret = 0; |
236 | err: | 236 | err: |
237 | BN_free(bn); | 237 | BN_free(bn); |
238 | RSA_free(rsa); | 238 | RSA_free(rsa); |
239 | BIO_free_all(out); | 239 | BIO_free_all(out); |
diff --git a/src/usr.bin/openssl/nseq.c b/src/usr.bin/openssl/nseq.c index 4669147416..d50bace12f 100644 --- a/src/usr.bin/openssl/nseq.c +++ b/src/usr.bin/openssl/nseq.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: nseq.c,v 1.7 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: nseq.c,v 1.8 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -167,7 +167,7 @@ nseq_main(int argc, char **argv) | |||
167 | PEM_write_bio_X509(out, x509); | 167 | PEM_write_bio_X509(out, x509); |
168 | } | 168 | } |
169 | ret = 0; | 169 | ret = 0; |
170 | end: | 170 | end: |
171 | BIO_free(in); | 171 | BIO_free(in); |
172 | BIO_free_all(out); | 172 | BIO_free_all(out); |
173 | NETSCAPE_CERT_SEQUENCE_free(seq); | 173 | NETSCAPE_CERT_SEQUENCE_free(seq); |
diff --git a/src/usr.bin/openssl/ocsp.c b/src/usr.bin/openssl/ocsp.c index ad657b8a66..60a53f0ca5 100644 --- a/src/usr.bin/openssl/ocsp.c +++ b/src/usr.bin/openssl/ocsp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocsp.c,v 1.13 2017/11/29 23:47:18 guenther Exp $ */ | 1 | /* $OpenBSD: ocsp.c,v 1.14 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -732,7 +732,7 @@ done_resp: | |||
732 | 732 | ||
733 | ret = 0; | 733 | ret = 0; |
734 | 734 | ||
735 | end: | 735 | end: |
736 | ERR_print_errors(bio_err); | 736 | ERR_print_errors(bio_err); |
737 | X509_free(signer); | 737 | X509_free(signer); |
738 | X509_STORE_free(store); | 738 | X509_STORE_free(store); |
@@ -783,7 +783,7 @@ add_ocsp_cert(OCSP_REQUEST ** req, X509 * cert, const EVP_MD * cert_id_md, X509 | |||
783 | goto err; | 783 | goto err; |
784 | return 1; | 784 | return 1; |
785 | 785 | ||
786 | err: | 786 | err: |
787 | BIO_printf(bio_err, "Error Creating OCSP request\n"); | 787 | BIO_printf(bio_err, "Error Creating OCSP request\n"); |
788 | return 0; | 788 | return 0; |
789 | } | 789 | } |
@@ -819,7 +819,7 @@ add_ocsp_serial(OCSP_REQUEST ** req, char *serial, const EVP_MD * cert_id_md, X5 | |||
819 | goto err; | 819 | goto err; |
820 | return 1; | 820 | return 1; |
821 | 821 | ||
822 | err: | 822 | err: |
823 | BIO_printf(bio_err, "Error Creating OCSP request\n"); | 823 | BIO_printf(bio_err, "Error Creating OCSP request\n"); |
824 | return 0; | 824 | return 0; |
825 | } | 825 | } |
@@ -977,7 +977,7 @@ make_ocsp_response(OCSP_RESPONSE ** resp, OCSP_REQUEST * req, CA_DB * db, | |||
977 | 977 | ||
978 | *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs); | 978 | *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs); |
979 | 979 | ||
980 | end: | 980 | end: |
981 | ASN1_TIME_free(thisupd); | 981 | ASN1_TIME_free(thisupd); |
982 | ASN1_TIME_free(nextupd); | 982 | ASN1_TIME_free(nextupd); |
983 | OCSP_CERTID_free(ca_id); | 983 | OCSP_CERTID_free(ca_id); |
@@ -1030,7 +1030,7 @@ init_responder(char *port) | |||
1030 | } | 1030 | } |
1031 | return acbio; | 1031 | return acbio; |
1032 | 1032 | ||
1033 | err: | 1033 | err: |
1034 | BIO_free_all(acbio); | 1034 | BIO_free_all(acbio); |
1035 | BIO_free(bufbio); | 1035 | BIO_free(bufbio); |
1036 | return NULL; | 1036 | return NULL; |
@@ -1173,7 +1173,7 @@ query_responder(BIO * err, BIO * cbio, char *path, | |||
1173 | break; | 1173 | break; |
1174 | } | 1174 | } |
1175 | } | 1175 | } |
1176 | err: | 1176 | err: |
1177 | if (ctx) | 1177 | if (ctx) |
1178 | OCSP_REQ_CTX_free(ctx); | 1178 | OCSP_REQ_CTX_free(ctx); |
1179 | 1179 | ||
@@ -1210,7 +1210,7 @@ process_responder(BIO * err, OCSP_REQUEST * req, | |||
1210 | resp = query_responder(err, cbio, path, headers, req, req_timeout); | 1210 | resp = query_responder(err, cbio, path, headers, req, req_timeout); |
1211 | if (!resp) | 1211 | if (!resp) |
1212 | BIO_printf(bio_err, "Error querying OCSP responder\n"); | 1212 | BIO_printf(bio_err, "Error querying OCSP responder\n"); |
1213 | end: | 1213 | end: |
1214 | if (cbio) | 1214 | if (cbio) |
1215 | BIO_free_all(cbio); | 1215 | BIO_free_all(cbio); |
1216 | if (ctx) | 1216 | if (ctx) |
diff --git a/src/usr.bin/openssl/openssl.c b/src/usr.bin/openssl/openssl.c index 346b1d83c7..b3e85d63ba 100644 --- a/src/usr.bin/openssl/openssl.c +++ b/src/usr.bin/openssl/openssl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: openssl.c,v 1.25 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: openssl.c,v 1.26 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -385,7 +385,7 @@ lock_dbg_cb(int mode, int type, const char *file, int line) | |||
385 | goto err; | 385 | goto err; |
386 | } | 386 | } |
387 | 387 | ||
388 | err: | 388 | err: |
389 | if (errstr) { | 389 | if (errstr) { |
390 | /* we cannot use bio_err here */ | 390 | /* we cannot use bio_err here */ |
391 | fprintf(stderr, "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n", | 391 | fprintf(stderr, "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n", |
@@ -560,7 +560,7 @@ main(int argc, char **argv) | |||
560 | BIO_printf(bio_err, "bad exit\n"); | 560 | BIO_printf(bio_err, "bad exit\n"); |
561 | ret = 1; | 561 | ret = 1; |
562 | 562 | ||
563 | end: | 563 | end: |
564 | free(to_free); | 564 | free(to_free); |
565 | 565 | ||
566 | if (config != NULL) { | 566 | if (config != NULL) { |
@@ -707,7 +707,7 @@ do_cmd(LHASH_OF(FUNCTION) * prog, int argc, char *argv[]) | |||
707 | BIO_printf(bio_err, "\n\n"); | 707 | BIO_printf(bio_err, "\n\n"); |
708 | ret = 0; | 708 | ret = 0; |
709 | } | 709 | } |
710 | end: | 710 | end: |
711 | return (ret); | 711 | return (ret); |
712 | } | 712 | } |
713 | 713 | ||
diff --git a/src/usr.bin/openssl/passwd.c b/src/usr.bin/openssl/passwd.c index af5360448c..428f75a7ca 100644 --- a/src/usr.bin/openssl/passwd.c +++ b/src/usr.bin/openssl/passwd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: passwd.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: passwd.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ |
2 | 2 | ||
3 | #if defined OPENSSL_NO_MD5 | 3 | #if defined OPENSSL_NO_MD5 |
4 | #define NO_MD5CRYPT_1 | 4 | #define NO_MD5CRYPT_1 |
@@ -273,7 +273,7 @@ passwd_main(int argc, char **argv) | |||
273 | } | 273 | } |
274 | ret = 0; | 274 | ret = 0; |
275 | 275 | ||
276 | err: | 276 | err: |
277 | ERR_print_errors(bio_err); | 277 | ERR_print_errors(bio_err); |
278 | 278 | ||
279 | free(salt_malloc); | 279 | free(salt_malloc); |
@@ -477,7 +477,7 @@ do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, | |||
477 | BIO_printf(out, "%s\n", hash); | 477 | BIO_printf(out, "%s\n", hash); |
478 | return 1; | 478 | return 1; |
479 | 479 | ||
480 | err: | 480 | err: |
481 | return 0; | 481 | return 0; |
482 | } | 482 | } |
483 | #else | 483 | #else |
diff --git a/src/usr.bin/openssl/pkcs12.c b/src/usr.bin/openssl/pkcs12.c index 69d2d0a950..2e852cebc7 100644 --- a/src/usr.bin/openssl/pkcs12.c +++ b/src/usr.bin/openssl/pkcs12.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkcs12.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: pkcs12.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -584,7 +584,7 @@ export_end: | |||
584 | goto end; | 584 | goto end; |
585 | } | 585 | } |
586 | ret = 0; | 586 | ret = 0; |
587 | end: | 587 | end: |
588 | if (p12) | 588 | if (p12) |
589 | PKCS12_free(p12); | 589 | PKCS12_free(p12); |
590 | BIO_free(in); | 590 | BIO_free(in); |
@@ -637,7 +637,7 @@ dump_certs_keys_p12(BIO * out, PKCS12 * p12, char *pass, | |||
637 | } | 637 | } |
638 | ret = 1; | 638 | ret = 1; |
639 | 639 | ||
640 | err: | 640 | err: |
641 | 641 | ||
642 | if (asafes) | 642 | if (asafes) |
643 | sk_PKCS7_pop_free(asafes, PKCS7_free); | 643 | sk_PKCS7_pop_free(asafes, PKCS7_free); |
@@ -768,7 +768,7 @@ get_cert_chain(X509 * cert, X509_STORE * store, STACK_OF(X509) ** chain) | |||
768 | goto err; | 768 | goto err; |
769 | } else | 769 | } else |
770 | chn = X509_STORE_CTX_get1_chain(&store_ctx); | 770 | chn = X509_STORE_CTX_get1_chain(&store_ctx); |
771 | err: | 771 | err: |
772 | X509_STORE_CTX_cleanup(&store_ctx); | 772 | X509_STORE_CTX_cleanup(&store_ctx); |
773 | *chain = chn; | 773 | *chain = chn; |
774 | 774 | ||
diff --git a/src/usr.bin/openssl/pkcs7.c b/src/usr.bin/openssl/pkcs7.c index 32d1682ff1..f1edc9e489 100644 --- a/src/usr.bin/openssl/pkcs7.c +++ b/src/usr.bin/openssl/pkcs7.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkcs7.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: pkcs7.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -277,7 +277,7 @@ pkcs7_main(int argc, char **argv) | |||
277 | } | 277 | } |
278 | } | 278 | } |
279 | ret = 0; | 279 | ret = 0; |
280 | end: | 280 | end: |
281 | if (p7 != NULL) | 281 | if (p7 != NULL) |
282 | PKCS7_free(p7); | 282 | PKCS7_free(p7); |
283 | if (in != NULL) | 283 | if (in != NULL) |
diff --git a/src/usr.bin/openssl/pkcs8.c b/src/usr.bin/openssl/pkcs8.c index 5d1c2023af..a0dac88772 100644 --- a/src/usr.bin/openssl/pkcs8.c +++ b/src/usr.bin/openssl/pkcs8.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkcs8.c,v 1.10 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: pkcs8.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999-2004. | 3 | * project 1999-2004. |
4 | */ | 4 | */ |
@@ -406,7 +406,7 @@ pkcs8_main(int argc, char **argv) | |||
406 | } | 406 | } |
407 | ret = 0; | 407 | ret = 0; |
408 | 408 | ||
409 | end: | 409 | end: |
410 | X509_SIG_free(p8); | 410 | X509_SIG_free(p8); |
411 | PKCS8_PRIV_KEY_INFO_free(p8inf); | 411 | PKCS8_PRIV_KEY_INFO_free(p8inf); |
412 | EVP_PKEY_free(pkey); | 412 | EVP_PKEY_free(pkey); |
diff --git a/src/usr.bin/openssl/pkey.c b/src/usr.bin/openssl/pkey.c index e91bc79090..49782317ee 100644 --- a/src/usr.bin/openssl/pkey.c +++ b/src/usr.bin/openssl/pkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkey.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: pkey.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006 | 3 | * project 2006 |
4 | */ | 4 | */ |
@@ -149,7 +149,7 @@ pkey_main(int argc, char **argv) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | if (badarg) { | 151 | if (badarg) { |
152 | bad: | 152 | bad: |
153 | BIO_printf(bio_err, "Usage pkey [options]\n"); | 153 | BIO_printf(bio_err, "Usage pkey [options]\n"); |
154 | BIO_printf(bio_err, "where options are\n"); | 154 | BIO_printf(bio_err, "where options are\n"); |
155 | BIO_printf(bio_err, "-in file input file\n"); | 155 | BIO_printf(bio_err, "-in file input file\n"); |
@@ -209,7 +209,7 @@ bad: | |||
209 | } | 209 | } |
210 | ret = 0; | 210 | ret = 0; |
211 | 211 | ||
212 | end: | 212 | end: |
213 | EVP_PKEY_free(pkey); | 213 | EVP_PKEY_free(pkey); |
214 | BIO_free_all(out); | 214 | BIO_free_all(out); |
215 | BIO_free(in); | 215 | BIO_free(in); |
diff --git a/src/usr.bin/openssl/pkeyparam.c b/src/usr.bin/openssl/pkeyparam.c index 698c105141..51ea2b55fb 100644 --- a/src/usr.bin/openssl/pkeyparam.c +++ b/src/usr.bin/openssl/pkeyparam.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkeyparam.c,v 1.10 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: pkeyparam.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006 | 3 | * project 2006 |
4 | */ | 4 | */ |
@@ -165,7 +165,7 @@ pkeyparam_main(int argc, char **argv) | |||
165 | 165 | ||
166 | ret = 0; | 166 | ret = 0; |
167 | 167 | ||
168 | end: | 168 | end: |
169 | EVP_PKEY_free(pkey); | 169 | EVP_PKEY_free(pkey); |
170 | BIO_free_all(out); | 170 | BIO_free_all(out); |
171 | BIO_free(in); | 171 | BIO_free(in); |
diff --git a/src/usr.bin/openssl/pkeyutl.c b/src/usr.bin/openssl/pkeyutl.c index 659c2b2916..87a9eeb6f5 100644 --- a/src/usr.bin/openssl/pkeyutl.c +++ b/src/usr.bin/openssl/pkeyutl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkeyutl.c,v 1.13 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: pkeyutl.c,v 1.14 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -309,7 +309,7 @@ pkeyutl_main(int argc, char **argv) | |||
309 | else | 309 | else |
310 | BIO_write(out, buf_out, buf_outlen); | 310 | BIO_write(out, buf_out, buf_outlen); |
311 | 311 | ||
312 | end: | 312 | end: |
313 | EVP_PKEY_CTX_free(ctx); | 313 | EVP_PKEY_CTX_free(ctx); |
314 | BIO_free(in); | 314 | BIO_free(in); |
315 | BIO_free_all(out); | 315 | BIO_free_all(out); |
@@ -427,7 +427,7 @@ init_ctx(int *pkeysize, | |||
427 | EVP_PKEY_CTX_free(ctx); | 427 | EVP_PKEY_CTX_free(ctx); |
428 | ctx = NULL; | 428 | ctx = NULL; |
429 | } | 429 | } |
430 | end: | 430 | end: |
431 | 431 | ||
432 | free(passin); | 432 | free(passin); |
433 | 433 | ||
diff --git a/src/usr.bin/openssl/prime.c b/src/usr.bin/openssl/prime.c index c9bf33bff9..280ccef5fc 100644 --- a/src/usr.bin/openssl/prime.c +++ b/src/usr.bin/openssl/prime.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: prime.c,v 1.10 2015/10/17 15:00:11 doug Exp $ */ | 1 | /* $OpenBSD: prime.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -191,7 +191,7 @@ prime_main(int argc, char **argv) | |||
191 | 191 | ||
192 | ret = 0; | 192 | ret = 0; |
193 | 193 | ||
194 | end: | 194 | end: |
195 | BN_free(bn); | 195 | BN_free(bn); |
196 | BIO_free_all(bio_out); | 196 | BIO_free_all(bio_out); |
197 | 197 | ||
diff --git a/src/usr.bin/openssl/rand.c b/src/usr.bin/openssl/rand.c index 6e4517ac0b..0f91dde8b4 100644 --- a/src/usr.bin/openssl/rand.c +++ b/src/usr.bin/openssl/rand.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rand.c,v 1.12 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: rand.c,v 1.13 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -176,7 +176,7 @@ rand_main(int argc, char **argv) | |||
176 | 176 | ||
177 | ret = 0; | 177 | ret = 0; |
178 | 178 | ||
179 | err: | 179 | err: |
180 | ERR_print_errors(bio_err); | 180 | ERR_print_errors(bio_err); |
181 | BIO_free_all(out); | 181 | BIO_free_all(out); |
182 | 182 | ||
diff --git a/src/usr.bin/openssl/req.c b/src/usr.bin/openssl/req.c index 352e38b226..c5cae4df89 100644 --- a/src/usr.bin/openssl/req.c +++ b/src/usr.bin/openssl/req.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: req.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: req.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -340,7 +340,7 @@ req_main(int argc, char **argv) | |||
340 | } | 340 | } |
341 | 341 | ||
342 | if (badops) { | 342 | if (badops) { |
343 | bad: | 343 | bad: |
344 | BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog); | 344 | BIO_printf(bio_err, "%s [options] <infile >outfile\n", prog); |
345 | BIO_printf(bio_err, "where options are\n"); | 345 | BIO_printf(bio_err, "where options are\n"); |
346 | BIO_printf(bio_err, " -inform arg input format - DER or PEM\n"); | 346 | BIO_printf(bio_err, " -inform arg input format - DER or PEM\n"); |
@@ -591,7 +591,7 @@ bad: | |||
591 | cipher = NULL; | 591 | cipher = NULL; |
592 | 592 | ||
593 | i = 0; | 593 | i = 0; |
594 | loop: | 594 | loop: |
595 | if (!PEM_write_bio_PrivateKey(out, pkey, cipher, | 595 | if (!PEM_write_bio_PrivateKey(out, pkey, cipher, |
596 | NULL, 0, NULL, passout)) { | 596 | NULL, 0, NULL, passout)) { |
597 | if ((ERR_GET_REASON(ERR_peek_error()) == | 597 | if ((ERR_GET_REASON(ERR_peek_error()) == |
@@ -858,7 +858,7 @@ loop: | |||
858 | } | 858 | } |
859 | } | 859 | } |
860 | ex = 0; | 860 | ex = 0; |
861 | end: | 861 | end: |
862 | if (ex) { | 862 | if (ex) { |
863 | ERR_print_errors(bio_err); | 863 | ERR_print_errors(bio_err); |
864 | } | 864 | } |
@@ -943,7 +943,7 @@ make_REQ(X509_REQ * req, EVP_PKEY * pkey, char *subj, int multirdn, | |||
943 | goto err; | 943 | goto err; |
944 | 944 | ||
945 | ret = 1; | 945 | ret = 1; |
946 | err: | 946 | err: |
947 | return (ret); | 947 | return (ret); |
948 | } | 948 | } |
949 | 949 | ||
@@ -996,7 +996,7 @@ prompt_info(X509_REQ * req, | |||
996 | } | 996 | } |
997 | if (sk_CONF_VALUE_num(dn_sk)) { | 997 | if (sk_CONF_VALUE_num(dn_sk)) { |
998 | i = -1; | 998 | i = -1; |
999 | start: for (;;) { | 999 | start: for (;;) { |
1000 | int ret; | 1000 | int ret; |
1001 | i++; | 1001 | i++; |
1002 | if (sk_CONF_VALUE_num(dn_sk) <= i) | 1002 | 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, | |||
1214 | { | 1214 | { |
1215 | int i, ret = 0; | 1215 | int i, ret = 0; |
1216 | char buf[1024]; | 1216 | char buf[1024]; |
1217 | start: | 1217 | start: |
1218 | if (!batch) | 1218 | if (!batch) |
1219 | BIO_printf(bio_err, "%s [%s]:", text, def); | 1219 | BIO_printf(bio_err, "%s [%s]:", text, def); |
1220 | (void) BIO_flush(bio_err); | 1220 | (void) BIO_flush(bio_err); |
@@ -1255,7 +1255,7 @@ start: | |||
1255 | (unsigned char *) buf, -1, -1, mval)) | 1255 | (unsigned char *) buf, -1, -1, mval)) |
1256 | goto err; | 1256 | goto err; |
1257 | ret = 1; | 1257 | ret = 1; |
1258 | err: | 1258 | err: |
1259 | return (ret); | 1259 | return (ret); |
1260 | } | 1260 | } |
1261 | 1261 | ||
@@ -1267,7 +1267,7 @@ add_attribute_object(X509_REQ * req, char *text, const char *def, | |||
1267 | int i; | 1267 | int i; |
1268 | static char buf[1024]; | 1268 | static char buf[1024]; |
1269 | 1269 | ||
1270 | start: | 1270 | start: |
1271 | if (!batch) | 1271 | if (!batch) |
1272 | BIO_printf(bio_err, "%s [%s]:", text, def); | 1272 | BIO_printf(bio_err, "%s [%s]:", text, def); |
1273 | (void) BIO_flush(bio_err); | 1273 | (void) BIO_flush(bio_err); |
@@ -1312,7 +1312,7 @@ start: | |||
1312 | goto err; | 1312 | goto err; |
1313 | } | 1313 | } |
1314 | return (1); | 1314 | return (1); |
1315 | err: | 1315 | err: |
1316 | return (0); | 1316 | return (0); |
1317 | } | 1317 | } |
1318 | 1318 | ||
diff --git a/src/usr.bin/openssl/rsa.c b/src/usr.bin/openssl/rsa.c index 7ad1da13b2..09fe8ef0d6 100644 --- a/src/usr.bin/openssl/rsa.c +++ b/src/usr.bin/openssl/rsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: rsa.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -439,7 +439,7 @@ rsa_main(int argc, char **argv) | |||
439 | } else | 439 | } else |
440 | ret = 0; | 440 | ret = 0; |
441 | 441 | ||
442 | end: | 442 | end: |
443 | BIO_free_all(out); | 443 | BIO_free_all(out); |
444 | RSA_free(rsa); | 444 | RSA_free(rsa); |
445 | free(passin); | 445 | free(passin); |
diff --git a/src/usr.bin/openssl/rsautl.c b/src/usr.bin/openssl/rsautl.c index 1c22e5df0f..1e420b391d 100644 --- a/src/usr.bin/openssl/rsautl.c +++ b/src/usr.bin/openssl/rsautl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsautl.c,v 1.12 2017/08/28 17:50:58 jsing Exp $ */ | 1 | /* $OpenBSD: rsautl.c,v 1.13 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -297,7 +297,7 @@ rsautl_main(int argc, char **argv) | |||
297 | else | 297 | else |
298 | BIO_write(out, rsa_out, rsa_outlen); | 298 | BIO_write(out, rsa_out, rsa_outlen); |
299 | 299 | ||
300 | end: | 300 | end: |
301 | RSA_free(rsa); | 301 | RSA_free(rsa); |
302 | BIO_free(in); | 302 | BIO_free(in); |
303 | BIO_free_all(out); | 303 | BIO_free_all(out); |
diff --git a/src/usr.bin/openssl/s_client.c b/src/usr.bin/openssl/s_client.c index 158992aa04..cedc495218 100644 --- a/src/usr.bin/openssl/s_client.c +++ b/src/usr.bin/openssl/s_client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_client.c,v 1.34 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: s_client.c,v 1.35 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -592,7 +592,7 @@ s_client_main(int argc, char **argv) | |||
592 | goto bad; | 592 | goto bad; |
593 | } | 593 | } |
594 | if (badop) { | 594 | if (badop) { |
595 | bad: | 595 | bad: |
596 | if (errstr) | 596 | if (errstr) |
597 | BIO_printf(bio_err, "invalid argument %s: %s\n", | 597 | BIO_printf(bio_err, "invalid argument %s: %s\n", |
598 | *argv, errstr); | 598 | *argv, errstr); |
@@ -1200,13 +1200,13 @@ re_start: | |||
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | ret = 0; | 1202 | ret = 0; |
1203 | shut: | 1203 | shut: |
1204 | if (in_init) | 1204 | if (in_init) |
1205 | print_stuff(bio_c_out, con, full_log); | 1205 | print_stuff(bio_c_out, con, full_log); |
1206 | SSL_shutdown(con); | 1206 | SSL_shutdown(con); |
1207 | shutdown(SSL_get_fd(con), SHUT_RD); | 1207 | shutdown(SSL_get_fd(con), SHUT_RD); |
1208 | close(SSL_get_fd(con)); | 1208 | close(SSL_get_fd(con)); |
1209 | end: | 1209 | end: |
1210 | if (con != NULL) { | 1210 | if (con != NULL) { |
1211 | if (prexit != 0) | 1211 | if (prexit != 0) |
1212 | print_stuff(bio_c_out, con, 1); | 1212 | print_stuff(bio_c_out, con, 1); |
diff --git a/src/usr.bin/openssl/s_server.c b/src/usr.bin/openssl/s_server.c index 140ab92351..4bdafaf682 100644 --- a/src/usr.bin/openssl/s_server.c +++ b/src/usr.bin/openssl/s_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_server.c,v 1.29 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: s_server.c,v 1.30 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -487,7 +487,7 @@ cert_status_cb(SSL * s, void *arg) | |||
487 | OCSP_RESPONSE_print(err, resp, 2); | 487 | OCSP_RESPONSE_print(err, resp, 2); |
488 | } | 488 | } |
489 | ret = SSL_TLSEXT_ERR_OK; | 489 | ret = SSL_TLSEXT_ERR_OK; |
490 | done: | 490 | done: |
491 | if (ret != SSL_TLSEXT_ERR_OK) | 491 | if (ret != SSL_TLSEXT_ERR_OK) |
492 | ERR_print_errors(err); | 492 | ERR_print_errors(err); |
493 | if (aia) { | 493 | if (aia) { |
@@ -503,7 +503,7 @@ done: | |||
503 | if (resp) | 503 | if (resp) |
504 | OCSP_RESPONSE_free(resp); | 504 | OCSP_RESPONSE_free(resp); |
505 | return ret; | 505 | return ret; |
506 | err: | 506 | err: |
507 | ret = SSL_TLSEXT_ERR_ALERT_FATAL; | 507 | ret = SSL_TLSEXT_ERR_ALERT_FATAL; |
508 | goto done; | 508 | goto done; |
509 | } | 509 | } |
@@ -858,7 +858,7 @@ s_server_main(int argc, char *argv[]) | |||
858 | argv++; | 858 | argv++; |
859 | } | 859 | } |
860 | if (badop) { | 860 | if (badop) { |
861 | bad: | 861 | bad: |
862 | if (errstr) | 862 | if (errstr) |
863 | BIO_printf(bio_err, "invalid argument %s: %s\n", | 863 | BIO_printf(bio_err, "invalid argument %s: %s\n", |
864 | *argv, errstr); | 864 | *argv, errstr); |
@@ -1198,7 +1198,7 @@ bad: | |||
1198 | do_server(port, socket_type, &accept_socket, sv_body, context); | 1198 | do_server(port, socket_type, &accept_socket, sv_body, context); |
1199 | print_stats(bio_s_out, ctx); | 1199 | print_stats(bio_s_out, ctx); |
1200 | ret = 0; | 1200 | ret = 0; |
1201 | end: | 1201 | end: |
1202 | SSL_CTX_free(ctx); | 1202 | SSL_CTX_free(ctx); |
1203 | X509_free(s_cert); | 1203 | X509_free(s_cert); |
1204 | X509_free(s_dcert); | 1204 | X509_free(s_dcert); |
@@ -1540,7 +1540,7 @@ sv_body(char *hostname, int s, unsigned char *context) | |||
1540 | } | 1540 | } |
1541 | } | 1541 | } |
1542 | } | 1542 | } |
1543 | err: | 1543 | err: |
1544 | if (con != NULL) { | 1544 | if (con != NULL) { |
1545 | BIO_printf(bio_s_out, "shutting down SSL\n"); | 1545 | BIO_printf(bio_s_out, "shutting down SSL\n"); |
1546 | SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); | 1546 | SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); |
@@ -1655,7 +1655,7 @@ load_dh_param(const char *dhfile) | |||
1655 | if ((bio = BIO_new_file(dhfile, "r")) == NULL) | 1655 | if ((bio = BIO_new_file(dhfile, "r")) == NULL) |
1656 | goto err; | 1656 | goto err; |
1657 | ret = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); | 1657 | ret = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); |
1658 | err: | 1658 | err: |
1659 | BIO_free(bio); | 1659 | BIO_free(bio); |
1660 | return (ret); | 1660 | return (ret); |
1661 | } | 1661 | } |
@@ -1940,11 +1940,11 @@ www_body(char *hostname, int s, unsigned char *context) | |||
1940 | } else | 1940 | } else |
1941 | break; | 1941 | break; |
1942 | } | 1942 | } |
1943 | end: | 1943 | end: |
1944 | /* make sure we re-use sessions */ | 1944 | /* make sure we re-use sessions */ |
1945 | SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); | 1945 | SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); |
1946 | 1946 | ||
1947 | err: | 1947 | err: |
1948 | 1948 | ||
1949 | if (ret >= 0) | 1949 | if (ret >= 0) |
1950 | BIO_printf(bio_s_out, "ACCEPT\n"); | 1950 | BIO_printf(bio_s_out, "ACCEPT\n"); |
diff --git a/src/usr.bin/openssl/s_socket.c b/src/usr.bin/openssl/s_socket.c index 869211de73..d3aff1b3bb 100644 --- a/src/usr.bin/openssl/s_socket.c +++ b/src/usr.bin/openssl/s_socket.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_socket.c,v 1.8 2015/09/10 02:23:29 lteo Exp $ */ | 1 | /* $OpenBSD: s_socket.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -122,7 +122,7 @@ init_client(int *sock, char *host, char *port, int type, int af) | |||
122 | } | 122 | } |
123 | 123 | ||
124 | perror("connect"); | 124 | perror("connect"); |
125 | out: | 125 | out: |
126 | if (s != -1) | 126 | if (s != -1) |
127 | close(s); | 127 | close(s); |
128 | freeaddrinfo(ai_top); | 128 | freeaddrinfo(ai_top); |
@@ -210,7 +210,7 @@ init_server_long(int *sock, int port, char *ip, int type) | |||
210 | goto err; | 210 | goto err; |
211 | *sock = s; | 211 | *sock = s; |
212 | ret = 1; | 212 | ret = 1; |
213 | err: | 213 | err: |
214 | if ((ret == 0) && (s != -1)) { | 214 | if ((ret == 0) && (s != -1)) { |
215 | shutdown(s, SHUT_RD); | 215 | shutdown(s, SHUT_RD); |
216 | close(s); | 216 | close(s); |
@@ -233,7 +233,7 @@ do_accept(int acc_sock, int *sock, char **host) | |||
233 | socklen_t len; | 233 | socklen_t len; |
234 | /* struct linger ling; */ | 234 | /* struct linger ling; */ |
235 | 235 | ||
236 | redoit: | 236 | redoit: |
237 | 237 | ||
238 | memset((char *) &from, 0, sizeof(from)); | 238 | memset((char *) &from, 0, sizeof(from)); |
239 | len = sizeof(from); | 239 | len = sizeof(from); |
@@ -285,7 +285,7 @@ redoit: | |||
285 | } | 285 | } |
286 | } | 286 | } |
287 | 287 | ||
288 | end: | 288 | end: |
289 | *sock = ret; | 289 | *sock = ret; |
290 | return (1); | 290 | return (1); |
291 | } | 291 | } |
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index e8e8a273a7..ed89160b23 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_time.c,v 1.22 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: s_time.c,v 1.23 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -388,7 +388,7 @@ s_time_main(int argc, char **argv) | |||
388 | * over | 388 | * over |
389 | */ | 389 | */ |
390 | 390 | ||
391 | next: | 391 | next: |
392 | if (!(s_time_config.perform & 2)) | 392 | if (!(s_time_config.perform & 2)) |
393 | goto end; | 393 | goto end; |
394 | printf("\n\nNow timing with session id reuse.\n"); | 394 | printf("\n\nNow timing with session id reuse.\n"); |
@@ -472,7 +472,7 @@ next: | |||
472 | bytes_read / nConn); | 472 | bytes_read / nConn); |
473 | 473 | ||
474 | ret = 0; | 474 | ret = 0; |
475 | end: | 475 | end: |
476 | SSL_free(scon); | 476 | SSL_free(scon); |
477 | 477 | ||
478 | if (tm_ctx != NULL) { | 478 | if (tm_ctx != NULL) { |
diff --git a/src/usr.bin/openssl/sess_id.c b/src/usr.bin/openssl/sess_id.c index 3670f5404f..e739d99d94 100644 --- a/src/usr.bin/openssl/sess_id.c +++ b/src/usr.bin/openssl/sess_id.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sess_id.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: sess_id.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -249,7 +249,7 @@ sess_id_main(int argc, char **argv) | |||
249 | } | 249 | } |
250 | ret = 0; | 250 | ret = 0; |
251 | 251 | ||
252 | end: | 252 | end: |
253 | BIO_free_all(out); | 253 | BIO_free_all(out); |
254 | SSL_SESSION_free(x); | 254 | SSL_SESSION_free(x); |
255 | 255 | ||
@@ -289,7 +289,7 @@ load_sess_id(char *infile, int format) | |||
289 | ERR_print_errors(bio_err); | 289 | ERR_print_errors(bio_err); |
290 | goto end; | 290 | goto end; |
291 | } | 291 | } |
292 | end: | 292 | end: |
293 | BIO_free(in); | 293 | BIO_free(in); |
294 | return (x); | 294 | return (x); |
295 | } | 295 | } |
diff --git a/src/usr.bin/openssl/smime.c b/src/usr.bin/openssl/smime.c index 4222e24bc1..e8f5201e1b 100644 --- a/src/usr.bin/openssl/smime.c +++ b/src/usr.bin/openssl/smime.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: smime.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: smime.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -342,7 +342,7 @@ smime_main(int argc, char **argv) | |||
342 | badarg = 1; | 342 | badarg = 1; |
343 | 343 | ||
344 | if (badarg) { | 344 | if (badarg) { |
345 | argerr: | 345 | argerr: |
346 | BIO_printf(bio_err, "Usage smime [options] cert.pem ...\n"); | 346 | BIO_printf(bio_err, "Usage smime [options] cert.pem ...\n"); |
347 | BIO_printf(bio_err, "where options are\n"); | 347 | BIO_printf(bio_err, "where options are\n"); |
348 | BIO_printf(bio_err, "-encrypt encrypt message\n"); | 348 | BIO_printf(bio_err, "-encrypt encrypt message\n"); |
@@ -620,7 +620,7 @@ argerr: | |||
620 | } | 620 | } |
621 | } | 621 | } |
622 | ret = 0; | 622 | ret = 0; |
623 | end: | 623 | end: |
624 | if (ret) | 624 | if (ret) |
625 | ERR_print_errors(bio_err); | 625 | ERR_print_errors(bio_err); |
626 | sk_X509_pop_free(encerts, X509_free); | 626 | sk_X509_pop_free(encerts, X509_free); |
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c index 4238b15f61..a21f67b5cf 100644 --- a/src/usr.bin/openssl/speed.c +++ b/src/usr.bin/openssl/speed.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: speed.c,v 1.21 2017/12/05 15:02:06 jca Exp $ */ | 1 | /* $OpenBSD: speed.c,v 1.22 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1897,7 +1897,7 @@ show_res: | |||
1897 | 1897 | ||
1898 | mret = 0; | 1898 | mret = 0; |
1899 | 1899 | ||
1900 | end: | 1900 | end: |
1901 | ERR_print_errors(bio_err); | 1901 | ERR_print_errors(bio_err); |
1902 | free(buf); | 1902 | free(buf); |
1903 | free(buf2); | 1903 | free(buf2); |
diff --git a/src/usr.bin/openssl/spkac.c b/src/usr.bin/openssl/spkac.c index 77f3e3479c..549a220589 100644 --- a/src/usr.bin/openssl/spkac.c +++ b/src/usr.bin/openssl/spkac.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: spkac.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: spkac.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. Based on an original idea by Massimiliano Pala | 3 | * project 1999. Based on an original idea by Massimiliano Pala |
4 | * (madwolf@openca.org). | 4 | * (madwolf@openca.org). |
@@ -301,7 +301,7 @@ spkac_main(int argc, char **argv) | |||
301 | 301 | ||
302 | ret = 0; | 302 | ret = 0; |
303 | 303 | ||
304 | end: | 304 | end: |
305 | NCONF_free(conf); | 305 | NCONF_free(conf); |
306 | NETSCAPE_SPKI_free(spki); | 306 | NETSCAPE_SPKI_free(spki); |
307 | BIO_free(in); | 307 | BIO_free(in); |
diff --git a/src/usr.bin/openssl/ts.c b/src/usr.bin/openssl/ts.c index 28462430a2..cac10d0d3f 100644 --- a/src/usr.bin/openssl/ts.c +++ b/src/usr.bin/openssl/ts.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ts.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ | 1 | /* $OpenBSD: ts.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL | 2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL |
3 | * project 2002. | 3 | * project 2002. |
4 | */ | 4 | */ |
@@ -301,7 +301,7 @@ ts_main(int argc, char **argv) | |||
301 | 301 | ||
302 | goto cleanup; | 302 | goto cleanup; |
303 | 303 | ||
304 | usage: | 304 | usage: |
305 | BIO_printf(bio_err, "usage:\n" | 305 | BIO_printf(bio_err, "usage:\n" |
306 | "ts -query [-config configfile] " | 306 | "ts -query [-config configfile] " |
307 | "[-data file_to_hash] [-digest digest_bytes]" | 307 | "[-data file_to_hash] [-digest digest_bytes]" |
@@ -322,7 +322,7 @@ usage: | |||
322 | "-CApath ca_path -CAfile ca_file.pem " | 322 | "-CApath ca_path -CAfile ca_file.pem " |
323 | "-untrusted cert_file.pem\n"); | 323 | "-untrusted cert_file.pem\n"); |
324 | 324 | ||
325 | cleanup: | 325 | cleanup: |
326 | /* Clean up. */ | 326 | /* Clean up. */ |
327 | NCONF_free(conf); | 327 | NCONF_free(conf); |
328 | free(password); | 328 | free(password); |
@@ -435,7 +435,7 @@ query_command(const char *data, char *digest, const EVP_MD * md, | |||
435 | 435 | ||
436 | ret = 1; | 436 | ret = 1; |
437 | 437 | ||
438 | end: | 438 | end: |
439 | ERR_print_errors(bio_err); | 439 | ERR_print_errors(bio_err); |
440 | 440 | ||
441 | /* Clean up. */ | 441 | /* Clean up. */ |
@@ -521,7 +521,7 @@ create_query(BIO * data_bio, char *digest, const EVP_MD * md, | |||
521 | 521 | ||
522 | ret = 1; | 522 | ret = 1; |
523 | 523 | ||
524 | err: | 524 | err: |
525 | if (!ret) { | 525 | if (!ret) { |
526 | TS_REQ_free(ts_req); | 526 | TS_REQ_free(ts_req); |
527 | ts_req = NULL; | 527 | ts_req = NULL; |
@@ -574,7 +574,7 @@ create_digest(BIO * input, char *digest, const EVP_MD * md, | |||
574 | } | 574 | } |
575 | 575 | ||
576 | return md_value_len; | 576 | return md_value_len; |
577 | err: | 577 | err: |
578 | return 0; | 578 | return 0; |
579 | } | 579 | } |
580 | 580 | ||
@@ -605,7 +605,7 @@ create_nonce(int bits) | |||
605 | 605 | ||
606 | return nonce; | 606 | return nonce; |
607 | 607 | ||
608 | err: | 608 | err: |
609 | BIO_printf(bio_err, "could not create nonce\n"); | 609 | BIO_printf(bio_err, "could not create nonce\n"); |
610 | ASN1_INTEGER_free(nonce); | 610 | ASN1_INTEGER_free(nonce); |
611 | return NULL; | 611 | return NULL; |
@@ -680,7 +680,7 @@ reply_command(CONF * conf, char *section, char *queryfile, | |||
680 | 680 | ||
681 | ret = 1; | 681 | ret = 1; |
682 | 682 | ||
683 | end: | 683 | end: |
684 | ERR_print_errors(bio_err); | 684 | ERR_print_errors(bio_err); |
685 | 685 | ||
686 | /* Clean up. */ | 686 | /* Clean up. */ |
@@ -728,7 +728,7 @@ read_PKCS7(BIO * in_bio) | |||
728 | tst_info = NULL; /* Ownership is lost. */ | 728 | tst_info = NULL; /* Ownership is lost. */ |
729 | 729 | ||
730 | ret = 1; | 730 | ret = 1; |
731 | end: | 731 | end: |
732 | PKCS7_free(token); | 732 | PKCS7_free(token); |
733 | TS_TST_INFO_free(tst_info); | 733 | TS_TST_INFO_free(tst_info); |
734 | if (!ret) { | 734 | if (!ret) { |
@@ -813,7 +813,7 @@ create_response(CONF * conf, const char *section, | |||
813 | goto end; | 813 | goto end; |
814 | 814 | ||
815 | ret = 1; | 815 | ret = 1; |
816 | end: | 816 | end: |
817 | if (!ret) { | 817 | if (!ret) { |
818 | TS_RESP_free(response); | 818 | TS_RESP_free(response); |
819 | response = NULL; | 819 | response = NULL; |
@@ -876,7 +876,7 @@ next_serial(const char *serialfile) | |||
876 | goto err; | 876 | goto err; |
877 | } | 877 | } |
878 | ret = 1; | 878 | ret = 1; |
879 | err: | 879 | err: |
880 | if (!ret) { | 880 | if (!ret) { |
881 | ASN1_INTEGER_free(serial); | 881 | ASN1_INTEGER_free(serial); |
882 | serial = NULL; | 882 | serial = NULL; |
@@ -899,7 +899,7 @@ save_ts_serial(const char *serialfile, ASN1_INTEGER * serial) | |||
899 | if (BIO_puts(out, "\n") <= 0) | 899 | if (BIO_puts(out, "\n") <= 0) |
900 | goto err; | 900 | goto err; |
901 | ret = 1; | 901 | ret = 1; |
902 | err: | 902 | err: |
903 | if (!ret) | 903 | if (!ret) |
904 | BIO_printf(bio_err, "could not save serial number to %s\n", | 904 | BIO_printf(bio_err, "could not save serial number to %s\n", |
905 | serialfile); | 905 | serialfile); |
@@ -941,7 +941,7 @@ verify_command(char *data, char *digest, char *queryfile, char *in, | |||
941 | TS_RESP_verify_token(verify_ctx, token) : | 941 | TS_RESP_verify_token(verify_ctx, token) : |
942 | TS_RESP_verify_response(verify_ctx, response); | 942 | TS_RESP_verify_response(verify_ctx, response); |
943 | 943 | ||
944 | end: | 944 | end: |
945 | printf("Verification: "); | 945 | printf("Verification: "); |
946 | if (ret) | 946 | if (ret) |
947 | printf("OK\n"); | 947 | printf("OK\n"); |
@@ -1012,7 +1012,7 @@ create_verify_ctx(char *data, char *digest, char *queryfile, char *ca_path, | |||
1012 | goto err; | 1012 | goto err; |
1013 | 1013 | ||
1014 | ret = 1; | 1014 | ret = 1; |
1015 | err: | 1015 | err: |
1016 | if (!ret) { | 1016 | if (!ret) { |
1017 | TS_VERIFY_CTX_free(ctx); | 1017 | TS_VERIFY_CTX_free(ctx); |
1018 | ctx = NULL; | 1018 | ctx = NULL; |
@@ -1064,7 +1064,7 @@ create_cert_store(char *ca_path, char *ca_file) | |||
1064 | } | 1064 | } |
1065 | } | 1065 | } |
1066 | return cert_ctx; | 1066 | return cert_ctx; |
1067 | err: | 1067 | err: |
1068 | X509_STORE_free(cert_ctx); | 1068 | X509_STORE_free(cert_ctx); |
1069 | return NULL; | 1069 | return NULL; |
1070 | } | 1070 | } |
diff --git a/src/usr.bin/openssl/verify.c b/src/usr.bin/openssl/verify.c index d9b5ef9795..f616e3c440 100644 --- a/src/usr.bin/openssl/verify.c +++ b/src/usr.bin/openssl/verify.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: verify.c,v 1.6 2015/10/17 15:00:11 doug Exp $ */ | 1 | /* $OpenBSD: verify.c,v 1.7 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -201,7 +201,7 @@ verify_main(int argc, char **argv) | |||
201 | ret = -1; | 201 | ret = -1; |
202 | } | 202 | } |
203 | 203 | ||
204 | end: | 204 | end: |
205 | if (ret == 1) { | 205 | if (ret == 1) { |
206 | BIO_printf(bio_err, "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); | 206 | BIO_printf(bio_err, "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); |
207 | BIO_printf(bio_err, " [-attime timestamp]"); | 207 | BIO_printf(bio_err, " [-attime timestamp]"); |
@@ -259,7 +259,7 @@ check(X509_STORE * ctx, char *file, STACK_OF(X509) * uchain, | |||
259 | 259 | ||
260 | ret = 0; | 260 | ret = 0; |
261 | 261 | ||
262 | end: | 262 | end: |
263 | if (i > 0) { | 263 | if (i > 0) { |
264 | fprintf(stdout, "OK\n"); | 264 | fprintf(stdout, "OK\n"); |
265 | ret = 1; | 265 | ret = 1; |
diff --git a/src/usr.bin/openssl/x509.c b/src/usr.bin/openssl/x509.c index 8d3dc07090..84aeed3c07 100644 --- a/src/usr.bin/openssl/x509.c +++ b/src/usr.bin/openssl/x509.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509.c,v 1.15 2018/02/07 04:57:06 jsing Exp $ */ | 1 | /* $OpenBSD: x509.c,v 1.16 2018/02/07 05:47:55 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -429,7 +429,7 @@ x509_main(int argc, char **argv) | |||
429 | } | 429 | } |
430 | 430 | ||
431 | if (badops) { | 431 | if (badops) { |
432 | bad: | 432 | bad: |
433 | for (pp = x509_usage; (*pp != NULL); pp++) | 433 | for (pp = x509_usage; (*pp != NULL); pp++) |
434 | BIO_printf(bio_err, "%s", *pp); | 434 | BIO_printf(bio_err, "%s", *pp); |
435 | goto end; | 435 | goto end; |
@@ -905,7 +905,7 @@ bad: | |||
905 | } | 905 | } |
906 | ret = 0; | 906 | ret = 0; |
907 | 907 | ||
908 | end: | 908 | end: |
909 | OBJ_cleanup(); | 909 | OBJ_cleanup(); |
910 | NCONF_free(extconf); | 910 | NCONF_free(extconf); |
911 | BIO_free_all(out); | 911 | BIO_free_all(out); |
@@ -963,7 +963,7 @@ x509_load_serial(char *CAfile, char *serialfile, int create) | |||
963 | if (!save_serial(buf, NULL, serial, &bs)) | 963 | if (!save_serial(buf, NULL, serial, &bs)) |
964 | goto end; | 964 | goto end; |
965 | 965 | ||
966 | end: | 966 | end: |
967 | free(buf); | 967 | free(buf); |
968 | BN_free(serial); | 968 | BN_free(serial); |
969 | 969 | ||
@@ -1036,7 +1036,7 @@ x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, X509 *x, | |||
1036 | if (!do_X509_sign(bio_err, x, pkey, digest, sigopts)) | 1036 | if (!do_X509_sign(bio_err, x, pkey, digest, sigopts)) |
1037 | goto end; | 1037 | goto end; |
1038 | ret = 1; | 1038 | ret = 1; |
1039 | end: | 1039 | end: |
1040 | X509_STORE_CTX_cleanup(&xsc); | 1040 | X509_STORE_CTX_cleanup(&xsc); |
1041 | if (!ret) | 1041 | if (!ret) |
1042 | ERR_print_errors(bio_err); | 1042 | ERR_print_errors(bio_err); |
@@ -1122,7 +1122,7 @@ sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest, | |||
1122 | goto err; | 1122 | goto err; |
1123 | return 1; | 1123 | return 1; |
1124 | 1124 | ||
1125 | err: | 1125 | err: |
1126 | ERR_print_errors(bio_err); | 1126 | ERR_print_errors(bio_err); |
1127 | return 0; | 1127 | return 0; |
1128 | } | 1128 | } |