summaryrefslogtreecommitdiffstats
path: root/test/packettest.c
AgeCommit message (Collapse)Author
2018-12-06Following the license change, modify the boilerplates in test/Richard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7767)
2018-03-20Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5689)
2018-03-06Fix a bunch of gcc warnings in packettest.cBernd Edlinger
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)
2017-11-13Resolve warnings in VC-WIN32 build, which allows to add /WX.Andy Polyakov
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)
2017-10-30[packettest] Fix misplaced parenthesesAlexDenisov
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)
2017-08-16[Win] Fix some test method signatures ...FdaSilvaYY
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)
2017-07-27Update the test framework so that the need for test_main is removed. EverythingPauli
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)
2017-05-17Fix compile error/warning in packettest.cTodd Short
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3416)
2017-04-24Adapt all test programsRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3243)
2017-04-18Convert more testsRich Salz
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)
2016-05-17Copyright consolidation 02/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-03Refactor ClientHello extension parsingEmilia Kasper
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>
2016-02-01constify PACKETEmilia Kasper
PACKET contents should be read-only. To achieve this, also - constify two user callbacks - constify BUF_reverse. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
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>
2015-10-09DTLS: remove unused cookie fieldEmilia Kasper
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>
2015-10-06Fix travis builds on masterAlessandro Ghedini
-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>
2015-10-05Add PACKET_copy_allEmilia Kasper
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-10-05ssl3_get_client_hello: rearrange logicEmilia Kasper
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>
2015-09-22PACKET: simplifyEmilia Kasper
Get rid of the third field that is no longer needed. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-18Remove PACKET_backEmilia Kasper
It's unused, and the same functionality can be achieved with saving a copy of the struct. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-17Remove PACKET_(get|goto)_bookmarkEmilia Kasper
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>
2015-09-09Fix warning about mixed declarations and code.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-09-09PACKET: add PACKET_memdup and PACKET_strndupEmilia Kasper
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>
2015-08-26PACKET: add methods for reading length-prefixed TLS vectors.Emilia Kasper
Rewrite ssl3_get_client_hello to use the new methods. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-13Enhance PACKET readabilityMatt Caswell
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>
2015-08-06Fix clang uninitialized variable warning.Adam Eijdenberg
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>
2015-08-06Revert "Fix uninitalised warning."Matt Caswell
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>
2015-08-06Fix uninitalised warning.Ben Laurie
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-04Fix a bug in the new PACKET implementationMatt Caswell
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>
2015-08-03PACKET unit testsMatt Caswell
Add some unit tests for the new PACKET API Reviewed-by: Tim Hudson <tjh@openssl.org>