summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-11 14:48:37 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-11 14:48:37 +0000
commitb9e663597463ecfe74ac0a67263425264ea49931 (patch)
treece3abb3ab9615cde48b54541c44801572ffb70fe /test
parent3afe04f24a99c95798718cc7dc992c4e636be508 (diff)
Allow certificates with preamble before BEGIN CERTIFICATE (dcpomatic #774).
Diffstat (limited to 'test')
-rw-r--r--test/certificates_test.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/certificates_test.cc b/test/certificates_test.cc
index a78c88d6..9592ae2f 100644
--- a/test/certificates_test.cc
+++ b/test/certificates_test.cc
@@ -91,9 +91,17 @@ BOOST_AUTO_TEST_CASE (certificates1)
/** Check some more certificate-from-strings */
BOOST_AUTO_TEST_CASE (certificates2)
{
- dcp::Certificate c (dcp::file_to_string (private_test / "CA.GDC-TECH.COM_SA2100_A14903.crt.crt"));
- BOOST_CHECK_EQUAL (c.certificate(true), dcp::file_to_string (private_test / "CA.GDC-TECH.COM_SA2100_A14903.crt.crt.reformatted"));
+ {
+ dcp::Certificate c (dcp::file_to_string (private_test / "CA.GDC-TECH.COM_SA2100_A14903.crt.crt"));
+ BOOST_CHECK_EQUAL (c.certificate(true), dcp::file_to_string (private_test / "CA.GDC-TECH.COM_SA2100_A14903.crt.crt.reformatted"));
+ }
+ {
+ dcp::Certificate c (dcp::file_to_string (private_test / "usl-cert.pem"));
+ BOOST_CHECK_EQUAL (c.certificate(true), dcp::file_to_string (private_test / "usl-cert.pem.trimmed"));
+ }
+
+ BOOST_CHECK_THROW (dcp::Certificate (dcp::file_to_string (private_test / "no-begin.pem")), dcp::MiscError);
BOOST_CHECK_THROW (dcp::Certificate ("foo"), dcp::MiscError);
}