提交 062540cb 编写于 作者: D Dr. Stephen Henson

Add signing hash tests

Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2235)
上级 ee5b6a42
...@@ -543,6 +543,7 @@ client = 18-client-auth-TLSv1.2-require-client ...@@ -543,6 +543,7 @@ client = 18-client-auth-TLSv1.2-require-client
[18-client-auth-TLSv1.2-require-server] [18-client-auth-TLSv1.2-require-server]
Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem Certificate = ${ENV::TEST_CERTS_DIR}/servercert.pem
CipherString = DEFAULT CipherString = DEFAULT
ClientSignatureAlgorithms = SHA256+RSA
MaxProtocol = TLSv1.2 MaxProtocol = TLSv1.2
MinProtocol = TLSv1.2 MinProtocol = TLSv1.2
PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem PrivateKey = ${ENV::TEST_CERTS_DIR}/serverkey.pem
...@@ -560,6 +561,7 @@ VerifyMode = Peer ...@@ -560,6 +561,7 @@ VerifyMode = Peer
[test-18] [test-18]
ExpectedClientCertType = RSA ExpectedClientCertType = RSA
ExpectedClientSignHash = SHA256
ExpectedResult = Success ExpectedResult = Success
......
...@@ -33,6 +33,13 @@ sub generate_tests() { ...@@ -33,6 +33,13 @@ sub generate_tests() {
} else { } else {
$caalert = "UnknownCA"; $caalert = "UnknownCA";
} }
my $clihash;
my $clisigalgs;
# TODO add TLSv1.3 versions
if ($protocol_name eq "TLSv1.2") {
$clihash = "SHA256";
$clisigalgs = "SHA256+RSA";
}
# Sanity-check simple handshake. # Sanity-check simple handshake.
push @tests, { push @tests, {
name => "server-auth-${protocol_name}", name => "server-auth-${protocol_name}",
...@@ -87,6 +94,7 @@ sub generate_tests() { ...@@ -87,6 +94,7 @@ sub generate_tests() {
server => { server => {
"MinProtocol" => $protocol, "MinProtocol" => $protocol,
"MaxProtocol" => $protocol, "MaxProtocol" => $protocol,
"ClientSignatureAlgorithms" => $clisigalgs,
"VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem", "VerifyCAFile" => "\${ENV::TEST_CERTS_DIR}${dir_sep}root-cert.pem",
"VerifyMode" => "Request", "VerifyMode" => "Request",
}, },
...@@ -98,6 +106,7 @@ sub generate_tests() { ...@@ -98,6 +106,7 @@ sub generate_tests() {
}, },
test => { "ExpectedResult" => "Success", test => { "ExpectedResult" => "Success",
"ExpectedClientCertType" => "RSA", "ExpectedClientCertType" => "RSA",
"ExpectedClientSignHash" => $clihash,
}, },
}; };
......
...@@ -111,6 +111,7 @@ VerifyMode = Peer ...@@ -111,6 +111,7 @@ VerifyMode = Peer
[test-3] [test-3]
ExpectedResult = Success ExpectedResult = Success
ExpectedServerCertType = P-256 ExpectedServerCertType = P-256
ExpectedServerSignHash = SHA256
# =========================================================== # ===========================================================
...@@ -163,5 +164,6 @@ VerifyMode = Peer ...@@ -163,5 +164,6 @@ VerifyMode = Peer
[test-5] [test-5]
ExpectedResult = Success ExpectedResult = Success
ExpectedServerCertType = RSA ExpectedServerCertType = RSA
ExpectedServerSignHash = SHA256
...@@ -59,7 +59,8 @@ our @tests = ( ...@@ -59,7 +59,8 @@ our @tests = (
"SignatureAlgorithms" => "ECDSA+SHA256", "SignatureAlgorithms" => "ECDSA+SHA256",
}, },
test => { test => {
"ExpectedServerCertType" =>, "P-256", "ExpectedServerCertType" => "P-256",
"ExpectedServerSignHash" => "SHA256",
"ExpectedResult" => "Success" "ExpectedResult" => "Success"
}, },
}, },
...@@ -80,7 +81,8 @@ our @tests = ( ...@@ -80,7 +81,8 @@ our @tests = (
"SignatureAlgorithms" => "RSA+SHA256", "SignatureAlgorithms" => "RSA+SHA256",
}, },
test => { test => {
"ExpectedServerCertType" =>, "RSA", "ExpectedServerCertType" => "RSA",
"ExpectedServerSignHash" => "SHA256",
"ExpectedResult" => "Success" "ExpectedResult" => "Success"
}, },
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册