aboutsummaryrefslogtreecommitdiffstats
path: root/apps/apps.c
Commit message (Collapse)AuthorAgeFilesLines
* Free an X509_CRL in an error pathMatt Caswell2016-06-011-1/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix s_client/s_server waiting for stdin on WindowsMatt Caswell2016-05-271-1/+30
| | | | | | | | | | | | | | On Windows we were using the function _kbhit() to determine whether there was input waiting in stdin for us to read. Actually all this does is work out whether there is a keyboard press event waiting to be processed in the input buffer. This only seems to work in a standard Windows console (not Msys console) and also doesn't work if you redirect the input from some other source (as we do in TLSProxy tests). This commit changes things to work differently depending on whether we are on the Windows console or not. RT#4255 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename lh_xxx,sk_xxx tp OPENSSL_{LH,SK}_xxxRich Salz2016-05-201-2/+2
| | | | | | | | | | | | Rename sk_xxx to OPENSSL_sk_xxx and _STACK to OPENSSL_STACK Rename lh_xxx API to OPENSSL_LH_xxx and LHASH_NODE to OPENSSL_LH_NODE Make lhash stuff opaque. Use typedefs for function pointers; makes the code simpler. Remove CHECKED_xxx macros. Add documentation; remove old X509-oriented doc. Add API-compat names for entire old API Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Make it possible to have RFC2254 escapes with ASN1_STRING_print_ex()Richard Levitte2016-05-181-0/+1
| | | | | | | | Also adds 'esc_2254' to the possible command line name options RT#1466 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Few cleanups in s_client, s_server apps.FdaSilvaYY2016-05-181-1/+2
| | | | | | | | | Discard useless static engine_id Add a const qualifier Fix some spelling Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Copyright consolidation 01/10Rich Salz2016-05-171-107/+6
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Use app_malloc; two missing cases.Rich Salz2016-05-161-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Don't leak memory if realloc fails.Dr. Stephen Henson2016-05-121-5/+4
| | | | | | RT#4403 Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* fix tab-space mixed indentationFdaSilvaYY2016-05-091-2/+2
| | | | | | | No code change Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* various spelling fixesFdaSilvaYY2016-04-281-2/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/952)
* Fix no-engine no-ui.Ben Laurie2016-04-271-0/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't use select on WindowsMatt Caswell2016-04-201-0/+3
| | | | | | Windows "select" only works for sockets so don't use it to wait for async. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make string_to_hex/hex_to_string publicRich Salz2016-04-181-39/+0
| | | | | | Give the API new names, document it. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Revert "various spelling fixes"Rich Salz2016-04-041-2/+2
| | | | | | | This reverts commit 620d540bd47a96fb6905fbbdd8ea5167a8841a3e. It wasn't reviewed. Reviewed-by: Rich Salz <rsalz@openssl.org>
* various spelling fixesFdaSilvaYY2016-04-041-2/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix "no-ui" configurationRichard Levitte2016-03-311-1/+9
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix pointer size issue with setbuf() on VMSRichard Levitte2016-03-301-0/+14
| | | | | | | | | | setbuf() is only for 32-bit pointers. If compiled with /POINTER_SIZE=64, we get a nasty warning about possible loss of data. However, since the only pointer used in the call is a FILE *, and the C RTL shouldn't give us a pointer above the first 4GB, it's safe to turn off the warning for this call. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Just like bio_out, bio_err needs the linebuffer filter on VMSRichard Levitte2016-03-211-0/+11
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix no-sockMatt Caswell2016-03-211-3/+3
| | | | | | Misc fixes for no-sock Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove Netware and OS/2Rich Salz2016-03-171-24/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Surround ctx_set_ctlog_list_file() with #ifndef OPENSSL_NO_CTRob Percival2016-03-111-0/+4
| | | | | Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Do not display a CT log error message if CT validation is disabledRob Percival2016-03-091-5/+1
| | | | | Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH787: Fix ALPNTodd Short2016-03-081-1/+1
| | | | | | | | | | | | * Perform ALPN after the SNI callback; the SSL_CTX may change due to that processing * Add flags to indicate that we actually sent ALPN, to properly error out if unexpectedly received. * clean up ssl3_free() no need to explicitly clear when doing memset * document ALPN functions Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Extends s_client to allow a basic CT policy to be enabledRob Percival2016-03-041-0/+13
| | | | | Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Refactor the async wait fd logicMatt Caswell2016-02-291-5/+17
| | | | | | | | | | | | | | | | | | | Implementation experience has shown that the original plan for async wait fds was too simplistic. Originally the async logic created a pipe internally and user/engine code could then get access to it via API calls. It is more flexible if the engine is able to create its own fd and provide it to the async code. Another issue is that there can be a lot of churn in the fd value within the context of (say) a single SSL connection leading to continually adding and removing fds from (say) epoll. It is better if we can provide some stability of the fd value across a whole SSL connection. This is problematic because an engine has no concept of an SSL connection. This commit refactors things to introduce an ASYNC_WAIT_CTX which acts as a proxy for an SSL connection down at the engine layer. Reviewed-by: Richard Levitte <levitte@openssl.org>
* GH463: Fix OPENSSL_NO_OCSP buildRich Salz2016-02-251-1/+7
| | | | | | | Fixes github issue 463. Building the app without OPENSSL_NO_SOCK isn't supported, so only do OPENSSL_NO_OCSP. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove unused parameters from internal functionsRich Salz2016-02-221-9/+8
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove outdated DEBUG flags.Rich Salz2016-02-181-63/+9
| | | | | | | | | | | | | | | | | Add -DBIO_DEBUG to --strict-warnings. Remove comments about outdated debugging ifdef guards. Remove md_rand ifdef guarding an assert; it doesn't seem used. Remove the conf guards in conf_api since we use OPENSSL_assert, not assert. For pkcs12 stuff put OPENSSL_ in front of the macro name. Merge TLS_DEBUG into SSL_DEBUG. Various things just turned on/off asserts, mainly for checking non-NULL arguments, which is now removed: camellia, bn_ctx, crypto/modes. Remove some old debug code, that basically just printed things to stderr: DEBUG_PRINT_UNKNOWN_CIPHERSUITES, DEBUG_ZLIB, OPENSSL_RI_DEBUG, RL_DEBUG, RSA_DEBUG, SCRYPT_DEBUG. Remove OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove JPAKERich Salz2016-02-171-226/+0
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Make sure to use unsigned char for is*() functionsRichard Levitte2016-02-141-2/+2
| | | | | | | | | | | 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>
* Fix pkeyutl/rsautl empty encrypt-input/decrypt-output handlingViktor Dukhovni2016-02-021-12/+31
| | | | | | | | | | | | | Also fix option processing in pkeyutl to allow use of (formerly) "out-of-order" switches that were needless implementation limitations. Handle documented "ENGINE" form with -keyform and -peerform. Better handling of OPENSSL_NO_ENGINE and OPENSSL_NO_RSA. RT2018 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Refactor apps load_certs/load_crls to work incrementallyViktor Dukhovni2016-01-201-16/+14
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* VMS open() doesn't take O_BINARY, but takes a context descriptionRichard Levitte2016-01-141-1/+11
| | | | | | | | Tell open() O_BINARY on VMS doesn't make sense, as it's possible to use more precise file attributes. However, if we're still going to fdopen() it in binary mode, we must set the fd in binary context. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Rename binmode into textmode and use it correctlyRichard Levitte2016-01-141-4/+4
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Rename some BUF_xxx to OPENSSL_xxxRich Salz2015-12-161-5/+5
| | | | | | | | | 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>
* Add s_client support for waiting for asyncMatt Caswell2015-11-201-0/+14
| | | | | | | s_server already had the ability to wait on an async file descriptor. This adds it to s_client too. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Continue standardisation of malloc handling in appsMatt Caswell2015-11-091-7/+7
| | | | | | continue on from previous commits but in the apps directory Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Remove useless codeAlessandro Ghedini2015-10-231-3/+0
| | | | | | | RT#4081 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add support for -no-CApath and -no-CAfile optionsMatt Caswell2015-09-251-23/+34
| | | | | | | | | | | 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>
* Use default field separator.Dr. Stephen Henson2015-09-111-1/+5
| | | | | | | | | If the field separator isn't specified through -nameopt then use XN_FLAG_SEP_CPLUS_SPC instead of printing nothing and returing an error. PR#2397 Reviewed-by: Tim Hudson <tjh@openssl.org>
* Small fix: make istext staticRichard Levitte2015-09-061-1/+1
| | | | | | This takes away a build failure in some cases. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Change the treatment of stdin and stdout to allow binary dataRichard Levitte2015-09-061-14/+22
| | | | | | | | | | | | | | If the output to stdout or the input from stdin is meant to be binary, it's deeply unsetting to get the occasional LF converted to CRLF or the other way around. If someone happens to forget to redirect stdin or stdout, they will get gibberish anyway, line ending conversion will not change that. Therefore, let's not have dup_bio_* decide unilaterally what mode the BIO derived from stdin and stdout, and rather let the app decide by declaring the intended format. Reviewed-by: Tim Hudson <tjh@openssl.org>
* dup_bio_* and bio_open_* are utility functions and belong in apps.cRichard Levitte2015-09-061-1/+158
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Change the way apps open their input and output filesRichard Levitte2015-09-061-14/+7
| | | | | | | | | | | | 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>
* Remove obsolete key formats.Rich Salz2015-07-161-71/+1
| | | | | | | | Remove support for RSA_NET and Netscape key format (-keyform n). Also removed documentation of SGC. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* RT2547: Tighten perms on generated privkey filesRich Salz2015-06-151-1/+0
| | | | | | | | | | | | When generating a private key, try to make the output file be readable only by the owner. Put it in CHANGES file since it might be noticeable. Add "int private" flag to apps that write private keys, and check that it's set whenever we do write a private key. Checked via assert so that this bug (security-related) gets fixed. Thanks to Viktor for help in tracing the code-paths where private keys are written. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Restore module loadingRichard Levitte2015-05-291-7/+46
| | | | | | | 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>
* RT3876: Only load config when neededRich Salz2015-05-281-16/+31
| | | | | | | | Create app_load_config(), a routine to load config file. Remove the "always load config" from the main app. Change the places that used to load config to call the new common routine. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove support for OPENSSL_NO_TLSEXTMatt Caswell2015-05-221-2/+0
| | | | | | | | | | Given the pervasive nature of TLS extensions it is inadvisable to run OpenSSL without support for them. It also means that maintaining the OPENSSL_NO_TLSEXT option within the code is very invasive (and probably not well tested). Therefore it is being removed. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use p==NULL not !p (in if statements, mainly)Rich Salz2015-05-111-2/+3
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>