2015-12-21 20:19:29 +00:00
|
|
|
# -*- mode: perl; -*-
|
|
|
|
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
#
|
2018-12-06 12:05:25 +00:00
|
|
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
2015-12-21 20:19:29 +00:00
|
|
|
# this file except in compliance with the License. You can obtain a copy
|
|
|
|
# in the file LICENSE in the source distribution or at
|
|
|
|
# https://www.openssl.org/source/license.html
|
|
|
|
|
|
|
|
|
|
|
|
## Test version negotiation
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
package ssltests;
|
2017-12-10 11:05:19 +00:00
|
|
|
use OpenSSL::Test::Utils;
|
2015-12-21 20:19:29 +00:00
|
|
|
|
|
|
|
our @tests = (
|
|
|
|
{
|
|
|
|
name => "cipher-server-1",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384"
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES256-SHA384",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-2",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES128-SHA256"
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES128-SHA256",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-client-list",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES128-SHA256",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-pref-1",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256",
|
|
|
|
"Options" => "ServerPreference",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384"
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES256-SHA384",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-pref-2",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256",
|
|
|
|
"Options" => "ServerPreference",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES128-SHA256"
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES128-SHA256",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-pref-client-list",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256",
|
|
|
|
"Options" => "ServerPreference",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES256-SHA384",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-pref-not-mobile",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-CHACHA20-POLY1305",
|
|
|
|
"Options" => "ServerPreference",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES256-SHA384",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name => "cipher-server-pref-mobile",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-CHACHA20-POLY1305",
|
|
|
|
"Options" => "ServerPreference,PrioritizeChaCha",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
2017-12-10 11:05:19 +00:00
|
|
|
"CipherString" => "ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-CHACHA20-POLY1305",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
2017-12-10 11:05:19 +00:00
|
|
|
"ExpectedCipher" => "ECDHE-RSA-AES256-SHA384",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
},
|
2017-12-10 11:05:19 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
my @tests_poly1305 = (
|
2015-12-21 20:19:29 +00:00
|
|
|
{
|
|
|
|
name => "cipher-server-pref-mobile2",
|
|
|
|
server => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
|
|
|
"CipherString" => "ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-CHACHA20-POLY1305",
|
|
|
|
"Options" => "ServerPreference,PrioritizeChaCha",
|
|
|
|
},
|
2015-12-21 20:19:29 +00:00
|
|
|
client => {
|
2017-12-10 11:01:00 +00:00
|
|
|
"MaxProtocol" => "TLSv1.2",
|
2017-12-10 11:05:19 +00:00
|
|
|
"CipherString" => "ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
test => {
|
2017-12-10 11:05:19 +00:00
|
|
|
"ExpectedCipher" => "ECDHE-RSA-CHACHA20-POLY1305",
|
2015-12-21 20:19:29 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
2017-12-10 11:05:19 +00:00
|
|
|
|
2017-12-10 11:41:30 +00:00
|
|
|
push @tests, @tests_poly1305 unless disabled("poly1305") || disabled("chacha");
|