1# -*- mode: perl; -*- 2# Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved. 3# 4# Licensed under the OpenSSL license (the "License"). You may not use 5# this file except in compliance with the License. You can obtain a copy 6# in the file LICENSE in the source distribution or at 7# https://www.openssl.org/source/license.html 8 9 10## Test Compression 11 12use strict; 13use warnings; 14 15package ssltests; 16use OpenSSL::Test::Utils; 17 18our @tests = (); 19 20our @tests_tls1_3 = ( 21 { 22 name => "tlsv1_3-both-compress", 23 server => { 24 "Options" => "Compression" 25 }, 26 client => { 27 "Options" => "Compression" 28 }, 29 test => { 30 "CompressionExpected" => "No", 31 "ExpectedResult" => "Success" 32 } 33 }, 34 { 35 name => "tlsv1_3-client-compress", 36 server => { 37 }, 38 client => { 39 "Options" => "Compression" 40 }, 41 test => { 42 "CompressionExpected" => "No", 43 "ExpectedResult" => "Success" 44 } 45 }, 46 { 47 name => "tlsv1_3-server-compress", 48 server => { 49 "Options" => "Compression" 50 }, 51 client => { 52 }, 53 test => { 54 "CompressionExpected" => "No", 55 "ExpectedResult" => "Success" 56 } 57 }, 58 { 59 name => "tlsv1_3-neither-compress", 60 server => { 61 }, 62 client => { 63 }, 64 test => { 65 "CompressionExpected" => "No", 66 "ExpectedResult" => "Success" 67 } 68 }, 69); 70our @tests_tls1_2 = ( 71 { 72 name => "tlsv1_2-both-compress", 73 server => { 74 "Options" => "Compression" 75 }, 76 client => { 77 "Options" => "Compression", 78 "MaxProtocol" => "TLSv1.2" 79 }, 80 test => { 81 "CompressionExpected" => "Yes", 82 "ExpectedResult" => "Success" 83 } 84 }, 85 { 86 name => "tlsv1_2-client-compress", 87 server => { 88 }, 89 client => { 90 "Options" => "Compression", 91 "MaxProtocol" => "TLSv1.2" 92 }, 93 test => { 94 "CompressionExpected" => "No", 95 "ExpectedResult" => "Success" 96 } 97 }, 98 { 99 name => "tlsv1_2-server-compress", 100 server => { 101 "Options" => "Compression" 102 }, 103 client => { 104 "MaxProtocol" => "TLSv1.2" 105 }, 106 test => { 107 "CompressionExpected" => "No", 108 "ExpectedResult" => "Success" 109 } 110 }, 111 { 112 name => "tlsv1_2-neither-compress", 113 server => { 114 }, 115 client => { 116 "MaxProtocol" => "TLSv1.2" 117 }, 118 test => { 119 "CompressionExpected" => "No", 120 "ExpectedResult" => "Success" 121 } 122 }, 123); 124 125push @tests, @tests_tls1_3 unless disabled("tls1_3"); 126push @tests, @tests_tls1_2 unless alldisabled(("tls1_2", "tls1_1", "tls1", 127 "ssl3")); 128