diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-17 15:07:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-17 15:07:23 +0100 |
| commit | e21bb3e3c2cf5d0d971f1a5cf25da431fcde0409 (patch) | |
| tree | f1f856afb6b7a900cc81ba0c56064643fe8ca530 /test | |
| parent | a0c90120cb62cfbaf32eb32a7cb09891cb7c539a (diff) | |
More tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/certificates_test.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/certificates_test.cc b/test/certificates_test.cc index 538a0dae..57ecd2f7 100644 --- a/test/certificates_test.cc +++ b/test/certificates_test.cc @@ -91,8 +91,26 @@ BOOST_AUTO_TEST_CASE (certificates_validation) good.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); BOOST_CHECK (good.verify ()); - dcp::CertificateChain bad; - bad.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); - bad.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); - BOOST_CHECK (!bad.verify ()); + dcp::CertificateChain bad1; + bad1.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); + bad1.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); + BOOST_CHECK (!bad1.verify ()); + + dcp::CertificateChain bad2; + bad2.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); + bad2.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/ca.self-signed.pem")))); + bad2.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); + BOOST_CHECK (!bad2.verify ()); + + dcp::CertificateChain bad3; + bad3.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); + bad3.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); + bad3.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/ca.self-signed.pem")))); + BOOST_CHECK (!bad3.verify ()); + + dcp::CertificateChain bad4; + bad4.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); + bad4.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); + bad4.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/ca.self-signed.pem")))); + BOOST_CHECK (!bad4.verify ()); } |
