summaryrefslogtreecommitdiffstats
path: root/test/packettest.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2015-09-30 15:33:12 +0200
committerEmilia Kasper <emilia@openssl.org>2015-10-05 19:03:52 +0200
commitb3e2272c59a5720467045e2ae62940fdb708ce76 (patch)
tree9d61dfbedf4c9b1f7cf0e52fde863c07f8d9963c /test/packettest.c
parent2ff00bdbc4aad268e07df82541ff4a16b1f91fe8 (diff)
ssl3_get_client_hello: rearrange logic
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>
Diffstat (limited to 'test/packettest.c')
-rw-r--r--test/packettest.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/packettest.c b/test/packettest.c
index 6ee2ab15a6..acfc249885 100644
--- a/test/packettest.c
+++ b/test/packettest.c
@@ -327,6 +327,21 @@ static int test_PACKET_buf_init()
return 1;
}
+static int test_PACKET_null_init()
+{
+ PACKET pkt;
+
+ PACKET_null_init(&pkt);
+ /* Also tests PACKET_get_len() */
+ if ( PACKET_remaining(&pkt) != 0
+ || PACKET_forward(&pkt, 1)) {
+ fprintf(stderr, "test_PACKET_null_init() failed\n");
+ return 0;
+ }
+
+ return 1;
+}
+
static int test_PACKET_get_length_prefixed_1()
{
unsigned char buf[BUF_LEN];
@@ -417,6 +432,7 @@ int main(int argc, char **argv)
i = 0;
if ( !test_PACKET_buf_init()
+ || !test_PACKET_null_init()
|| !test_PACKET_remaining(buf)
|| !test_PACKET_get_1(buf)
|| !test_PACKET_get_4(buf)