2015-01-22 11:40:55 +08:00
|
|
|
/*
|
2022-05-03 18:52:38 +08:00
|
|
|
* Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
|
2001-01-13 09:48:38 +08:00
|
|
|
*
|
2018-12-06 20:00:26 +08:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 02:18:30 +08:00
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
2001-01-13 09:48:38 +08:00
|
|
|
*/
|
|
|
|
|
2016-03-22 00:54:53 +08:00
|
|
|
#include <openssl/opensslconf.h>
|
|
|
|
|
2020-03-05 05:52:22 +08:00
|
|
|
#ifdef OPENSSL_SYS_VMS
|
|
|
|
/* So fd_set and friends get properly defined on OpenVMS */
|
|
|
|
# define _XOPEN_SOURCE_EXTENDED
|
|
|
|
#endif
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2020-03-05 05:52:22 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <ctype.h>
|
2016-03-22 00:54:53 +08:00
|
|
|
|
|
|
|
/* Needs to be included before the openssl headers */
|
2020-03-05 05:52:22 +08:00
|
|
|
#include "apps.h"
|
2020-05-05 02:29:25 +08:00
|
|
|
#include "http_server.h"
|
2020-03-05 05:52:22 +08:00
|
|
|
#include "progs.h"
|
|
|
|
#include "internal/sockets.h"
|
|
|
|
#include <openssl/e_os2.h>
|
|
|
|
#include <openssl/crypto.h>
|
|
|
|
#include <openssl/err.h>
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
#include <openssl/evp.h>
|
|
|
|
#include <openssl/bn.h>
|
|
|
|
#include <openssl/x509v3.h>
|
2018-03-06 04:18:04 +08:00
|
|
|
|
2020-09-07 05:37:47 +08:00
|
|
|
#if defined(__TANDEM)
|
|
|
|
# if defined(OPENSSL_TANDEM_FLOSS)
|
|
|
|
# include <floss.h(floss_fork)>
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2020-03-05 05:52:22 +08:00
|
|
|
#if defined(OPENSSL_SYS_VXWORKS)
|
2018-12-20 19:59:31 +08:00
|
|
|
/* not supported */
|
|
|
|
int setpgid(pid_t pid, pid_t pgid)
|
|
|
|
{
|
|
|
|
errno = ENOSYS;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* not supported */
|
|
|
|
pid_t fork(void)
|
|
|
|
{
|
|
|
|
errno = ENOSYS;
|
|
|
|
return (pid_t) -1;
|
|
|
|
}
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2015-01-22 11:40:55 +08:00
|
|
|
/* Maximum leeway in validity period: default 5 minutes */
|
2020-03-05 05:52:22 +08:00
|
|
|
#define MAX_VALIDITY_PERIOD (5 * 60)
|
2015-01-22 11:40:55 +08:00
|
|
|
|
|
|
|
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert,
|
|
|
|
const EVP_MD *cert_id_md, X509 *issuer,
|
|
|
|
STACK_OF(OCSP_CERTID) *ids);
|
|
|
|
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,
|
|
|
|
const EVP_MD *cert_id_md, X509 *issuer,
|
|
|
|
STACK_OF(OCSP_CERTID) *ids);
|
2020-09-18 22:43:00 +08:00
|
|
|
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
2015-01-22 11:40:55 +08:00
|
|
|
STACK_OF(OPENSSL_STRING) *names,
|
|
|
|
STACK_OF(OCSP_CERTID) *ids, long nsec,
|
|
|
|
long maxage);
|
2017-08-18 21:27:19 +08:00
|
|
|
static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req,
|
2015-04-01 05:06:21 +08:00
|
|
|
CA_DB *db, STACK_OF(X509) *ca, X509 *rcert,
|
2015-01-22 11:40:55 +08:00
|
|
|
EVP_PKEY *rkey, const EVP_MD *md,
|
2017-08-18 21:27:19 +08:00
|
|
|
STACK_OF(OPENSSL_STRING) *sigopts,
|
2015-01-22 11:40:55 +08:00
|
|
|
STACK_OF(X509) *rother, unsigned long flags,
|
2017-04-20 03:35:16 +08:00
|
|
|
int nmin, int ndays, int badsig,
|
|
|
|
const EVP_MD *resp_md);
|
2001-07-13 04:41:51 +08:00
|
|
|
|
2003-04-04 00:33:03 +08:00
|
|
|
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser);
|
2020-05-05 02:29:25 +08:00
|
|
|
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio,
|
2021-07-13 16:20:38 +08:00
|
|
|
int timeout);
|
2020-05-05 02:29:25 +08:00
|
|
|
static int send_ocsp_response(BIO *cbio, const OCSP_RESPONSE *resp);
|
2018-03-06 04:18:04 +08:00
|
|
|
static char *prog;
|
|
|
|
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifdef HTTP_DAEMON
|
2018-03-06 04:18:04 +08:00
|
|
|
static int index_changed(CA_DB *);
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2016-03-21 23:32:40 +08:00
|
|
|
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
typedef enum OPTION_choice {
|
2021-05-01 21:29:00 +08:00
|
|
|
OPT_COMMON,
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPT_OUTFILE, OPT_TIMEOUT, OPT_URL, OPT_HOST, OPT_PORT,
|
2021-05-19 12:07:30 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-05-12 19:58:52 +08:00
|
|
|
OPT_PROXY, OPT_NO_PROXY,
|
2021-05-19 12:07:30 +08:00
|
|
|
#endif
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPT_IGNORE_ERR, OPT_NOVERIFY, OPT_NONCE, OPT_NO_NONCE,
|
|
|
|
OPT_RESP_NO_CERTS, OPT_RESP_KEY_ID, OPT_NO_CERTS,
|
|
|
|
OPT_NO_SIGNATURE_VERIFY, OPT_NO_CERT_VERIFY, OPT_NO_CHAIN,
|
|
|
|
OPT_NO_CERT_CHECKS, OPT_NO_EXPLICIT, OPT_TRUST_OTHER,
|
|
|
|
OPT_NO_INTERN, OPT_BADSIG, OPT_TEXT, OPT_REQ_TEXT, OPT_RESP_TEXT,
|
|
|
|
OPT_REQIN, OPT_RESPIN, OPT_SIGNER, OPT_VAFILE, OPT_SIGN_OTHER,
|
2019-03-07 22:26:34 +08:00
|
|
|
OPT_VERIFY_OTHER, OPT_CAFILE, OPT_CAPATH, OPT_CASTORE, OPT_NOCAFILE,
|
|
|
|
OPT_NOCAPATH, OPT_NOCASTORE,
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPT_VALIDITY_PERIOD, OPT_STATUS_AGE, OPT_SIGNKEY, OPT_REQOUT,
|
2015-04-26 04:04:42 +08:00
|
|
|
OPT_RESPOUT, OPT_PATH, OPT_ISSUER, OPT_CERT, OPT_SERIAL,
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPT_INDEX, OPT_CA, OPT_NMIN, OPT_REQUEST, OPT_NDAYS, OPT_RSIGNER,
|
2018-01-24 03:22:17 +08:00
|
|
|
OPT_RKEY, OPT_ROTHER, OPT_RMD, OPT_RSIGOPT, OPT_HEADER,
|
2019-12-26 12:20:46 +08:00
|
|
|
OPT_PASSIN,
|
2017-04-20 03:35:16 +08:00
|
|
|
OPT_RCID,
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPT_V_ENUM,
|
2018-03-06 04:18:04 +08:00
|
|
|
OPT_MD,
|
2020-02-25 12:29:30 +08:00
|
|
|
OPT_MULTI, OPT_PROV_ENUM
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
} OPTION_CHOICE;
|
|
|
|
|
2016-03-13 21:07:50 +08:00
|
|
|
const OPTIONS ocsp_options[] = {
|
2019-11-08 04:08:30 +08:00
|
|
|
OPT_SECTION("General"),
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"help", OPT_HELP, '-', "Display this summary"},
|
2016-08-01 01:02:50 +08:00
|
|
|
{"ignore_err", OPT_IGNORE_ERR, '-',
|
2017-08-12 07:00:21 +08:00
|
|
|
"Ignore error on OCSP request or response and continue running"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"CAfile", OPT_CAFILE, '<', "Trusted certificates file"},
|
|
|
|
{"CApath", OPT_CAPATH, '<', "Trusted certificates directory"},
|
|
|
|
{"CAstore", OPT_CASTORE, ':', "Trusted certificates store URI"},
|
|
|
|
{"no-CAfile", OPT_NOCAFILE, '-',
|
|
|
|
"Do not load the default certificates file"},
|
|
|
|
{"no-CApath", OPT_NOCAPATH, '-',
|
|
|
|
"Do not load certificates from the default certificates directory"},
|
2020-06-17 05:47:48 +08:00
|
|
|
{"no-CAstore", OPT_NOCASTORE, '-',
|
2019-11-08 04:08:30 +08:00
|
|
|
"Do not load certificates from the default certificates store"},
|
|
|
|
|
|
|
|
OPT_SECTION("Responder"),
|
|
|
|
{"timeout", OPT_TIMEOUT, 'p',
|
|
|
|
"Connection timeout (in seconds) to the OCSP responder"},
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"resp_no_certs", OPT_RESP_NO_CERTS, '-',
|
|
|
|
"Don't include any certificates in response"},
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifdef HTTP_DAEMON
|
2018-03-06 04:18:04 +08:00
|
|
|
{"multi", OPT_MULTI, 'p', "run multiple responder processes"},
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"no_certs", OPT_NO_CERTS, '-',
|
|
|
|
"Don't include any certificates in signed request"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"badsig", OPT_BADSIG, '-',
|
2022-06-29 22:19:58 +08:00
|
|
|
"Corrupt last byte of loaded OCSP response signature (for test)"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"CA", OPT_CA, '<', "CA certificate"},
|
|
|
|
{"nmin", OPT_NMIN, 'p', "Number of minutes before next update"},
|
|
|
|
{"nrequest", OPT_REQUEST, 'p',
|
|
|
|
"Number of requests to accept (default unlimited)"},
|
|
|
|
{"reqin", OPT_REQIN, 's', "File with the DER-encoded request"},
|
|
|
|
{"signer", OPT_SIGNER, '<', "Certificate to sign OCSP request with"},
|
|
|
|
{"sign_other", OPT_SIGN_OTHER, '<',
|
|
|
|
"Additional certificates to include in signed request"},
|
|
|
|
{"index", OPT_INDEX, '<', "Certificate status index file"},
|
|
|
|
{"ndays", OPT_NDAYS, 'p', "Number of days before next update"},
|
|
|
|
{"rsigner", OPT_RSIGNER, '<',
|
|
|
|
"Responder certificate to sign responses with"},
|
|
|
|
{"rkey", OPT_RKEY, '<', "Responder key to sign responses with"},
|
2019-12-26 12:20:46 +08:00
|
|
|
{"passin", OPT_PASSIN, 's', "Responder key pass phrase source"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"rother", OPT_ROTHER, '<', "Other certificates to include in response"},
|
|
|
|
{"rmd", OPT_RMD, 's', "Digest Algorithm to use in signature of OCSP response"},
|
|
|
|
{"rsigopt", OPT_RSIGOPT, 's', "OCSP response signature parameter in n:v form"},
|
|
|
|
{"header", OPT_HEADER, 's', "key=value header to add"},
|
|
|
|
{"rcid", OPT_RCID, 's', "Use specified algorithm for cert id in response"},
|
|
|
|
{"", OPT_MD, '-', "Any supported digest algorithm (sha1,sha256, ... )"},
|
|
|
|
|
|
|
|
OPT_SECTION("Client"),
|
|
|
|
{"url", OPT_URL, 's', "Responder URL"},
|
|
|
|
{"host", OPT_HOST, 's', "TCP/IP hostname:port to connect to"},
|
2021-05-23 18:36:11 +08:00
|
|
|
{"port", OPT_PORT, 'N', "Port to run responder on"},
|
2021-05-12 19:58:52 +08:00
|
|
|
{"path", OPT_PATH, 's', "Path to use in OCSP request"},
|
2021-05-19 12:07:30 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-05-12 19:58:52 +08:00
|
|
|
{"proxy", OPT_PROXY, 's',
|
|
|
|
"[http[s]://]host[:port][/path] of HTTP(S) proxy to use; path is ignored"},
|
|
|
|
{"no_proxy", OPT_NO_PROXY, 's',
|
|
|
|
"List of addresses of servers not to use HTTP(S) proxy for"},
|
|
|
|
{OPT_MORE_STR, 0, 0,
|
|
|
|
"Default from environment variable 'no_proxy', else 'NO_PROXY', else none"},
|
2021-05-19 12:07:30 +08:00
|
|
|
#endif
|
2019-11-08 04:08:30 +08:00
|
|
|
{"out", OPT_OUTFILE, '>', "Output filename"},
|
|
|
|
{"noverify", OPT_NOVERIFY, '-', "Don't verify response at all"},
|
|
|
|
{"nonce", OPT_NONCE, '-', "Add OCSP nonce to request"},
|
|
|
|
{"no_nonce", OPT_NO_NONCE, '-', "Don't add OCSP nonce to request"},
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"no_signature_verify", OPT_NO_SIGNATURE_VERIFY, '-',
|
|
|
|
"Don't check signature on response"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"resp_key_id", OPT_RESP_KEY_ID, '-',
|
|
|
|
"Identify response by signing certificate key ID"},
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"no_cert_verify", OPT_NO_CERT_VERIFY, '-',
|
|
|
|
"Don't check signing certificate"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"text", OPT_TEXT, '-', "Print text form of request and response"},
|
|
|
|
{"req_text", OPT_REQ_TEXT, '-', "Print text form of request"},
|
|
|
|
{"resp_text", OPT_RESP_TEXT, '-', "Print text form of response"},
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"no_chain", OPT_NO_CHAIN, '-', "Don't chain verify response"},
|
|
|
|
{"no_cert_checks", OPT_NO_CERT_CHECKS, '-',
|
|
|
|
"Don't do additional checks on signing certificate"},
|
2016-08-01 01:02:50 +08:00
|
|
|
{"no_explicit", OPT_NO_EXPLICIT, '-',
|
|
|
|
"Do not explicitly check the chain, just verify the root"},
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"trust_other", OPT_TRUST_OTHER, '-',
|
|
|
|
"Don't verify additional certificates"},
|
|
|
|
{"no_intern", OPT_NO_INTERN, '-',
|
|
|
|
"Don't search certificates contained in response for signer"},
|
|
|
|
{"respin", OPT_RESPIN, 's', "File with the DER-encoded response"},
|
|
|
|
{"VAfile", OPT_VAFILE, '<', "Validator certificates file"},
|
|
|
|
{"verify_other", OPT_VERIFY_OTHER, '<',
|
|
|
|
"Additional certificates to search for signer"},
|
2021-08-24 18:03:12 +08:00
|
|
|
{"cert", OPT_CERT, '<',
|
|
|
|
"Certificate to check; may be given multiple times"},
|
|
|
|
{"serial", OPT_SERIAL, 's',
|
|
|
|
"Serial number to check; may be given multiple times"},
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{"validity_period", OPT_VALIDITY_PERIOD, 'u',
|
|
|
|
"Maximum validity discrepancy in seconds"},
|
|
|
|
{"signkey", OPT_SIGNKEY, 's', "Private key to sign OCSP request with"},
|
|
|
|
{"reqout", OPT_REQOUT, 's', "Output file for the DER-encoded request"},
|
|
|
|
{"respout", OPT_RESPOUT, 's', "Output file for the DER-encoded response"},
|
2015-04-26 04:04:42 +08:00
|
|
|
{"issuer", OPT_ISSUER, '<', "Issuer certificate"},
|
2019-11-08 04:08:30 +08:00
|
|
|
{"status_age", OPT_STATUS_AGE, 'p', "Maximum status age in seconds"},
|
|
|
|
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPT_V_OPTIONS,
|
2020-02-25 12:29:30 +08:00
|
|
|
OPT_PROV_OPTIONS,
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
{NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
int ocsp_main(int argc, char **argv)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
BIO *acbio = NULL, *cbio = NULL, *derbio = NULL, *out = NULL;
|
2021-02-18 05:15:27 +08:00
|
|
|
EVP_MD *cert_id_md = NULL, *rsign_md = NULL;
|
2017-08-18 21:27:19 +08:00
|
|
|
STACK_OF(OPENSSL_STRING) *rsign_sigopts = NULL;
|
2016-05-12 22:24:06 +08:00
|
|
|
int trailing_md = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
CA_DB *rdb = NULL;
|
|
|
|
EVP_PKEY *key = NULL, *rkey = NULL;
|
|
|
|
OCSP_BASICRESP *bs = NULL;
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_REQUEST *req = NULL;
|
|
|
|
OCSP_RESPONSE *resp = NULL;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
STACK_OF(CONF_VALUE) *headers = NULL;
|
|
|
|
STACK_OF(OCSP_CERTID) *ids = NULL;
|
|
|
|
STACK_OF(OPENSSL_STRING) *reqnames = NULL;
|
|
|
|
STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
|
2015-04-27 01:12:04 +08:00
|
|
|
STACK_OF(X509) *issuers = NULL;
|
2015-04-01 05:06:21 +08:00
|
|
|
X509 *issuer = NULL, *cert = NULL;
|
|
|
|
STACK_OF(X509) *rca_cert = NULL;
|
2021-02-18 05:15:27 +08:00
|
|
|
EVP_MD *resp_certid_md = NULL;
|
2015-01-22 11:40:55 +08:00
|
|
|
X509 *signer = NULL, *rsigner = NULL;
|
|
|
|
X509_STORE *store = NULL;
|
|
|
|
X509_VERIFY_PARAM *vpm = NULL;
|
2019-03-07 22:26:34 +08:00
|
|
|
const char *CAfile = NULL, *CApath = NULL, *CAstore = NULL;
|
2021-02-09 03:03:35 +08:00
|
|
|
char *header, *value, *respdigname = NULL;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
char *host = NULL, *port = NULL, *path = "/", *outfile = NULL;
|
2021-05-19 12:07:30 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-05-12 19:58:52 +08:00
|
|
|
char *opt_proxy = NULL;
|
|
|
|
char *opt_no_proxy = NULL;
|
2021-05-19 12:07:30 +08:00
|
|
|
#endif
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
char *rca_filename = NULL, *reqin = NULL, *respin = NULL;
|
|
|
|
char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;
|
|
|
|
char *rsignfile = NULL, *rkeyfile = NULL;
|
2019-12-26 12:20:46 +08:00
|
|
|
char *passinarg = NULL, *passin = NULL;
|
2015-01-22 11:40:55 +08:00
|
|
|
char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
char *signfile = NULL, *keyfile = NULL;
|
|
|
|
char *thost = NULL, *tport = NULL, *tpath = NULL;
|
2019-03-07 22:26:34 +08:00
|
|
|
int noCAfile = 0, noCApath = 0, noCAstore = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
int accept_count = -1, add_nonce = 1, noverify = 0, use_ssl = -1;
|
|
|
|
int vpmtouched = 0, badsig = 0, i, ignore_err = 0, nmin = 0, ndays = -1;
|
2020-05-25 23:32:26 +08:00
|
|
|
int req_text = 0, resp_text = 0, res, ret = 1;
|
2016-03-21 23:32:40 +08:00
|
|
|
int req_timeout = -1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
long nsec = MAX_VALIDITY_PERIOD, maxage = -1;
|
2015-01-22 11:40:55 +08:00
|
|
|
unsigned long sign_flags = 0, verify_flags = 0, rflags = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
OPTION_CHOICE o;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2021-03-18 11:04:21 +08:00
|
|
|
if ((reqnames = sk_OPENSSL_STRING_new_null()) == NULL
|
|
|
|
|| (ids = sk_OCSP_CERTID_new_null()) == NULL
|
|
|
|
|| (vpm = X509_VERIFY_PARAM_new()) == NULL)
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
goto end;
|
|
|
|
|
2021-08-24 18:03:12 +08:00
|
|
|
opt_set_unknown_name("digest");
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
prog = opt_init(argc, argv, ocsp_options);
|
|
|
|
while ((o = opt_next()) != OPT_EOF) {
|
|
|
|
switch (o) {
|
|
|
|
case OPT_EOF:
|
|
|
|
case OPT_ERR:
|
|
|
|
opthelp:
|
|
|
|
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
|
|
|
|
goto end;
|
|
|
|
case OPT_HELP:
|
|
|
|
ret = 0;
|
|
|
|
opt_help(ocsp_options);
|
|
|
|
goto end;
|
|
|
|
case OPT_OUTFILE:
|
|
|
|
outfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_TIMEOUT:
|
2016-03-21 23:32:40 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
req_timeout = atoi(opt_arg());
|
2016-03-21 23:32:40 +08:00
|
|
|
#endif
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_URL:
|
2015-05-01 22:02:07 +08:00
|
|
|
OPENSSL_free(thost);
|
|
|
|
OPENSSL_free(tport);
|
|
|
|
OPENSSL_free(tpath);
|
2015-06-13 21:29:10 +08:00
|
|
|
thost = tport = tpath = NULL;
|
2021-01-29 05:10:47 +08:00
|
|
|
if (!OSSL_HTTP_parse_url(opt_arg(), &use_ssl, NULL /* userinfo */,
|
|
|
|
&host, &port, NULL /* port_num */,
|
|
|
|
&path, NULL /* qry */, NULL /* frag */)) {
|
|
|
|
BIO_printf(bio_err, "%s Error parsing -url argument\n", prog);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
thost = host;
|
|
|
|
tport = port;
|
|
|
|
tpath = path;
|
|
|
|
break;
|
|
|
|
case OPT_HOST:
|
|
|
|
host = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_PORT:
|
|
|
|
port = opt_arg();
|
|
|
|
break;
|
2021-05-12 19:58:52 +08:00
|
|
|
case OPT_PATH:
|
|
|
|
path = opt_arg();
|
|
|
|
break;
|
2021-05-19 12:07:30 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-05-12 19:58:52 +08:00
|
|
|
case OPT_PROXY:
|
|
|
|
opt_proxy = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_NO_PROXY:
|
|
|
|
opt_no_proxy = opt_arg();
|
|
|
|
break;
|
2021-05-19 12:07:30 +08:00
|
|
|
#endif
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
case OPT_IGNORE_ERR:
|
2015-01-22 11:40:55 +08:00
|
|
|
ignore_err = 1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NOVERIFY:
|
2015-01-22 11:40:55 +08:00
|
|
|
noverify = 1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NONCE:
|
2015-01-22 11:40:55 +08:00
|
|
|
add_nonce = 2;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_NONCE:
|
2015-01-22 11:40:55 +08:00
|
|
|
add_nonce = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_RESP_NO_CERTS:
|
2015-01-22 11:40:55 +08:00
|
|
|
rflags |= OCSP_NOCERTS;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_RESP_KEY_ID:
|
2015-01-22 11:40:55 +08:00
|
|
|
rflags |= OCSP_RESPID_KEY;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_CERTS:
|
2015-01-22 11:40:55 +08:00
|
|
|
sign_flags |= OCSP_NOCERTS;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_SIGNATURE_VERIFY:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_NOSIGS;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_CERT_VERIFY:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_NOVERIFY;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_CHAIN:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_NOCHAIN;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_CERT_CHECKS:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_NOCHECKS;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_EXPLICIT:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_NOEXPLICIT;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_TRUST_OTHER:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_TRUSTOTHER;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NO_INTERN:
|
2015-01-22 11:40:55 +08:00
|
|
|
verify_flags |= OCSP_NOINTERN;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_BADSIG:
|
2015-01-22 11:40:55 +08:00
|
|
|
badsig = 1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_TEXT:
|
|
|
|
req_text = resp_text = 1;
|
|
|
|
break;
|
|
|
|
case OPT_REQ_TEXT:
|
2015-01-22 11:40:55 +08:00
|
|
|
req_text = 1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_RESP_TEXT:
|
2015-01-22 11:40:55 +08:00
|
|
|
resp_text = 1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_REQIN:
|
|
|
|
reqin = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_RESPIN:
|
|
|
|
respin = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_SIGNER:
|
|
|
|
signfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_VAFILE:
|
|
|
|
verify_certfile = opt_arg();
|
|
|
|
verify_flags |= OCSP_TRUSTOTHER;
|
|
|
|
break;
|
|
|
|
case OPT_SIGN_OTHER:
|
|
|
|
sign_certfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_VERIFY_OTHER:
|
|
|
|
verify_certfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_CAFILE:
|
|
|
|
CAfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_CAPATH:
|
|
|
|
CApath = opt_arg();
|
|
|
|
break;
|
2019-03-07 22:26:34 +08:00
|
|
|
case OPT_CASTORE:
|
|
|
|
CAstore = opt_arg();
|
|
|
|
break;
|
2015-09-22 23:00:52 +08:00
|
|
|
case OPT_NOCAFILE:
|
|
|
|
noCAfile = 1;
|
|
|
|
break;
|
|
|
|
case OPT_NOCAPATH:
|
|
|
|
noCApath = 1;
|
|
|
|
break;
|
2019-03-07 22:26:34 +08:00
|
|
|
case OPT_NOCASTORE:
|
|
|
|
noCAstore = 1;
|
|
|
|
break;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
case OPT_V_CASES:
|
|
|
|
if (!opt_verify(o, vpm))
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
vpmtouched++;
|
|
|
|
break;
|
|
|
|
case OPT_VALIDITY_PERIOD:
|
|
|
|
opt_long(opt_arg(), &nsec);
|
|
|
|
break;
|
|
|
|
case OPT_STATUS_AGE:
|
|
|
|
opt_long(opt_arg(), &maxage);
|
|
|
|
break;
|
|
|
|
case OPT_SIGNKEY:
|
|
|
|
keyfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_REQOUT:
|
|
|
|
reqout = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_RESPOUT:
|
|
|
|
respout = opt_arg();
|
|
|
|
break;
|
2015-04-26 04:04:42 +08:00
|
|
|
case OPT_ISSUER:
|
2021-04-30 22:57:53 +08:00
|
|
|
issuer = load_cert(opt_arg(), FORMAT_UNDEF, "issuer certificate");
|
2015-04-26 04:04:42 +08:00
|
|
|
if (issuer == NULL)
|
|
|
|
goto end;
|
2015-10-18 07:04:10 +08:00
|
|
|
if (issuers == NULL) {
|
|
|
|
if ((issuers = sk_X509_new_null()) == NULL)
|
|
|
|
goto end;
|
|
|
|
}
|
2020-02-04 11:50:51 +08:00
|
|
|
if (!sk_X509_push(issuers, issuer))
|
|
|
|
goto end;
|
2015-04-26 04:04:42 +08:00
|
|
|
break;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
case OPT_CERT:
|
2021-08-24 18:03:12 +08:00
|
|
|
reset_unknown();
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
X509_free(cert);
|
2021-04-30 22:57:53 +08:00
|
|
|
cert = load_cert(opt_arg(), FORMAT_UNDEF, "certificate");
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (cert == NULL)
|
|
|
|
goto end;
|
|
|
|
if (cert_id_md == NULL)
|
2021-02-18 05:15:27 +08:00
|
|
|
cert_id_md = (EVP_MD *)EVP_sha1();
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (!add_ocsp_cert(&req, cert, cert_id_md, issuer, ids))
|
|
|
|
goto end;
|
|
|
|
if (!sk_OPENSSL_STRING_push(reqnames, opt_arg()))
|
|
|
|
goto end;
|
2016-05-12 22:24:06 +08:00
|
|
|
trailing_md = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_SERIAL:
|
2021-08-24 18:03:12 +08:00
|
|
|
reset_unknown();
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (cert_id_md == NULL)
|
2021-02-18 05:15:27 +08:00
|
|
|
cert_id_md = (EVP_MD *)EVP_sha1();
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (!add_ocsp_serial(&req, opt_arg(), cert_id_md, issuer, ids))
|
|
|
|
goto end;
|
|
|
|
if (!sk_OPENSSL_STRING_push(reqnames, opt_arg()))
|
|
|
|
goto end;
|
2016-05-12 22:24:06 +08:00
|
|
|
trailing_md = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_INDEX:
|
|
|
|
ridx_filename = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_CA:
|
|
|
|
rca_filename = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_NMIN:
|
2021-04-21 19:08:21 +08:00
|
|
|
nmin = opt_int_arg();
|
2015-01-22 11:40:55 +08:00
|
|
|
if (ndays == -1)
|
|
|
|
ndays = 0;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_REQUEST:
|
2021-04-21 19:08:21 +08:00
|
|
|
accept_count = opt_int_arg();
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
|
|
|
case OPT_NDAYS:
|
|
|
|
ndays = atoi(opt_arg());
|
|
|
|
break;
|
|
|
|
case OPT_RSIGNER:
|
|
|
|
rsignfile = opt_arg();
|
|
|
|
break;
|
|
|
|
case OPT_RKEY:
|
|
|
|
rkeyfile = opt_arg();
|
|
|
|
break;
|
2019-12-26 12:20:46 +08:00
|
|
|
case OPT_PASSIN:
|
|
|
|
passinarg = opt_arg();
|
|
|
|
break;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
case OPT_ROTHER:
|
|
|
|
rcertfile = opt_arg();
|
|
|
|
break;
|
2016-03-21 04:14:10 +08:00
|
|
|
case OPT_RMD: /* Response MessageDigest */
|
2021-02-09 03:03:35 +08:00
|
|
|
respdigname = opt_arg();
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
2018-01-24 03:22:17 +08:00
|
|
|
case OPT_RSIGOPT:
|
2017-08-18 21:27:19 +08:00
|
|
|
if (rsign_sigopts == NULL)
|
|
|
|
rsign_sigopts = sk_OPENSSL_STRING_new_null();
|
2021-03-31 13:10:22 +08:00
|
|
|
if (rsign_sigopts == NULL
|
|
|
|
|| !sk_OPENSSL_STRING_push(rsign_sigopts, opt_arg()))
|
2017-08-18 21:27:19 +08:00
|
|
|
goto end;
|
|
|
|
break;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
case OPT_HEADER:
|
|
|
|
header = opt_arg();
|
|
|
|
value = strchr(header, '=');
|
|
|
|
if (value == NULL) {
|
|
|
|
BIO_printf(bio_err, "Missing = in header key=value\n");
|
|
|
|
goto opthelp;
|
|
|
|
}
|
|
|
|
*value++ = '\0';
|
|
|
|
if (!X509V3_add_value(header, value, &headers))
|
|
|
|
goto end;
|
|
|
|
break;
|
2017-04-20 03:35:16 +08:00
|
|
|
case OPT_RCID:
|
2021-02-18 05:15:27 +08:00
|
|
|
if (!opt_md(opt_arg(), &resp_certid_md))
|
2017-04-20 03:35:16 +08:00
|
|
|
goto opthelp;
|
|
|
|
break;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
case OPT_MD:
|
2016-05-12 22:24:06 +08:00
|
|
|
if (trailing_md) {
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
BIO_printf(bio_err,
|
|
|
|
"%s: Digest must be before -cert or -serial\n",
|
|
|
|
prog);
|
|
|
|
goto opthelp;
|
|
|
|
}
|
|
|
|
if (!opt_md(opt_unknown(), &cert_id_md))
|
|
|
|
goto opthelp;
|
2016-05-12 22:24:06 +08:00
|
|
|
trailing_md = 1;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
break;
|
2018-03-06 04:18:04 +08:00
|
|
|
case OPT_MULTI:
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifdef HTTP_DAEMON
|
2022-05-29 00:50:18 +08:00
|
|
|
n_responders = atoi(opt_arg());
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2018-03-08 23:51:46 +08:00
|
|
|
break;
|
2020-02-25 12:29:30 +08:00
|
|
|
case OPT_PROV_CASES:
|
|
|
|
if (!opt_provider(o))
|
|
|
|
goto end;
|
|
|
|
break;
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
|
|
|
}
|
2020-11-29 05:12:58 +08:00
|
|
|
|
|
|
|
/* No extra arguments. */
|
2021-08-27 21:33:18 +08:00
|
|
|
if (!opt_check_rest_arg(NULL))
|
2020-11-29 05:12:58 +08:00
|
|
|
goto opthelp;
|
|
|
|
|
2016-05-12 22:24:06 +08:00
|
|
|
if (trailing_md) {
|
|
|
|
BIO_printf(bio_err, "%s: Digest must be before -cert or -serial\n",
|
|
|
|
prog);
|
|
|
|
goto opthelp;
|
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2021-02-09 03:03:35 +08:00
|
|
|
if (respdigname != NULL) {
|
|
|
|
if (!opt_md(respdigname, &rsign_md))
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
/* Have we anything to do? */
|
2018-03-06 04:18:04 +08:00
|
|
|
if (req == NULL && reqin == NULL
|
2017-06-13 01:24:02 +08:00
|
|
|
&& respin == NULL && !(port != NULL && ridx_filename != NULL))
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
goto opthelp;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2015-09-04 18:49:06 +08:00
|
|
|
out = bio_open_default(outfile, 'w', FORMAT_TEXT);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (out == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req == NULL && (add_nonce != 2))
|
2015-01-22 11:40:55 +08:00
|
|
|
add_nonce = 0;
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req == NULL && reqin != NULL) {
|
2015-09-04 18:49:06 +08:00
|
|
|
derbio = bio_open_default(reqin, 'r', FORMAT_ASN1);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (derbio == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
req = d2i_OCSP_REQUEST_bio(derbio, NULL);
|
|
|
|
BIO_free(derbio);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error reading OCSP request\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req == NULL && port != NULL) {
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-07-13 16:20:38 +08:00
|
|
|
acbio = http_server_init(prog, port, -1);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (acbio == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
2020-05-05 02:29:25 +08:00
|
|
|
#else
|
|
|
|
BIO_printf(bio_err, "Cannot act as server - sockets not supported\n");
|
|
|
|
goto end;
|
|
|
|
#endif
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (rsignfile != NULL) {
|
|
|
|
if (rkeyfile == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
rkeyfile = rsignfile;
|
2021-04-30 22:57:53 +08:00
|
|
|
rsigner = load_cert(rsignfile, FORMAT_UNDEF, "responder certificate");
|
2017-06-13 01:24:02 +08:00
|
|
|
if (rsigner == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error loading responder certificate\n");
|
|
|
|
goto end;
|
|
|
|
}
|
2021-03-06 04:05:35 +08:00
|
|
|
if (!load_certs(rca_filename, 0, &rca_cert, NULL, "CA certificates"))
|
2015-04-01 05:06:21 +08:00
|
|
|
goto end;
|
2017-06-13 01:24:02 +08:00
|
|
|
if (rcertfile != NULL) {
|
2021-03-06 04:05:35 +08:00
|
|
|
if (!load_certs(rcertfile, 0, &rother, NULL,
|
2016-01-16 13:08:38 +08:00
|
|
|
"responder other certificates"))
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
}
|
2019-12-26 12:20:46 +08:00
|
|
|
if (!app_passwd(passinarg, NULL, &passin, NULL)) {
|
|
|
|
BIO_printf(bio_err, "Error getting password\n");
|
|
|
|
goto end;
|
|
|
|
}
|
2021-04-30 22:57:53 +08:00
|
|
|
rkey = load_key(rkeyfile, FORMAT_UNDEF, 0, passin, NULL,
|
2015-01-22 11:40:55 +08:00
|
|
|
"responder private key");
|
2017-06-13 01:24:02 +08:00
|
|
|
if (rkey == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
}
|
2018-03-06 03:40:02 +08:00
|
|
|
|
2018-03-06 04:18:04 +08:00
|
|
|
if (ridx_filename != NULL
|
2018-03-20 19:16:39 +08:00
|
|
|
&& (rkey == NULL || rsigner == NULL || rca_cert == NULL)) {
|
2018-03-06 03:40:02 +08:00
|
|
|
BIO_printf(bio_err,
|
|
|
|
"Responder mode requires certificate, key, and CA.\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2018-03-06 04:18:04 +08:00
|
|
|
if (ridx_filename != NULL) {
|
2018-03-06 03:40:02 +08:00
|
|
|
rdb = load_index(ridx_filename, NULL);
|
2018-04-19 07:52:26 +08:00
|
|
|
if (rdb == NULL || index_index(rdb) <= 0) {
|
2020-01-13 09:05:22 +08:00
|
|
|
BIO_printf(bio_err,
|
|
|
|
"Problem with index file: %s (could not load/parse file)\n",
|
|
|
|
ridx_filename);
|
2018-03-06 03:40:02 +08:00
|
|
|
ret = 1;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifdef HTTP_DAEMON
|
2022-05-29 00:50:18 +08:00
|
|
|
if (n_responders != 0 && acbio != NULL)
|
2020-05-05 02:29:25 +08:00
|
|
|
spawn_loop(prog);
|
2018-03-06 04:18:04 +08:00
|
|
|
if (acbio != NULL && req_timeout > 0)
|
2019-11-25 20:27:33 +08:00
|
|
|
signal(SIGALRM, socket_timeout);
|
2018-03-06 04:18:04 +08:00
|
|
|
#endif
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (acbio != NULL)
|
2022-05-29 00:44:02 +08:00
|
|
|
trace_log_message(-1, prog,
|
|
|
|
LOG_INFO, "waiting for OCSP client connections...");
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
redo_accept:
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (acbio != NULL) {
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifdef HTTP_DAEMON
|
2018-03-06 04:18:04 +08:00
|
|
|
if (index_changed(rdb)) {
|
|
|
|
CA_DB *newrdb = load_index(ridx_filename, NULL);
|
|
|
|
|
2018-04-19 07:52:26 +08:00
|
|
|
if (newrdb != NULL && index_index(newrdb) > 0) {
|
2018-03-06 04:18:04 +08:00
|
|
|
free_index(rdb);
|
|
|
|
rdb = newrdb;
|
|
|
|
} else {
|
2018-04-19 07:52:26 +08:00
|
|
|
free_index(newrdb);
|
2022-05-29 00:44:02 +08:00
|
|
|
trace_log_message(-1, prog,
|
|
|
|
LOG_ERR, "error reloading updated index: %s",
|
|
|
|
ridx_filename);
|
2018-03-06 04:18:04 +08:00
|
|
|
}
|
|
|
|
}
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2018-03-06 04:18:04 +08:00
|
|
|
|
|
|
|
req = NULL;
|
2021-07-13 16:20:38 +08:00
|
|
|
res = do_responder(&req, &cbio, acbio, req_timeout);
|
2020-05-25 23:32:26 +08:00
|
|
|
if (res == 0)
|
2018-03-06 04:18:04 +08:00
|
|
|
goto redo_accept;
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req == NULL) {
|
2020-05-25 23:32:26 +08:00
|
|
|
if (res == 1) {
|
|
|
|
resp =
|
|
|
|
OCSP_response_create(OCSP_RESPONSE_STATUS_MALFORMEDREQUEST,
|
|
|
|
NULL);
|
|
|
|
send_ocsp_response(cbio, resp);
|
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
goto done_resp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req == NULL
|
|
|
|
&& (signfile != NULL || reqout != NULL
|
|
|
|
|| host != NULL || add_nonce || ridx_filename != NULL)) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Need an OCSP request for this operation!\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2019-02-22 21:58:55 +08:00
|
|
|
if (req != NULL && add_nonce) {
|
|
|
|
if (!OCSP_request_add1_nonce(req, NULL, -1))
|
|
|
|
goto end;
|
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (signfile != NULL) {
|
|
|
|
if (keyfile == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
keyfile = signfile;
|
2021-04-30 22:57:53 +08:00
|
|
|
signer = load_cert(signfile, FORMAT_UNDEF, "signer certificate");
|
2017-06-13 01:24:02 +08:00
|
|
|
if (signer == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error loading signer certificate\n");
|
|
|
|
goto end;
|
|
|
|
}
|
2017-06-13 01:24:02 +08:00
|
|
|
if (sign_certfile != NULL) {
|
2021-03-06 04:05:35 +08:00
|
|
|
if (!load_certs(sign_certfile, 0, &sign_other, NULL,
|
2016-01-16 13:08:38 +08:00
|
|
|
"signer certificates"))
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
}
|
2021-04-30 22:57:53 +08:00
|
|
|
key = load_key(keyfile, FORMAT_UNDEF, 0, NULL, NULL,
|
2015-01-22 11:40:55 +08:00
|
|
|
"signer private key");
|
2017-06-13 01:24:02 +08:00
|
|
|
if (key == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
|
2021-03-31 13:10:22 +08:00
|
|
|
if (!OCSP_request_sign(req, signer, key, NULL,
|
|
|
|
sign_other, sign_flags)) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error signing OCSP request\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req_text && req != NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_REQUEST_print(out, req, 0);
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (reqout != NULL) {
|
2015-09-04 18:49:06 +08:00
|
|
|
derbio = bio_open_default(reqout, 'w', FORMAT_ASN1);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (derbio == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
i2d_OCSP_REQUEST_bio(derbio, req);
|
|
|
|
BIO_free(derbio);
|
|
|
|
}
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (rdb != NULL) {
|
2017-08-18 21:27:19 +08:00
|
|
|
make_ocsp_response(bio_err, &resp, req, rdb, rca_cert, rsigner, rkey,
|
2021-03-31 13:10:22 +08:00
|
|
|
rsign_md, rsign_sigopts, rother, rflags, nmin, ndays,
|
|
|
|
badsig, resp_certid_md);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (cbio != NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
send_ocsp_response(cbio, resp);
|
2017-06-13 01:24:02 +08:00
|
|
|
} else if (host != NULL) {
|
2020-03-05 05:52:22 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-05-12 19:58:52 +08:00
|
|
|
resp = process_responder(req, host, port, path, opt_proxy, opt_no_proxy,
|
|
|
|
use_ssl, headers, req_timeout);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (resp == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
2020-03-05 05:52:22 +08:00
|
|
|
#else
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err,
|
2020-05-05 02:29:25 +08:00
|
|
|
"Error creating connect BIO - sockets not supported\n");
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2017-06-13 01:24:02 +08:00
|
|
|
} else if (respin != NULL) {
|
2015-09-04 18:49:06 +08:00
|
|
|
derbio = bio_open_default(respin, 'r', FORMAT_ASN1);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (derbio == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
resp = d2i_OCSP_RESPONSE_bio(derbio, NULL);
|
|
|
|
BIO_free(derbio);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (resp == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error reading OCSP response\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ret = 0;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
done_resp:
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (respout != NULL) {
|
2015-09-04 18:49:06 +08:00
|
|
|
derbio = bio_open_default(respout, 'w', FORMAT_ASN1);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (derbio == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
i2d_OCSP_RESPONSE_bio(derbio, resp);
|
|
|
|
BIO_free(derbio);
|
|
|
|
}
|
|
|
|
|
|
|
|
i = OCSP_response_status(resp);
|
|
|
|
if (i != OCSP_RESPONSE_STATUS_SUCCESSFUL) {
|
|
|
|
BIO_printf(out, "Responder Error: %s (%d)\n",
|
|
|
|
OCSP_response_status_str(i), i);
|
2018-04-18 18:07:18 +08:00
|
|
|
if (!ignore_err)
|
2018-03-06 04:18:04 +08:00
|
|
|
goto end;
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (resp_text)
|
|
|
|
OCSP_RESPONSE_print(out, resp, 0);
|
|
|
|
|
|
|
|
/* If running as responder don't verify our own response */
|
2017-06-13 01:24:02 +08:00
|
|
|
if (cbio != NULL) {
|
2015-07-30 09:38:22 +08:00
|
|
|
/* If not unlimited, see if we took all we should. */
|
|
|
|
if (accept_count != -1 && --accept_count <= 0) {
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
ret = 0;
|
|
|
|
goto end;
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
BIO_free_all(cbio);
|
|
|
|
cbio = NULL;
|
|
|
|
OCSP_REQUEST_free(req);
|
|
|
|
req = NULL;
|
|
|
|
OCSP_RESPONSE_free(resp);
|
|
|
|
resp = NULL;
|
|
|
|
goto redo_accept;
|
|
|
|
}
|
2017-06-13 01:24:02 +08:00
|
|
|
if (ridx_filename != NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
ret = 0;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (store == NULL) {
|
2019-03-07 22:26:34 +08:00
|
|
|
store = setup_verify(CAfile, noCAfile, CApath, noCApath,
|
|
|
|
CAstore, noCAstore);
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
if (!store)
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
if (vpmtouched)
|
2015-01-22 11:40:55 +08:00
|
|
|
X509_STORE_set1_param(store, vpm);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (verify_certfile != NULL) {
|
2021-03-06 04:05:35 +08:00
|
|
|
if (!load_certs(verify_certfile, 0, &verify_other, NULL,
|
2020-08-15 03:58:34 +08:00
|
|
|
"validator certificates"))
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
bs = OCSP_response_get1_basic(resp);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (bs == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error parsing response\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = 0;
|
|
|
|
|
|
|
|
if (!noverify) {
|
2017-06-13 01:24:02 +08:00
|
|
|
if (req != NULL && ((i = OCSP_check_nonce(req, bs)) <= 0)) {
|
2015-01-22 11:40:55 +08:00
|
|
|
if (i == -1)
|
|
|
|
BIO_printf(bio_err, "WARNING: no nonce in response\n");
|
|
|
|
else {
|
|
|
|
BIO_printf(bio_err, "Nonce Verify error\n");
|
|
|
|
ret = 1;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
i = OCSP_basic_verify(bs, verify_other, store, verify_flags);
|
2015-04-26 04:04:42 +08:00
|
|
|
if (i <= 0 && issuers) {
|
|
|
|
i = OCSP_basic_verify(bs, issuers, store, OCSP_TRUSTOTHER);
|
|
|
|
if (i > 0)
|
|
|
|
ERR_clear_error();
|
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
if (i <= 0) {
|
|
|
|
BIO_printf(bio_err, "Response Verify Failure\n");
|
|
|
|
ERR_print_errors(bio_err);
|
|
|
|
ret = 1;
|
2017-06-13 01:24:02 +08:00
|
|
|
} else {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Response verify OK\n");
|
2017-06-13 01:24:02 +08:00
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
|
|
|
|
2020-09-18 22:43:00 +08:00
|
|
|
if (!print_ocsp_summary(out, bs, req, reqnames, ids, nsec, maxage))
|
|
|
|
ret = 1;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
|
|
|
end:
|
|
|
|
ERR_print_errors(bio_err);
|
|
|
|
X509_free(signer);
|
|
|
|
X509_STORE_free(store);
|
2015-05-01 05:33:59 +08:00
|
|
|
X509_VERIFY_PARAM_free(vpm);
|
2017-12-13 05:01:22 +08:00
|
|
|
sk_OPENSSL_STRING_free(rsign_sigopts);
|
2015-01-22 11:40:55 +08:00
|
|
|
EVP_PKEY_free(key);
|
|
|
|
EVP_PKEY_free(rkey);
|
2021-02-18 05:15:27 +08:00
|
|
|
EVP_MD_free(cert_id_md);
|
|
|
|
EVP_MD_free(rsign_md);
|
|
|
|
EVP_MD_free(resp_certid_md);
|
2015-01-22 11:40:55 +08:00
|
|
|
X509_free(cert);
|
2021-12-18 23:15:49 +08:00
|
|
|
OSSL_STACK_OF_X509_free(issuers);
|
2015-01-22 11:40:55 +08:00
|
|
|
X509_free(rsigner);
|
2021-12-18 23:15:49 +08:00
|
|
|
OSSL_STACK_OF_X509_free(rca_cert);
|
2015-01-22 11:40:55 +08:00
|
|
|
free_index(rdb);
|
|
|
|
BIO_free_all(cbio);
|
|
|
|
BIO_free_all(acbio);
|
2018-02-01 05:08:12 +08:00
|
|
|
BIO_free_all(out);
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_REQUEST_free(req);
|
|
|
|
OCSP_RESPONSE_free(resp);
|
|
|
|
OCSP_BASICRESP_free(bs);
|
|
|
|
sk_OPENSSL_STRING_free(reqnames);
|
|
|
|
sk_OCSP_CERTID_free(ids);
|
2021-12-18 23:15:49 +08:00
|
|
|
OSSL_STACK_OF_X509_free(sign_other);
|
|
|
|
OSSL_STACK_OF_X509_free(verify_other);
|
2015-01-22 11:40:55 +08:00
|
|
|
sk_CONF_VALUE_pop_free(headers, X509V3_conf_free);
|
2015-05-01 22:02:07 +08:00
|
|
|
OPENSSL_free(thost);
|
|
|
|
OPENSSL_free(tport);
|
|
|
|
OPENSSL_free(tpath);
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2017-10-17 22:04:09 +08:00
|
|
|
return ret;
|
2001-01-13 09:48:38 +08:00
|
|
|
}
|
|
|
|
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifdef HTTP_DAEMON
|
2018-03-06 04:18:04 +08:00
|
|
|
|
|
|
|
static int index_changed(CA_DB *rdb)
|
|
|
|
{
|
|
|
|
struct stat sb;
|
|
|
|
|
|
|
|
if (rdb != NULL && stat(rdb->dbfname, &sb) != -1) {
|
|
|
|
if (rdb->dbst.st_mtime != sb.st_mtime
|
|
|
|
|| rdb->dbst.st_ctime != sb.st_ctime
|
|
|
|
|| rdb->dbst.st_ino != sb.st_ino
|
|
|
|
|| rdb->dbst.st_dev != sb.st_dev) {
|
|
|
|
syslog(LOG_INFO, "index file changed, reloading");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2018-03-06 04:18:04 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert,
|
|
|
|
const EVP_MD *cert_id_md, X509 *issuer,
|
|
|
|
STACK_OF(OCSP_CERTID) *ids)
|
|
|
|
{
|
|
|
|
OCSP_CERTID *id;
|
2017-06-13 01:24:02 +08:00
|
|
|
|
|
|
|
if (issuer == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "No issuer certificate specified\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2015-10-30 19:18:04 +08:00
|
|
|
if (*req == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
*req = OCSP_REQUEST_new();
|
2015-10-30 19:18:04 +08:00
|
|
|
if (*req == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto err;
|
|
|
|
id = OCSP_cert_to_id(cert_id_md, cert, issuer);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (id == NULL || !sk_OCSP_CERTID_push(ids, id))
|
2015-01-22 11:40:55 +08:00
|
|
|
goto err;
|
|
|
|
if (!OCSP_request_add0_id(*req, id))
|
|
|
|
goto err;
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
err:
|
|
|
|
BIO_printf(bio_err, "Error Creating OCSP request\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,
|
|
|
|
const EVP_MD *cert_id_md, X509 *issuer,
|
|
|
|
STACK_OF(OCSP_CERTID) *ids)
|
|
|
|
{
|
|
|
|
OCSP_CERTID *id;
|
2020-03-23 15:30:37 +08:00
|
|
|
const X509_NAME *iname;
|
2015-01-22 11:40:55 +08:00
|
|
|
ASN1_BIT_STRING *ikey;
|
|
|
|
ASN1_INTEGER *sno;
|
2017-06-13 01:24:02 +08:00
|
|
|
|
|
|
|
if (issuer == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "No issuer certificate specified\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2015-10-30 19:18:04 +08:00
|
|
|
if (*req == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
*req = OCSP_REQUEST_new();
|
2015-10-30 19:18:04 +08:00
|
|
|
if (*req == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
goto err;
|
|
|
|
iname = X509_get_subject_name(issuer);
|
|
|
|
ikey = X509_get0_pubkey_bitstr(issuer);
|
|
|
|
sno = s2i_ASN1_INTEGER(NULL, serial);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (sno == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error converting serial number %s\n", serial);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
id = OCSP_cert_id_new(cert_id_md, iname, ikey, sno);
|
|
|
|
ASN1_INTEGER_free(sno);
|
2015-10-30 19:18:04 +08:00
|
|
|
if (id == NULL || !sk_OCSP_CERTID_push(ids, id))
|
2015-01-22 11:40:55 +08:00
|
|
|
goto err;
|
|
|
|
if (!OCSP_request_add0_id(*req, id))
|
|
|
|
goto err;
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
err:
|
|
|
|
BIO_printf(bio_err, "Error Creating OCSP request\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2001-01-19 09:32:23 +08:00
|
|
|
|
2020-09-18 22:43:00 +08:00
|
|
|
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
2015-01-22 11:40:55 +08:00
|
|
|
STACK_OF(OPENSSL_STRING) *names,
|
|
|
|
STACK_OF(OCSP_CERTID) *ids, long nsec,
|
|
|
|
long maxage)
|
|
|
|
{
|
|
|
|
OCSP_CERTID *id;
|
2016-08-05 05:52:22 +08:00
|
|
|
const char *name;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
int i, status, reason;
|
2015-01-22 11:40:55 +08:00
|
|
|
ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;
|
2020-09-18 22:43:00 +08:00
|
|
|
int ret = 1;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2020-09-18 22:43:00 +08:00
|
|
|
if (req == NULL || !sk_OPENSSL_STRING_num(names))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
if (bs == NULL || !sk_OCSP_CERTID_num(ids))
|
|
|
|
return 0;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
|
|
|
for (i = 0; i < sk_OCSP_CERTID_num(ids); i++) {
|
|
|
|
id = sk_OCSP_CERTID_value(ids, i);
|
|
|
|
name = sk_OPENSSL_STRING_value(names, i);
|
|
|
|
BIO_printf(out, "%s: ", name);
|
|
|
|
|
|
|
|
if (!OCSP_resp_find_status(bs, id, &status, &reason,
|
|
|
|
&rev, &thisupd, &nextupd)) {
|
|
|
|
BIO_puts(out, "ERROR: No Status found.\n");
|
2020-09-18 22:43:00 +08:00
|
|
|
ret = 0;
|
2015-01-22 11:40:55 +08:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check validity: if invalid write to output BIO so we know which
|
|
|
|
* response this refers to.
|
|
|
|
*/
|
|
|
|
if (!OCSP_check_validity(thisupd, nextupd, nsec, maxage)) {
|
|
|
|
BIO_puts(out, "WARNING: Status times invalid.\n");
|
|
|
|
ERR_print_errors(out);
|
|
|
|
}
|
|
|
|
BIO_printf(out, "%s\n", OCSP_cert_status_str(status));
|
|
|
|
|
|
|
|
BIO_puts(out, "\tThis Update: ");
|
|
|
|
ASN1_GENERALIZEDTIME_print(out, thisupd);
|
|
|
|
BIO_puts(out, "\n");
|
|
|
|
|
|
|
|
if (nextupd) {
|
|
|
|
BIO_puts(out, "\tNext Update: ");
|
|
|
|
ASN1_GENERALIZEDTIME_print(out, nextupd);
|
|
|
|
BIO_puts(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (status != V_OCSP_CERTSTATUS_REVOKED)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (reason != -1)
|
|
|
|
BIO_printf(out, "\tReason: %s\n", OCSP_crl_reason_str(reason));
|
|
|
|
|
|
|
|
BIO_puts(out, "\tRevocation Time: ");
|
|
|
|
ASN1_GENERALIZEDTIME_print(out, rev);
|
|
|
|
BIO_puts(out, "\n");
|
|
|
|
}
|
2020-09-18 22:43:00 +08:00
|
|
|
return ret;
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
|
|
|
|
2017-08-18 21:27:19 +08:00
|
|
|
static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req,
|
2015-04-01 05:06:21 +08:00
|
|
|
CA_DB *db, STACK_OF(X509) *ca, X509 *rcert,
|
2015-01-22 11:40:55 +08:00
|
|
|
EVP_PKEY *rkey, const EVP_MD *rmd,
|
2017-08-18 21:27:19 +08:00
|
|
|
STACK_OF(OPENSSL_STRING) *sigopts,
|
2015-01-22 11:40:55 +08:00
|
|
|
STACK_OF(X509) *rother, unsigned long flags,
|
2017-04-20 03:35:16 +08:00
|
|
|
int nmin, int ndays, int badsig,
|
|
|
|
const EVP_MD *resp_md)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
|
|
|
ASN1_TIME *thisupd = NULL, *nextupd = NULL;
|
2015-04-01 05:06:21 +08:00
|
|
|
OCSP_CERTID *cid;
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_BASICRESP *bs = NULL;
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
int i, id_count;
|
2017-08-18 21:27:19 +08:00
|
|
|
EVP_MD_CTX *mctx = NULL;
|
|
|
|
EVP_PKEY_CTX *pkctx = NULL;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
|
|
|
id_count = OCSP_request_onereq_count(req);
|
|
|
|
|
|
|
|
if (id_count <= 0) {
|
|
|
|
*resp =
|
|
|
|
OCSP_response_create(OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, NULL);
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
bs = OCSP_BASICRESP_new();
|
|
|
|
thisupd = X509_gmtime_adj(NULL, 0);
|
|
|
|
if (ndays != -1)
|
2016-01-14 08:25:25 +08:00
|
|
|
nextupd = X509_time_adj_ex(NULL, ndays, nmin * 60, NULL);
|
2015-01-22 11:40:55 +08:00
|
|
|
|
|
|
|
/* Examine each certificate id in the request */
|
|
|
|
for (i = 0; i < id_count; i++) {
|
|
|
|
OCSP_ONEREQ *one;
|
|
|
|
ASN1_INTEGER *serial;
|
|
|
|
char **inf;
|
2015-04-01 05:06:21 +08:00
|
|
|
int jj;
|
|
|
|
int found = 0;
|
2015-01-22 11:40:55 +08:00
|
|
|
ASN1_OBJECT *cert_id_md_oid;
|
|
|
|
const EVP_MD *cert_id_md;
|
2017-04-20 03:35:16 +08:00
|
|
|
OCSP_CERTID *cid_resp_md = NULL;
|
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
one = OCSP_request_onereq_get0(req, i);
|
|
|
|
cid = OCSP_onereq_get0_id(one);
|
|
|
|
|
|
|
|
OCSP_id_get0_info(NULL, &cert_id_md_oid, NULL, NULL, cid);
|
|
|
|
|
|
|
|
cert_id_md = EVP_get_digestbyobj(cert_id_md_oid);
|
2017-06-13 01:24:02 +08:00
|
|
|
if (cert_id_md == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
|
|
|
|
NULL);
|
|
|
|
goto end;
|
|
|
|
}
|
2015-04-01 05:06:21 +08:00
|
|
|
for (jj = 0; jj < sk_X509_num(ca) && !found; jj++) {
|
|
|
|
X509 *ca_cert = sk_X509_value(ca, jj);
|
|
|
|
OCSP_CERTID *ca_id = OCSP_cert_to_id(cert_id_md, NULL, ca_cert);
|
|
|
|
|
2017-04-20 03:35:16 +08:00
|
|
|
if (OCSP_id_issuer_cmp(ca_id, cid) == 0) {
|
2015-04-01 05:06:21 +08:00
|
|
|
found = 1;
|
2017-04-20 03:35:16 +08:00
|
|
|
if (resp_md != NULL)
|
|
|
|
cid_resp_md = OCSP_cert_to_id(resp_md, NULL, ca_cert);
|
|
|
|
}
|
2015-04-01 05:06:21 +08:00
|
|
|
OCSP_CERTID_free(ca_id);
|
|
|
|
}
|
2017-04-20 03:35:16 +08:00
|
|
|
OCSP_id_get0_info(NULL, NULL, NULL, &serial, cid);
|
|
|
|
inf = lookup_serial(db, serial);
|
|
|
|
|
|
|
|
/* at this point, we can have cid be an alias of cid_resp_md */
|
|
|
|
cid = (cid_resp_md != NULL) ? cid_resp_md : cid;
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2015-04-01 05:06:21 +08:00
|
|
|
if (!found) {
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_basic_add1_status(bs, cid,
|
|
|
|
V_OCSP_CERTSTATUS_UNKNOWN,
|
|
|
|
0, NULL, thisupd, nextupd);
|
|
|
|
continue;
|
|
|
|
}
|
2017-06-13 01:24:02 +08:00
|
|
|
if (inf == NULL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_basic_add1_status(bs, cid,
|
|
|
|
V_OCSP_CERTSTATUS_UNKNOWN,
|
|
|
|
0, NULL, thisupd, nextupd);
|
2017-06-13 01:24:02 +08:00
|
|
|
} else if (inf[DB_type][0] == DB_TYPE_VAL) {
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_basic_add1_status(bs, cid,
|
|
|
|
V_OCSP_CERTSTATUS_GOOD,
|
|
|
|
0, NULL, thisupd, nextupd);
|
2017-06-13 01:24:02 +08:00
|
|
|
} else if (inf[DB_type][0] == DB_TYPE_REV) {
|
2015-01-22 11:40:55 +08:00
|
|
|
ASN1_OBJECT *inst = NULL;
|
|
|
|
ASN1_TIME *revtm = NULL;
|
|
|
|
ASN1_GENERALIZEDTIME *invtm = NULL;
|
|
|
|
OCSP_SINGLERESP *single;
|
|
|
|
int reason = -1;
|
2017-04-20 03:35:16 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
unpack_revinfo(&revtm, &reason, &inst, &invtm, inf[DB_rev_date]);
|
|
|
|
single = OCSP_basic_add1_status(bs, cid,
|
|
|
|
V_OCSP_CERTSTATUS_REVOKED,
|
|
|
|
reason, revtm, thisupd, nextupd);
|
2022-04-12 00:25:26 +08:00
|
|
|
if (single == NULL) {
|
|
|
|
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
|
|
|
|
NULL);
|
|
|
|
goto end;
|
|
|
|
}
|
2017-06-13 01:24:02 +08:00
|
|
|
if (invtm != NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_SINGLERESP_add1_ext_i2d(single, NID_invalidity_date,
|
|
|
|
invtm, 0, 0);
|
2017-06-13 01:24:02 +08:00
|
|
|
else if (inst != NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
OCSP_SINGLERESP_add1_ext_i2d(single,
|
|
|
|
NID_hold_instruction_code, inst,
|
|
|
|
0, 0);
|
|
|
|
ASN1_OBJECT_free(inst);
|
|
|
|
ASN1_TIME_free(revtm);
|
|
|
|
ASN1_GENERALIZEDTIME_free(invtm);
|
|
|
|
}
|
2017-04-20 03:35:16 +08:00
|
|
|
OCSP_CERTID_free(cid_resp_md);
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OCSP_copy_nonce(bs, req);
|
|
|
|
|
2017-08-18 21:27:19 +08:00
|
|
|
mctx = EVP_MD_CTX_new();
|
2021-10-26 15:16:18 +08:00
|
|
|
if (mctx == NULL || !EVP_DigestSignInit(mctx, &pkctx, rmd, NULL, rkey)) {
|
2017-08-18 21:27:19 +08:00
|
|
|
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR, NULL);
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) {
|
|
|
|
char *sigopt = sk_OPENSSL_STRING_value(sigopts, i);
|
2017-12-13 05:01:22 +08:00
|
|
|
|
2017-08-18 21:27:19 +08:00
|
|
|
if (pkey_ctrl_string(pkctx, sigopt) <= 0) {
|
|
|
|
BIO_printf(err, "parameter error \"%s\"\n", sigopt);
|
|
|
|
ERR_print_errors(bio_err);
|
|
|
|
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
|
|
|
|
NULL);
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2019-02-22 21:58:55 +08:00
|
|
|
if (!OCSP_basic_sign_ctx(bs, rcert, mctx, rother, flags)) {
|
|
|
|
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR, bs);
|
|
|
|
goto end;
|
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
|
2015-03-05 21:41:11 +08:00
|
|
|
if (badsig) {
|
2016-08-17 19:34:22 +08:00
|
|
|
const ASN1_OCTET_STRING *sig = OCSP_resp_get0_signature(bs);
|
|
|
|
corrupt_signature(sig);
|
2015-03-05 21:41:11 +08:00
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
|
|
|
|
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs);
|
|
|
|
|
|
|
|
end:
|
2017-12-13 05:01:22 +08:00
|
|
|
EVP_MD_CTX_free(mctx);
|
2015-01-22 11:40:55 +08:00
|
|
|
ASN1_TIME_free(thisupd);
|
|
|
|
ASN1_TIME_free(nextupd);
|
|
|
|
OCSP_BASICRESP_free(bs);
|
|
|
|
}
|
2001-07-13 04:41:51 +08:00
|
|
|
|
2003-04-04 00:33:03 +08:00
|
|
|
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
BIGNUM *bn = NULL;
|
|
|
|
char *itmp, *row[DB_NUMBER], **rrow;
|
|
|
|
for (i = 0; i < DB_NUMBER; i++)
|
|
|
|
row[i] = NULL;
|
|
|
|
bn = ASN1_INTEGER_to_BN(ser, NULL);
|
|
|
|
OPENSSL_assert(bn); /* FIXME: should report an error at this
|
|
|
|
* point and abort */
|
2022-02-10 15:41:40 +08:00
|
|
|
if (BN_is_zero(bn)) {
|
Rename some BUF_xxx to OPENSSL_xxx
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen}
to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen}
Add #define's for the old names.
Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-17 05:12:24 +08:00
|
|
|
itmp = OPENSSL_strdup("00");
|
2022-02-10 15:41:40 +08:00
|
|
|
OPENSSL_assert(itmp);
|
|
|
|
} else {
|
2015-01-22 11:40:55 +08:00
|
|
|
itmp = BN_bn2hex(bn);
|
2022-02-10 15:41:40 +08:00
|
|
|
}
|
2015-01-22 11:40:55 +08:00
|
|
|
row[DB_serial] = itmp;
|
|
|
|
BN_free(bn);
|
|
|
|
rrow = TXT_DB_get_by_index(db->db, DB_serial, row);
|
|
|
|
OPENSSL_free(itmp);
|
|
|
|
return rrow;
|
|
|
|
}
|
2001-07-13 04:41:51 +08:00
|
|
|
|
2018-03-06 04:18:04 +08:00
|
|
|
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio,
|
2021-07-13 16:20:38 +08:00
|
|
|
int timeout)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-04-21 02:14:00 +08:00
|
|
|
return http_server_get_asn1_req(ASN1_ITEM_rptr(OCSP_REQUEST),
|
2020-05-25 23:32:26 +08:00
|
|
|
(ASN1_VALUE **)preq, NULL, pcbio, acbio,
|
HTTP: Implement persistent connections (keep-alive)
Both at API and at CLI level (for the CMP app only, so far)
there is a new parameter/option: keep_alive.
* 0 means HTTP connections are not kept open after
receiving a response, which is the default behavior for HTTP 1.0.
* 1 means that persistent connections are requested.
* 2 means that persistent connections are required, i.e.,
in case the server does not grant them an error occurs.
For the CMP app the default value is 1, which means preferring to keep
the connection open. For all other internal uses of the HTTP client
(fetching an OCSP response, a cert, or a CRL) it does not matter
because these operations just take one round trip.
If the client application requested or required a persistent connection
and this was granted by the server, it can keep the OSSL_HTTP_REQ_CTX *
as long as it wants to send further requests and OSSL_HTTP_is_alive()
returns nonzero,
else it should call OSSL_HTTP_REQ_CTX_free() or OSSL_HTTP_close().
In case the client application keeps the OSSL_HTTP_REQ_CTX *
but the connection then dies for any reason at the server side, it will
notice this obtaining an I/O error when trying to send the next request.
This requires extending the HTTP header parsing and
rearranging the high-level HTTP client API. In particular:
* Split the monolithic OSSL_HTTP_transfer() into OSSL_HTTP_open(),
OSSL_HTTP_set_request(), a lean OSSL_HTTP_transfer(), and OSSL_HTTP_close().
* Split the timeout functionality accordingly and improve default behavior.
* Extract part of OSSL_HTTP_REQ_CTX_new() to OSSL_HTTP_REQ_CTX_set_expected().
* Extend struct ossl_http_req_ctx_st accordingly.
Use the new feature for the CMP client, which requires extending
related transaction management of CMP client and test server.
Update the documentation and extend the tests accordingly.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15053)
2021-04-28 06:26:14 +08:00
|
|
|
NULL /* found_keep_alive */,
|
2021-07-13 16:20:38 +08:00
|
|
|
prog, 1 /* accept_get */, timeout);
|
2020-03-05 05:52:22 +08:00
|
|
|
#else
|
2020-05-05 02:29:25 +08:00
|
|
|
BIO_printf(bio_err,
|
|
|
|
"Error getting OCSP request - sockets not supported\n");
|
2018-03-06 04:18:04 +08:00
|
|
|
*preq = NULL;
|
2020-05-05 02:29:25 +08:00
|
|
|
return 0;
|
2020-03-05 05:52:22 +08:00
|
|
|
#endif
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
2001-07-13 04:41:51 +08:00
|
|
|
|
2020-05-05 02:29:25 +08:00
|
|
|
static int send_ocsp_response(BIO *cbio, const OCSP_RESPONSE *resp)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
2020-05-05 02:29:25 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2022-05-29 00:44:02 +08:00
|
|
|
return http_server_send_asn1_resp(prog, cbio,
|
HTTP: Implement persistent connections (keep-alive)
Both at API and at CLI level (for the CMP app only, so far)
there is a new parameter/option: keep_alive.
* 0 means HTTP connections are not kept open after
receiving a response, which is the default behavior for HTTP 1.0.
* 1 means that persistent connections are requested.
* 2 means that persistent connections are required, i.e.,
in case the server does not grant them an error occurs.
For the CMP app the default value is 1, which means preferring to keep
the connection open. For all other internal uses of the HTTP client
(fetching an OCSP response, a cert, or a CRL) it does not matter
because these operations just take one round trip.
If the client application requested or required a persistent connection
and this was granted by the server, it can keep the OSSL_HTTP_REQ_CTX *
as long as it wants to send further requests and OSSL_HTTP_is_alive()
returns nonzero,
else it should call OSSL_HTTP_REQ_CTX_free() or OSSL_HTTP_close().
In case the client application keeps the OSSL_HTTP_REQ_CTX *
but the connection then dies for any reason at the server side, it will
notice this obtaining an I/O error when trying to send the next request.
This requires extending the HTTP header parsing and
rearranging the high-level HTTP client API. In particular:
* Split the monolithic OSSL_HTTP_transfer() into OSSL_HTTP_open(),
OSSL_HTTP_set_request(), a lean OSSL_HTTP_transfer(), and OSSL_HTTP_close().
* Split the timeout functionality accordingly and improve default behavior.
* Extract part of OSSL_HTTP_REQ_CTX_new() to OSSL_HTTP_REQ_CTX_set_expected().
* Extend struct ossl_http_req_ctx_st accordingly.
Use the new feature for the CMP client, which requires extending
related transaction management of CMP client and test server.
Update the documentation and extend the tests accordingly.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15053)
2021-04-28 06:26:14 +08:00
|
|
|
0 /* no keep-alive */,
|
|
|
|
"application/ocsp-response",
|
2020-05-05 02:29:25 +08:00
|
|
|
ASN1_ITEM_rptr(OCSP_RESPONSE),
|
|
|
|
(const ASN1_VALUE *)resp);
|
|
|
|
#else
|
|
|
|
BIO_printf(bio_err,
|
|
|
|
"Error sending OCSP response - sockets not supported\n");
|
|
|
|
return 0;
|
|
|
|
#endif
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
2001-07-13 04:41:51 +08:00
|
|
|
|
2020-03-05 05:52:22 +08:00
|
|
|
#ifndef OPENSSL_NO_SOCK
|
2021-05-12 19:58:52 +08:00
|
|
|
OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, const char *host,
|
|
|
|
const char *port, const char *path,
|
|
|
|
const char *proxy, const char *no_proxy,
|
|
|
|
int use_ssl, STACK_OF(CONF_VALUE) *headers,
|
2015-01-22 11:40:55 +08:00
|
|
|
int req_timeout)
|
|
|
|
{
|
|
|
|
SSL_CTX *ctx = NULL;
|
|
|
|
OCSP_RESPONSE *resp = NULL;
|
2015-08-04 19:23:00 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
if (use_ssl == 1) {
|
2015-03-31 07:18:31 +08:00
|
|
|
ctx = SSL_CTX_new(TLS_client_method());
|
2015-01-22 11:40:55 +08:00
|
|
|
if (ctx == NULL) {
|
Big apps cleanup (option-parsing, etc)
This is merges the old "rsalz-monolith" branch over to master. The biggest
change is that option parsing switch from cascasding 'else if strcmp("-foo")'
to a utility routine and somethin akin to getopt. Also, an error in the
command line no longer prints the full summary; use -help (or --help :)
for that. There have been many other changes and code-cleanup, see
bullet list below.
Special thanks to Matt for the long and detailed code review.
TEMPORARY:
For now, comment out CRYPTO_mem_leaks() at end of main
Tickets closed:
RT3515: Use 3DES in pkcs12 if built with no-rc2
RT1766: s_client -reconnect and -starttls broke
RT2932: Catch write errors
RT2604: port should be 'unsigned short'
RT2983: total_bytes undeclared #ifdef RENEG
RT1523: Add -nocert to fix output in x509 app
RT3508: Remove unused variable introduced by b09eb24
RT3511: doc fix; req default serial is random
RT1325,2973: Add more extensions to c_rehash
RT2119,3407: Updated to dgst.pod
RT2379: Additional typo fix
RT2693: Extra include of string.h
RT2880: HFS is case-insensitive filenames
RT3246: req command prints version number wrong
Other changes; incompatibilities marked with *:
Add SCSV support
Add -misalign to speed command
Make dhparam, dsaparam, ecparam, x509 output C in proper style
Make some internal ocsp.c functions void
Only display cert usages with -help in verify
Use global bio_err, remove "BIO*err" parameter from functions
For filenames, - always means stdin (or stdout as appropriate)
Add aliases for -des/aes "wrap" ciphers.
*Remove support for IISSGC (server gated crypto)
*The undocumented OCSP -header flag is now "-header name=value"
*Documented the OCSP -header flag
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-25 03:26:15 +08:00
|
|
|
BIO_printf(bio_err, "Error creating SSL context.\n");
|
2015-01-22 11:40:55 +08:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
2015-08-04 19:23:00 +08:00
|
|
|
|
2019-10-31 06:39:35 +08:00
|
|
|
resp = (OCSP_RESPONSE *)
|
2021-05-12 19:58:52 +08:00
|
|
|
app_http_post_asn1(host, port, path, proxy, no_proxy,
|
2019-10-31 06:39:35 +08:00
|
|
|
ctx, headers, "application/ocsp-request",
|
|
|
|
(ASN1_VALUE *)req, ASN1_ITEM_rptr(OCSP_REQUEST),
|
2021-05-03 22:33:10 +08:00
|
|
|
"application/ocsp-response",
|
2019-10-31 06:39:35 +08:00
|
|
|
req_timeout, ASN1_ITEM_rptr(OCSP_RESPONSE));
|
|
|
|
|
2017-06-13 01:24:02 +08:00
|
|
|
if (resp == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio_err, "Error querying OCSP responder\n");
|
2019-10-31 06:39:35 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
end:
|
2015-04-11 22:22:36 +08:00
|
|
|
SSL_CTX_free(ctx);
|
2015-01-22 11:40:55 +08:00
|
|
|
return resp;
|
|
|
|
}
|
2003-02-14 09:02:58 +08:00
|
|
|
#endif
|