summaryrefslogtreecommitdiffstats
path: root/apps/ocsp.c
AgeCommit message (Collapse)Author
2016-02-22Remove unused parameters from internal functionsRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20argv was set but unusedKurt Roeckx
Also gives an error message when you gave it a parameter it didn't expect. Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #2009
2016-02-18GH681: More command help cleanupRich Salz
enc: - typo in -base64 option - missing help opt text ocsp, req, rsautl, s_client: - missing help opt text Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-14Make sure to use unsigned char for is*() functionsRichard Levitte
On some platforms, the implementation is such that a signed char triggers a warning when used with is*() functions. On others, the behavior is outright buggy when presented with a char that happens to get promoted to a negative integer. The safest thing is to cast the char that's used to an unsigned char. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-13GH650: Minor tidying around the ocsp appBenjamin Kaduk
The ocsp utility is something of a jack-of-all-trades; most anything related to the OCSP can be done with it. In particular, the manual page calls out that it can be used as either a client or a server of the protocol, but there are also a few things that it can do which do not quite fit into either role, such as encoding an OCSP request but not sending it, printing out a text form of an OCSP response (or request) from a file akin to the asn1parse utility, or performing a lookup into the server-side revocation database without actually sending a request or response. All three of these are documented as examples in the manual page, but the documentation prior to this commit is somewhat misleading, in that when printing the text form of an OCSP response, the code also attempts to verify the response, displaying an error message and returning failure if the response does not verify. (It is possible that the response would be able to verify with the given example, since the default trust roots are used for that verification, but OCSP responses frequently have alternate certification authorities that would require passing -CAfile or -CApath for verification.) Tidy up the documentation by passing -noverify for the case of converting from binary to textual representation, and also change a few instances of -respin to -reqin as appropriate, note that the -url option provides the same functionality as the -host and -path options, clarify that the example that saves an OCSP response to a file will also perform verification on that response, and fix a couple grammar nits in the manual page. Also remove an always-true conditional for rdb != NULL -- there are no codepaths in which it could be initialized at the time of this check. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-20Refactor apps load_certs/load_crls to work incrementallyViktor Dukhovni
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-14To avoid possible time_t overflow use X509_time_adj_ex()Dr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz
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-11-09Continue standardisation of malloc handling in appsMatt Caswell
continue on from previous commits but in the apps directory Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-10-23Do not treat 0 return value from BIO_get_fd() as errorAlessandro Ghedini
0 is a valid file descriptor. RT#4068 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-18Move auto Host adding to query_responderDr. Stephen Henson
Check for Host header in query_responder instead of process_responder. This also fixes a memory leak in the old code if the headers was NULL. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-18Fix memory leak with -issuer option.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-12Centralise loading default apps config fileMatt Caswell
Loading the config file after processing command line options can cause problems, e.g. where an engine provides new ciphers/digests these are not then recoginised on the command line. Move the default config file loading to before the command line option processing. Whilst we're doing this we might as well centralise this instead of doing it individually for each application. Finally if we do it before the OpenSSL_add_ssl_algorithms() call then ciphersuites provided by an engine (e.g. GOST) can be available to the apps. RT#4085 RT#4086 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-25Add support for -no-CApath and -no-CAfile optionsMatt Caswell
For those command line options that take the verification options -CApath and -CAfile, if those options are absent then the default path or file is used instead. It is not currently possible to specify *no* path or file at all. This change adds the options -no-CApath and -no-CAfile to specify that the default locations should not be used to all relevant applications. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-09-06Change the way apps open their input and output filesRichard Levitte
The different apps had the liberty to decide whether they would open their input and output files in binary mode or not, which could be confusing if two different apps were handling the same type of file in different ways. The solution is to centralise the decision of low level file organisation, and that the apps would use a selection of formats to state the intent of the file. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-10Fix build break.Rich Salz
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-08-08GH357: Update ocsp.cbluelineXY
Add Host Header in OCSP query if no host header is set via -header Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Ben Laurie <ben@openssl.org>
2015-07-31RT3962: Check accept_count only if not unlimitedAdam Eijdenberg
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-23RT3682: Avoid double-free on OCSP parse errorRich Salz
Found by Kurt Cancemi. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-02RT832: Use REUSEADDR in ocsp responderRich Salz
I also re-ordered some of #ifdef's. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-29Restore module loadingRichard Levitte
The module loading feature got broken a while ago, so restore it, but have it a bit more explicit this time around. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-05-16Client side version negotiation rewriteMatt Caswell
Continuing from the previous commit this changes the way we do client side version negotiation. Similarly all of the s23* "up front" state machine code has been avoided and again things now work much the same way as they already did for DTLS, i.e. we just do most of the work in the ssl3_get_server_hello() function. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-13Add missing ctype.hRich Salz
Had old patch, forgot to push/patch this to master Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13Fix ocsp bugsRich Salz
Various bugs found by Viktor, Emilia, Matt, etc. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-01free NULL cleanup -- codaRich Salz
After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-01free null cleanup finaleRich Salz
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-30free cleanup 12Rich Salz
Don't check for NULL before calling free function. This gets: NAME_CONSTRAINTS_free GENERAL_SUBTREE_free ECDSA_METHOD_free JPAKE_CTX_free OCSP_REQ_CTX_free SCT_free SRP_VBASE_free SRP_gN_free SRP_user_pwd_free TXT_DB_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-30free NULL cleanup 5aRich Salz
Don't check for NULL before calling a free routine. This gets X509_.*free: x509_name_ex_free X509_policy_tree_free X509_VERIFY_PARAM_free X509_STORE_free X509_STORE_CTX_free X509_PKEY_free X509_OBJECT_free_contents X509_LOOKUP_free X509_INFO_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-29Add HTTP GET support to OCSP serverRich Salz
Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-04-26Fix main build breakage.Rich Salz
A variable declaration got dropped during a merge. And if a compiler inlines strcmp() and you put a strcmp in an assert message, the resultant stringification exceeds ANSI string limits. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-04-25RT2206: Add -issuer flag to ocsp commandRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-24Big apps cleanup (option-parsing, etc)Rich Salz
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-11free NULL cleanup 10Rich Salz
Avoid checking for NULL before calling free functions. This gets ssl.*free: ssl_sess_cert_free ssl_free ssl_excert_free ssl_cert_free SSL_free SSL_SRP_CTX_free SSL_SESSION_free SSL_CTX_free SSL_CTX_SRP_CTX_free SSL_CONF_CTX_free Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-03-25free NULL cleanupRich Salz
This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free BIO_free BIO_free_all BIO_vfree Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-05Make OCSP structures opaque.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-02-25Add -no_alt_chains option to apps to implement the newMatt Caswell
X509_V_FLAG_NO_ALT_CHAINS flag. Using this option means that when building certificate chains, the first chain found will be the one used. Without this flag, if the first chain found is not trusted then we will keep looking to see if we can build an alternative chain instead. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-02Use the SSLv23 method by defaultKurt Roeckx
If SSLv2 and SSLv3 are both disabled we still support SSL/TLS. Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-27Tidy up ocsp help outputMatt Caswell
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-11-27Add documentation on -timeout option in the ocsp utilityAndré Guerreiro
PR#3612 Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-06-29Fix typo in message (RT 3107)Rich Salz
2014-06-19Document -trusted_first option in man pages and help.Hubert Kario
Add -trusted_first description to help messages and man pages of tools that deal with certificate verification.
2014-04-09Fix free errors in ocsp utility.Dr. Stephen Henson
Keep copy of any host, path and port values allocated by OCSP_parse_url and free as necessary.
2014-02-20Move CT viewer extension code to crypto/x509v3Dr. Stephen Henson
2014-02-19Move the SCT List extension parser into libssl.Rob Stradling
Add the extension parser in the s_client, ocsp and x509 apps.
2013-10-07Constification.Ben Laurie
2012-12-21add missing newlineDr. Stephen Henson
2012-12-16add -rmd option to set OCSP response signing digestDr. Stephen Henson
2012-12-15Return success when the responder is active.Dr. Stephen Henson
Don't verify our own responses.
2012-12-15typoDr. Stephen Henson