2016-04-07 17:07:50 +00:00
|
|
|
# -*- mode: perl; -*-
|
2016-06-01 15:26:40 +00:00
|
|
|
# Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
# 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
|
|
|
|
|
2016-04-07 17:07:50 +00:00
|
|
|
|
|
|
|
## SSL test configurations
|
|
|
|
|
|
|
|
package ssltests;
|
|
|
|
|
|
|
|
our @tests = (
|
|
|
|
|
|
|
|
# Sanity-check that verification indeed succeeds without the
|
|
|
|
# restrictive callback.
|
|
|
|
{
|
|
|
|
name => "verify-success",
|
|
|
|
server => { },
|
|
|
|
client => { },
|
|
|
|
test => { "ExpectedResult" => "Success" },
|
|
|
|
},
|
|
|
|
|
|
|
|
# Same test as above but with a custom callback that always fails.
|
|
|
|
{
|
|
|
|
name => "verify-custom-reject",
|
|
|
|
server => { },
|
2016-07-21 14:29:48 +00:00
|
|
|
client => {
|
|
|
|
extra => {
|
|
|
|
"VerifyCallback" => "RejectAll",
|
|
|
|
},
|
|
|
|
},
|
2016-04-07 17:07:50 +00:00
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ClientFail",
|
2016-07-21 14:29:48 +00:00
|
|
|
"ExpectedClientAlert" => "HandshakeFailure",
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Same test as above but with a custom callback that always succeeds.
|
|
|
|
{
|
|
|
|
name => "verify-custom-allow",
|
|
|
|
server => { },
|
2016-07-21 14:29:48 +00:00
|
|
|
client => {
|
|
|
|
extra => {
|
|
|
|
"VerifyCallback" => "AcceptAll",
|
|
|
|
},
|
|
|
|
},
|
2016-04-07 17:07:50 +00:00
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "Success",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Sanity-check that verification indeed succeeds if peer verification
|
|
|
|
# is not requested.
|
|
|
|
{
|
|
|
|
name => "noverify-success",
|
|
|
|
server => { },
|
|
|
|
client => {
|
|
|
|
"VerifyMode" => undef,
|
|
|
|
"VerifyCAFile" => undef,
|
|
|
|
},
|
|
|
|
test => { "ExpectedResult" => "Success" },
|
|
|
|
},
|
|
|
|
|
|
|
|
# Same test as above but with a custom callback that always fails.
|
|
|
|
# The callback return has no impact on handshake success in this mode.
|
|
|
|
{
|
|
|
|
name => "noverify-ignore-custom-reject",
|
|
|
|
server => { },
|
|
|
|
client => {
|
|
|
|
"VerifyMode" => undef,
|
|
|
|
"VerifyCAFile" => undef,
|
2016-07-21 14:29:48 +00:00
|
|
|
extra => {
|
|
|
|
"VerifyCallback" => "RejectAll",
|
|
|
|
},
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "Success",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Same test as above but with a custom callback that always succeeds.
|
|
|
|
# The callback return has no impact on handshake success in this mode.
|
|
|
|
{
|
|
|
|
name => "noverify-accept-custom-allow",
|
|
|
|
server => { },
|
|
|
|
client => {
|
|
|
|
"VerifyMode" => undef,
|
|
|
|
"VerifyCAFile" => undef,
|
2016-07-21 14:29:48 +00:00
|
|
|
extra => {
|
|
|
|
"VerifyCallback" => "AcceptAll",
|
|
|
|
},
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "Success",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Sanity-check that verification indeed fails without the
|
|
|
|
# permissive callback.
|
|
|
|
{
|
|
|
|
name => "verify-fail-no-root",
|
|
|
|
server => { },
|
|
|
|
client => {
|
|
|
|
# Don't set up the client root file.
|
|
|
|
"VerifyCAFile" => undef,
|
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ClientFail",
|
2016-07-21 14:29:48 +00:00
|
|
|
"ExpectedClientAlert" => "UnknownCA",
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Same test as above but with a custom callback that always succeeds.
|
|
|
|
{
|
|
|
|
name => "verify-custom-success-no-root",
|
|
|
|
server => { },
|
|
|
|
client => {
|
|
|
|
"VerifyCAFile" => undef,
|
2016-07-21 14:29:48 +00:00
|
|
|
extra => {
|
|
|
|
"VerifyCallback" => "AcceptAll",
|
|
|
|
},
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "Success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Same test as above but with a custom callback that always fails.
|
|
|
|
{
|
|
|
|
name => "verify-custom-fail-no-root",
|
|
|
|
server => { },
|
|
|
|
client => {
|
|
|
|
"VerifyCAFile" => undef,
|
2016-07-21 14:29:48 +00:00
|
|
|
extra => {
|
|
|
|
"VerifyCallback" => "RejectAll",
|
|
|
|
},
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
test => {
|
|
|
|
"ExpectedResult" => "ClientFail",
|
2016-07-21 14:29:48 +00:00
|
|
|
"ExpectedClientAlert" => "HandshakeFailure",
|
2016-04-07 17:07:50 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|