=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/pkeyparam.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/usr.bin/openssl/pkeyparam.c 2023/03/05 13:12:53 1.16 +++ src/usr.bin/openssl/pkeyparam.c 2023/03/06 14:32:06 1.17 @@ -1,4 +1,4 @@ -/* $OpenBSD: pkeyparam.c,v 1.16 2023/03/05 13:12:53 tb Exp $ */ +/* $OpenBSD: pkeyparam.c,v 1.17 2023/03/06 14:32:06 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -71,40 +71,40 @@ int noout; char *outfile; int text; -} pkeyparam_config; +} cfg; static const struct option pkeyparam_options[] = { { .name = "check", .desc = "Check validity of key parameters", .type = OPTION_FLAG, - .opt.flag = &pkeyparam_config.check, + .opt.flag = &cfg.check, }, { .name = "in", .argname = "file", .desc = "Input file (default stdin)", .type = OPTION_ARG, - .opt.arg = &pkeyparam_config.infile, + .opt.arg = &cfg.infile, }, { .name = "noout", .desc = "Do not print encoded version of the parameters", .type = OPTION_FLAG, - .opt.flag = &pkeyparam_config.noout, + .opt.flag = &cfg.noout, }, { .name = "out", .argname = "file", .desc = "Output file (default stdout)", .type = OPTION_ARG, - .opt.arg = &pkeyparam_config.outfile, + .opt.arg = &cfg.outfile, }, { .name = "text", .desc = "Print out the parameters in plain text", .type = OPTION_FLAG, - .opt.flag = &pkeyparam_config.text, + .opt.flag = &cfg.text, }, { NULL }, }; @@ -130,26 +130,26 @@ exit(1); } - memset(&pkeyparam_config, 0, sizeof(pkeyparam_config)); + memset(&cfg, 0, sizeof(cfg)); if (options_parse(argc, argv, pkeyparam_options, NULL, NULL) != 0) { pkeyparam_usage(); return (1); } - if (pkeyparam_config.infile) { - if (!(in = BIO_new_file(pkeyparam_config.infile, "r"))) { + if (cfg.infile) { + if (!(in = BIO_new_file(cfg.infile, "r"))) { BIO_printf(bio_err, "Can't open input file %s\n", - pkeyparam_config.infile); + cfg.infile); goto end; } } else in = BIO_new_fp(stdin, BIO_NOCLOSE); - if (pkeyparam_config.outfile) { - if (!(out = BIO_new_file(pkeyparam_config.outfile, "w"))) { + if (cfg.outfile) { + if (!(out = BIO_new_file(cfg.outfile, "w"))) { BIO_printf(bio_err, "Can't open output file %s\n", - pkeyparam_config.outfile); + cfg.outfile); goto end; } } else { @@ -163,15 +163,15 @@ goto end; } - if (pkeyparam_config.check) { + if (cfg.check) { if (!pkey_check(out, pkey, EVP_PKEY_param_check, "Parameters")) goto end; } - if (!pkeyparam_config.noout) + if (!cfg.noout) PEM_write_bio_Parameters(out, pkey); - if (pkeyparam_config.text) + if (cfg.text) EVP_PKEY_print_params(out, pkey, 0, NULL); ret = 0;