aboutsummaryrefslogtreecommitdiffstats
path: root/test/packettest.c
Commit message (Collapse)AuthorAgeFilesLines
* Copyright year updatesMatt Caswell2023-09-071-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
* Rationalize FIPS sourcesTomas Mraz2023-02-081-1/+1
| | | | | | | | | Avoid including QUIC related stuff in the FIPS sources. Also avoid including libssl headers in ssl3_cbc.c. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19658)
* QUIC: Enable building with QUIC support disabledHugo Landau2023-01-131-0/+6
| | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
* Fix PACKET_equal test with BUF_LEN+1 on -Wstringop-overreadReinhard Urban2022-11-071-3/+3
| | | | | | | | | | | Either suppress the error, or better make smbuf longer. Detected with -Werror. CLA: trivial Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19528)
* QUIC wire format supportHugo Landau2022-05-271-0/+106
| | | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18382)
* Fix a gcc 11.2.0 warningMatt Caswell2021-10-271-1/+1
| | | | | | | | | | gcc 11.2.0 is the default on Ubuntu 21.10. It emits a (spurious) warning when compiling test/packettest.c, which causes --strict-warnings builds to fail. A simple fix avoids the warning. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/16887)
* Make the PACKET/WPACKET code available to both libcrypto and libsslMatt Caswell2019-07-121-1/+1
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9111)
* Correctly initialise PACKET to zero in the tests to avoid possible problemsPauli2019-03-291-5/+10
| | | | | | | with padding bytes. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8611)
* Following the license change, modify the boilerplates in test/Richard Levitte2018-12-061-1/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7767)
* Update copyright yearMatt Caswell2018-03-201-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5689)
* Fix a bunch of gcc warnings in packettest.cBernd Edlinger2018-03-061-8/+8
| | | | | | | | Had been observed with recent gcc-8 snapshot and $ ./config --strict-warnings enable-asan Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5519)
* Resolve warnings in VC-WIN32 build, which allows to add /WX.Andy Polyakov2017-11-131-2/+2
| | | | | | | | It's argued that /WX allows to keep better focus on new code, which motivates its comeback... Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4721)
* [packettest] Fix misplaced parenthesesAlexDenisov2017-10-301-7/+7
| | | | | | | | | Thanks to David Benjamin for suggesting the fix needed by this fix. CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4607)
* [Win] Fix some test method signatures ...FdaSilvaYY2017-08-161-23/+23
| | | | | | | | to halves MSVC warnings. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4172)
* Update the test framework so that the need for test_main is removed. EverythingPauli2017-07-271-2/+3
| | | | | | | | | | | | | | | | | | | | that needed test_main now works using the same infrastructure as tests that used register_tests. This meant: * renaming register_tests to setup_tests and giving it a success/failure return. * renaming the init_test function to setup_test_framework. * renaming the finish_test function to pulldown_test_framework. * adding a user provided global_init function that runs before the test frame work is initialised. It returns a failure indication that stops the stest. * adding helper functions that permit tests to access their command line args. * spliting the BIO initialisation and finalisation out from the test setup and teardown. * hiding some of the now test internal functions. * fix the comments in testutil.h Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3953)
* Fix compile error/warning in packettest.cTodd Short2017-05-171-2/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3416)
* Adapt all test programsRichard Levitte2017-04-241-1/+0
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3243)
* Convert more testsRich Salz2017-04-181-304/+261
| | | | | | | | | | ct_test,evp_extra_test,wpackettest,packettest Add strncmp TEST wrappers And make some style/consistency fixes to ct_test Silence travis; gcc bug? Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3234)
* Copyright consolidation 02/10Rich Salz2016-05-171-54/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Refactor ClientHello extension parsingEmilia Kasper2016-03-031-1/+94
| | | | | | | | | | | | | | | | | 1) Simplify code with better PACKET methods. 2) Make broken SNI parsing explicit. SNI was intended to be extensible to new name types but RFC 4366 defined the syntax inextensibly, and OpenSSL has never parsed SNI in a way that would allow adding a new name type. RFC 6066 fixed the definition but due to broken implementations being widespread, it appears impossible to ever extend SNI. 3) Annotate resumption behaviour. OpenSSL doesn't currently handle all extensions correctly upon resumption. Annotate for further clean-up. 4) Send an alert on ALPN protocol mismatch. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* constify PACKETEmilia Kasper2016-02-011-2/+2
| | | | | | | | PACKET contents should be read-only. To achieve this, also - constify two user callbacks - constify BUF_reverse. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* DTLS: remove unused cookie fieldEmilia Kasper2015-10-091-0/+20
| | | | | | | | Note that this commit constifies a user callback parameter and therefore will break compilation for applications using this callback. But unless they are abusing write access to the buffer, the fix is trivial. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Fix travis builds on masterAlessandro Ghedini2015-10-061-4/+4
| | | | | | | | | | | | | | -Allow mingw debug builds to fail on Travis CI -Fix Travis email notifications config -Rename a variable to avoid a bogus warning with old GCC error: declaration of ``dup'' shadows a global declaration [-Werror=shadow] -Disable pedantic ms-format warnings with mingw -Properly define const DH parameters -Restore --debug flag in Travis CI builds; -d would get incorrectly passed to ./Configure in mingw debug builds. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Add PACKET_copy_allEmilia Kasper2015-10-051-2/+21
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* ssl3_get_client_hello: rearrange logicEmilia Kasper2015-10-051-0/+16
| | | | | | | | | | | | | | | | Move all packet parsing to the beginning of the method. This limits the SSLv2 compatibility soup to the parsing, and makes the rest of the processing uniform. This is also needed for simpler EMS support: EMS servers need to do an early scan for EMS to make resumption decisions. This'll be easier when the entire ClientHello is parsed in the beginning. As a side effect, 1) PACKETize ssl_get_prev_session and tls1_process_ticket; and 2) Delete dead code for SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG. Reviewed-by: Matt Caswell <matt@openssl.org>
* PACKET: simplifyEmilia Kasper2015-09-221-9/+2
| | | | | | Get rid of the third field that is no longer needed. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove PACKET_backEmilia Kasper2015-09-181-12/+5
| | | | | | | It's unused, and the same functionality can be achieved with saving a copy of the struct. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove PACKET_(get|goto)_bookmarkEmilia Kasper2015-09-171-101/+101
| | | | | | | | The bookmark API results in a lot of boilerplate error checking that can be much more easily achieved with a simple struct copy. It also lays the path for removing the third PACKET field. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix warning about mixed declarations and code.Dr. Stephen Henson2015-09-091-2/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* PACKET: add PACKET_memdup and PACKET_strndupEmilia Kasper2015-09-091-0/+53
| | | | | | | | | | Use each once in s3_srvr.c to show how they work. Also fix a bug introduced in c3fc7eeab884b6876a1b4006163f190d325aa047 and made apparent by this change: ssl3_get_next_proto wasn't updating next_proto_negotiated_len Reviewed-by: Matt Caswell <matt@openssl.org>
* PACKET: add methods for reading length-prefixed TLS vectors.Emilia Kasper2015-08-261-1/+83
| | | | | | Rewrite ssl3_get_client_hello to use the new methods. Reviewed-by: Matt Caswell <matt@openssl.org>
* Enhance PACKET readabilityMatt Caswell2015-08-131-1/+1
| | | | | | | Enhance the PACKET code readability, and fix a stale comment. Thanks to Ben Kaduk (bkaduk@akamai.com) for pointing this out. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Fix clang uninitialized variable warning.Adam Eijdenberg2015-08-061-1/+0
| | | | | | | | We could just initialize it, but to be consistent with the rest of the file it seemed to make more sense to just drop. Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Revert "Fix uninitalised warning."Matt Caswell2015-08-061-1/+1
| | | | | | | | | This reverts commit 704563f04a8401781b359906c1f88a30e12af69c. Reverting in favour of the next commit which removes the underlying cause of the warning. Reviewed-by: Ben Laurie <ben@openssl.org>
* Fix uninitalised warning.Ben Laurie2015-08-061-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix a bug in the new PACKET implementationMatt Caswell2015-08-041-24/+25
| | | | | | | Some of the PACKET functions were returning incorrect data. An unfortunate choice of test data in the unit test was masking the failure. Reviewed-by: Tim Hudson <tjh@openssl.org>
* PACKET unit testsMatt Caswell2015-08-031-0/+317
Add some unit tests for the new PACKET API Reviewed-by: Tim Hudson <tjh@openssl.org>