| # -*- mode: perl; -*- |
| |
| ## 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 => { }, |
| client => { }, |
| test => { |
| "ClientVerifyCallback" => "RejectAll", |
| "ExpectedResult" => "ClientFail", |
| "ClientAlert" => "HandshakeFailure", |
| }, |
| }, |
| |
| # Same test as above but with a custom callback that always succeeds. |
| { |
| name => "verify-custom-allow", |
| server => { }, |
| client => { }, |
| test => { |
| "ClientVerifyCallback" => "AcceptAll", |
| "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, |
| }, |
| test => { |
| "ClientVerifyCallback" => "RejectAll", |
| "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, |
| }, |
| test => { |
| "ClientVerifyCallback" => "AcceptAll", |
| "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", |
| "ClientAlert" => "UnknownCA", |
| }, |
| }, |
| |
| # Same test as above but with a custom callback that always succeeds. |
| { |
| name => "verify-custom-success-no-root", |
| server => { }, |
| client => { |
| "VerifyCAFile" => undef, |
| }, |
| test => { |
| "ClientVerifyCallback" => "AcceptAll", |
| "ExpectedResult" => "Success" |
| }, |
| }, |
| |
| # Same test as above but with a custom callback that always fails. |
| { |
| name => "verify-custom-fail-no-root", |
| server => { }, |
| client => { |
| "VerifyCAFile" => undef, |
| }, |
| test => { |
| "ClientVerifyCallback" => "RejectAll", |
| "ExpectedResult" => "ClientFail", |
| "ClientAlert" => "HandshakeFailure", |
| }, |
| }, |
| |
| |
| |
| ); |