summaryrefslogtreecommitdiffstats
path: root/apps/s_client.c
AgeCommit message (Collapse)Author
2016-11-02Add the SSL_METHOD for TLSv1.3 and all other base changes requiredMatt Caswell
Includes addition of the various options to s_server/s_client. Also adds one of the new TLS1.3 ciphersuites. This isn't "real" TLS1.3!! It's identical to TLS1.2 apart from the protocol and the ciphersuite...and the ciphersuite is just a renamed TLS1.2 one (not a "real" TLS1.3 ciphersuite). Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-10-19If an engine comes up explicitely, it must also come down explicitelyRichard Levitte
In apps/apps.c, one can set up an engine with setup_engine(). However, we freed the structural reference immediately, which means that for engines that don't already have a structural reference somewhere else (because it's a built in engine), we end up returning an invalid reference. Instead, the function release_engine() is added, and called at the end of the routines that call setup_engine(). Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1643)
2016-10-17Add Postgres support to -starttlsValentin Vidic
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-10-14Constify command optionsFdaSilvaYY
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1694)
2016-10-01fix memory leakDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-09-28Restore '-keyform engine' support for s_clientDavid Woodhouse
This used to work in 1.0.2 but disappeared when the argument parsing was revamped. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1639)
2016-09-19Fix no-ocspRichard Levitte
Some compilers complain about unused variables, and some tests do not run well without OCSP. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-09-15Refactor to avoid unnecessary preprocessor logicRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-09-15Reformat to fit OpenSSL source code standardsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-09-15VSI submission: redirect terminal input through socketRichard Levitte
This is needed, because on VMS, select() can only be used on sockets. being able to use select() on all kinds of file descriptors is unique to Unix. So, the solution for VMS is to create a layer that translates input from standard input to socket communication. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-09-13s_client: avoid warning on Windows/MS-DOS systemsViktor Szakats
it appears when using gcc/mingw: ``` apps/s_client.c:815:9: warning: variable 'at_eof' set but not used [-Wunused-but-set-variable] int at_eof = 0; ^~~~~~ ``` Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1512)
2016-08-19fix warning about trailing commaDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-19Add -dane_ee_no_namechecks s_client(1) optionViktor Dukhovni
The DANE API supports a DANE_FLAG_NO_DANE_EE_NAMECHECKS option, but there was no way to exercise/enable it via s_client. This commit addresses that gap. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-18Fix missing dane_tlsa_rrdata option error messageViktor Dukhovni
The error message said "dane_tlsa_rrset" instead of "dane_tlsa_rrdata". Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-17Small nits and cleanupsFdaSilvaYY
using util/openssl-format-source on s_derver, s_client, ca.c, speed.c only... Fix/merge some #ifndef Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-17Constify char* input parameters in apps codeFdaSilvaYY
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-17Relocalise some globals variablesFdaSilvaYY
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-04Pack globals variables used to control apps/verify_callback()FdaSilvaYY
into a structure , to avoid any accident . Plus some few cleanups Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-26RT4639: Typo when -DSSL_DEBUGJon Loeliger
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-19Fix forgotten gotoRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-19Convert the last uses of sockaddr in apps/* to use BIO_ADDR insteadRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-07-08Disallow multiple protocol flags to s_server and s_clientMatt Caswell
We shouldn't allow both "-tls1" and "-tls1_2", or "-tls1" and "-no_tls1_2". The only time multiple flags are allowed is where they are all "-no_<prot>". This fixes Github Issue #1268 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-25Fix BN_is_prime* calls.David Benjamin
This function returns a tri-state -1 on error. See BoringSSL's 53409ee3d7595ed37da472bc73b010cd2c8a5ffd. Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1251
2016-06-21segmentation fault with 'openssl s_client -prexit -keymatexport'mmiyashita
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1243)
2016-06-18Add a comment after some #endif at end of apps source code.FdaSilvaYY
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1168)
2016-06-12Don't skip leading zeroes in PSK keys.Dr. Stephen Henson
Don't use BN_hex2bn() for PSK key conversion as the conversion to BN and back removes leading zeroes, use OPENSSL_hexstr2buf() instead. RT#4554 Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-12RT2759: Don't read TTY when already at EOF.John Denker
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-06-12Avoid memory leaks if options repeated.Rich Salz
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-06-10GH1183: Fix -unix and -connect, etc., overrideRich Salz
If a user specifies -unix, -6, etc., then the program tries to use the last one specified. This is confusing code and leads to scripting errors. Instead, allow only one type. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-05-27Fix intermittent windows failures in TLSProxy testsMatt Caswell
When closing down the socket in s_client Windows will close it immediately even if there is data in the write buffer still waiting to be sent. This was causing tests to fail in Msys/Mingw builds because TLSProxy doesn't see the final CloseNotify. I have experimented with various ways of doing this "properly" (e.g. shutting down the socket before closing, setting SO_LINGER etc). I can't seem to find the "magic" formula that will make Windows do this. Inserting a short 50ms sleep seems to do the trick...but its not very "nice" so I've inserted a TODO on this item. Perhaps someone else will have better luck in figuring this out. RT#4255 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-27Fix s_client/s_server waiting for stdin on WindowsMatt Caswell
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>
2016-05-18Locally declare some variablesFdaSilvaYY
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-18Few cleanups in s_client, s_server apps.FdaSilvaYY
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>
2016-05-17Copyright consolidation 01/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-05-16Use OPENSSL_hexchar2intRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-16Use app_malloc; two missing cases.Rich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-05Handle no async jobs in libsslMatt Caswell
If the application has limited the size of the async pool using ASYNC_init_thread() then we could run out of jobs while trying to start a libssl io operation. However libssl was failing to handle this and treating it like a fatal error. It should not be fatal...we just need to retry when there are jobs available again. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-21Fix missing break in option parsingMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-11Fix the no-nextprotoneg optionMatt Caswell
Misc fixes to get no-nextprotoneg config option working again. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-07Suppress CT callback as appropriateViktor Dukhovni
Suppress CT callbacks with aNULL or PSK ciphersuites that involve no certificates. Ditto when the certificate chain is validated via DANE-TA(2) or DANE-EE(3) TLSA records. Also skip SCT processing when the chain is fails verification. Move and consolidate CT callbacks from libcrypto to libssl. We also simplify the interface to SSL_{,CTX_}_enable_ct() which can specify either a permissive mode that just collects information or a strict mode that requires at least one valid SCT or else asks to abort the connection. Simplified SCT processing and options in s_client(1) which now has just a simple pair of "-noct" vs. "-ct" options, the latter enables the permissive callback so that we can complete the handshake and report all relevant information. When printing SCTs, print the validation status if set and not valid. Signed-off-by: Rob Percival <robpercival@google.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-06Fix no-ocspMatt Caswell
Misc fixes for no-ocsp Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-21Fix no-sockMatt Caswell
Misc fixes for no-sock Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-20GH886: CONNECT should use HTTP/1.1Rich Salz
By default you get 0.9 which isn't widely available. But we use HTTP/1.0 for now. Courtesy beusink@users.github.com Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-18Fix no-dgramMatt Caswell
A few places in s_client needed some OPENSSL_NO_DTLS guards which fixes no-dgram. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-17Remove Netware and OS/2Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-11Surround ctx_set_ctlog_list_file() with #ifndef OPENSSL_NO_CTRob Percival
Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-10check reviewer --reviewer=emiliaRob Percival
Use SSL_get_SSL_CTX instead of passing SSL_CTX to s_client.c:print_stuff Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-10check reviewer --reviewer=emiliaRob Percival
Remove 'log' field from SCT and related accessors In order to still have access to an SCT's CTLOG when calling SCT_print, SSL_CTX_get0_ctlog_store has been added. Improved documentation for some CT functions in openssl/ssl.h. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-09Use minimum and maximum protocol version instead of version fixed methodsKurt Roeckx
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> MR: #1824
2016-03-09Minor improvement to formatting of SCT output in s_clientRob Percival
Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>