aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Implement DSA_SIG_set0() and ECDSA_SIG_set0(), for setting signature values.TJ Saunders2016-06-136-0/+44
| | | | | | | | | | | | | | | SSH2 implementations which use DSA_do_verify() and ECDSA_do_verify() are given the R and S values, and the data to be signed, by the client. Thus in order to validate these signatures, SSH2 implementations will digest and sign the data -- and then pass in properly provisioned DSA_SIG and ECDSA_SIG objects. Unfortunately, the existing OpenSSL-1.1.0 APIs do not allow for directly setting those R and S values in these objects, which makes using OpenSSL for such SSH2 implementations much more difficult. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1193)
* Add some missing return value checksMatt Caswell2016-06-135-11/+19
| | | | | | Some misc return value checks Reviewed-by: Rich Salz <rsalz@openssl.org>
* Update sslapitest to use the test frameworkMatt Caswell2016-06-132-23/+11
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Update the SSL_set_session() documentationMatt Caswell2016-06-131-1/+5
| | | | | | | Update the SSL_set_session() documentation to reflect the fact that old bad sessions are removed from the cache if necessary. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add some session API testsMatt Caswell2016-06-137-184/+411
| | | | | | | | | | This commit adds some session API tests, and in particular tests the modified behaviour of SSL_set_session() introduced in the last commit. To do this I have factored out some common code from the asynciotest into a new ssltestlib.c file. I've also renamed getsettest to sslapitest as this more closely matches what it now is! Reviewed-by: Rich Salz <rsalz@openssl.org>
* Ensure SSL_set_session clears the old session from cache if it is badMatt Caswell2016-06-131-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | SSL_clear() and SSL_free() will remove a session from the cache if it is considered "bad". However SSL_set_session() does not do this for the session it is replacing. SSL_clear() clears an SSL object ready for reuse. It does not clear the session though. This means that: SSL_clear(s) SSL_set_session(s, sess); and SSL_set_session(s, sess); SSL_clear(s); do not do the same thing, although logically you would expect that they would. The failure of SSL_set_session() to remove bad sessions from the cache should be considered a bug, so this commit fixes it. RT#597 Reviewed-by: Rich Salz <rsalz@openssl.org>
* SSL test: only write out server2 when testing SNIEmilia Kasper2016-06-1311-4831/+25
| | | | | | | | | | The SNI tests introduced a redundant "server2" section into every test configuration. Copy this automatically from "server" unless testing SNI, to reduce noise in the generated confs. Also remove duplicate SSL_TEST_CTX_create (merge conflict error). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Handle inability to create AFALG socketMatt Caswell2016-06-132-2/+16
| | | | | | | | | | | | | Some Linux platforms have a suitably recent kernel to support AFALG, but apparently you still can't actually create an afalg socket. This extends the afalg_chk_platform() function to additionally check whether we can create an AFALG socket. We also amend the afalgtest to not report a failure to load the engine as a test failure. A failure to load is almost certainly due to platform environmental issues, and not an OpenSSL problem. RT 4434 Reviewed-by: Andy Polyakov <appro@openssl.org>
* Port DTLS version negotiation testsEmilia Kasper2016-06-1312-171/+2756
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Clean up following new SNI testsEmilia Kasper2016-06-137-63/+69
| | | | | | | | | | | - Only send SNI in SNI tests. This allows us to test handshakes without the SNI extension as well. - Move all handshake-specific machinery to handshake_helper.c - Use enum types to represent the enum everywhere (Resorting to plain ints can end in sign mismatch when the enum is represented by an unsigned type.) Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT3809: basicConstraints is criticalRich Salz2016-06-135-14/+6
| | | | | | | This is really a security bugfix, not enhancement any more. Everyone knows critical extensions. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* bn/bn_add.c: favour counted loops over ifs and breaks.Andy Polyakov2016-06-131-72/+38
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* doc/crypto/OPENSSL_ia32cap.pod update.Andy Polyakov2016-06-131-15/+46
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Don't skip leading zeroes in PSK keys.Dr. Stephen Henson2016-06-122-36/+28
| | | | | | | | | 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>
* RT2759: Don't read TTY when already at EOF.John Denker2016-06-121-1/+10
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Avoid memory leaks if options repeated.Rich Salz2016-06-121-5/+14
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* RT3053: Check for NULL before dereferencingPhillip Hellewell2016-06-121-0/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Ensure that the EVP_MD_meth_new docs properly match the declared functions;TJ Saunders2016-06-111-2/+2
| | | | | | | it looks like these names have shifted a little over time. Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1203)
* Avoid creating illegal pointersKurt Roeckx2016-06-111-5/+7
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1179
* include stdlib for malloc() and free()Kurt Roeckx2016-06-111-0/+1
| | | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1174
* Don't compare a just free()d pointerKurt Roeckx2016-06-111-1/+1
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1173
* Specify array sizesKurt Roeckx2016-06-115-6/+6
| | | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1172
* Avoid creating an illegal pointer.Kurt Roeckx2016-06-111-2/+1
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1166
* Avoid creating an illegal pointerKurt Roeckx2016-06-111-2/+2
| | | | | | | | Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1164
* Fix an error path leak in int X509_ATTRIBUTE_set1_data()Matt Caswell2016-06-101-3/+9
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix an error path leak in do_ext_nconf()Matt Caswell2016-06-101-1/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix seg fault in TS_RESP_verify_response()Matt Caswell2016-06-101-8/+15
| | | | | | | | | | | The TS_RESP_verify_response() function is used for verifying the response from a TSA. You can set the provided TS_VERIFY_CTX with different flags depending on what aspects of the response you wish to verify. A seg fault will occur if you supply the TS_VFY_SIGNER or TS_VFY_TSA_NAME flags without also specifying TS_VFY_SIGNATURE. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix no-dtls* buildsMatt Caswell2016-06-101-1/+1
| | | | | | | Most of the no-dtls* builds were failing due to one test which had an incorrect "skip" condition. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Expand SSL_CTX_set_default_verify_paths() documentationMatt Caswell2016-06-101-2/+6
| | | | | | | | | Add some information about the location of the default directory and the default file. RT#1051 Reviewed-by: Andy Polyakov <appro@openssl.org>
* GH1183: Fix -unix and -connect, etc., overrideRich Salz2016-06-101-45/+39
| | | | | | | | 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>
* Omit corpora from tarball.Ben Laurie2016-06-101-1/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make corpora binary.Ben Laurie2016-06-101-0/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add fuzz corpora.Ben Laurie2016-06-101464-0/+373
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* RT3720 Increment session miss counter properlyLaszlo Kovacs2016-06-091-0/+1
| | | | | Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* RT 4242: reject invalid EC point coordinatesEmilia Kasper2016-06-094-20/+116
| | | | | | | | | | | | | | | We already test in EC_POINT_oct2point that points are on the curve. To be on the safe side, move this check to EC_POINT_set_affine_coordinates_* so as to also check point coordinates received through some other method. We do not check projective coordinates, though, as - it's unlikely that applications would be receiving this primarily internal representation from untrusted sources, and - it's possible that the projective setters are used in a setting where performance matters. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make a2i_ipadd an internal functionRich Salz2016-06-094-2/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* More API docs; small changes.Rich Salz2016-06-0911-31/+32
| | | | | | | Also fix typo noted on GitHub. Suppport typedef and #define to find-doc-nits Reviewed-by: Richard Levitte <levitte@openssl.org>
* Clean up "generic" intro pod files.Rich Salz2016-06-0943-964/+133
| | | | | | | | | | | | Files like dh.pod, etc., mostly duplicated the API-specific pod files. Removed the duplicated content; that often mean the whole file could be removed. Some of the content about internals got moved into README files in the source tree. Some content (e.g., err.pod) got moved into other pod pages. Annotate generic pages, remove dup NAME Reviewed-by: Richard Levitte <levitte@openssl.org>
* Write X509_dup, PEM_read, etc.Rich Salz2016-06-094-11/+435
| | | | | | | Partially document the ASN1 template stuff, and its use for i2d/d2i and PEM I/O. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Docs: install generic manpages to man section 7Richard Levitte2016-06-093-0/+6
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* hmac/hmac.c: fix sizeof typo in hmac_ctx_cleanup.Andy Polyakov2016-06-091-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix session ticket and SNITodd Short2016-06-0921-10/+4380
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When session tickets are used, it's possible that SNI might swtich the SSL_CTX on an SSL. Normally, this is not a problem, because the initial_ctx/session_ctx are used for all session ticket/id processes. However, when the SNI callback occurs, it's possible that the callback may update the options in the SSL from the SSL_CTX, and this could cause SSL_OP_NO_TICKET to be set. If this occurs, then two bad things can happen: 1. The session ticket TLSEXT may not be written when the ticket expected flag is set. The state machine transistions to writing the ticket, and the client responds with an error as its not expecting a ticket. 2. When creating the session ticket, if the ticket key cb returns 0 the crypto/hmac contexts are not initialized, and the code crashes when trying to encrypt the session ticket. To fix 1, if the ticket TLSEXT is not written out, clear the expected ticket flag. To fix 2, consider a return of 0 from the ticket key cb a recoverable error, and write a 0 length ticket and continue. The client-side code can explicitly handle this case. Fix these two cases, and add unit test code to validate ticket behavior. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1098)
* Fixes to get -ansi workingJeffrey Walton2016-06-084-12/+20
| | | | | | | | | | | | Various fixes to get the following to compile: ./config no-asm -ansi -D_DEFAULT_SOURCE RT4479 RT4480 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Add some accessor API'sRich Salz2016-06-0814-6/+120
| | | | | | | | | GH1098: Add X509_get_pathlen() (and a test) GH1097: Add SSL_is_dtls() function. Documented. Reviewed-by: Matt Caswell <matt@openssl.org>
* crypto/x509/x509_vpm.c: Simplify int_x509_param_set1()Kurt Cancemi2016-06-081-6/+5
| | | | | | | This change also avoids calling strlen twice when srclen is 0 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Always use session_ctx when removing a sessionTodd Short2016-06-085-7/+7
| | | | | | | | Sessions are stored on the session_ctx, which doesn't change after SSL_set_SSL_CTX(). Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix some typos in pod filesFdaSilvaYY2016-06-0811-20/+20
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1189)
* Ignore tsget.pl and c_rehash.pl, as well as other compiler generated filesRichard Levitte2016-06-081-1/+10
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Add empty record testsMatt Caswell2016-06-071-0/+81
| | | | | | | | | | | The previous commit changed how we handle out-of-context empty records. This commit adds some tests for the various scenarios. There are three tests: 1: Check that if we inject an out-of-context empty record then we fail 2: Check that if we inject an in-context empty record then we succeed 3: Check that if we inject too many in-context empty records then we fail. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Reject out of context empty recordsMatt Caswell2016-06-074-13/+29
| | | | | | | | | | | | Previously if we received an empty record we just threw it away and ignored it. Really though if we get an empty record of a different content type to what we are expecting then that should be an error, i.e. we should reject out of context empty records. This commit makes the necessary changes to achieve that. RT#4395 Reviewed-by: Andy Polyakov <appro@openssl.org>