summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-06-21 13:34:30 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-06-21 22:16:56 +0200
commite07085ecf8d4c5337855f45b9736f2d2db0a9002 (patch)
tree430acd4e0f3da4339db49cea4f9f81edf07b8bf4 /xmlsecurity
parent891d4b5d91c86951bb06d413808f75a3f4e6cb28 (diff)
gpg4libre: Fixup unit tests, now that SecurityContext is needed
Change-Id: Ifa43fa735c8b0d58ff3d3deca2ad4eca6560494a
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index 086852e9a56d..95fb711a3596 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -57,6 +57,8 @@ class SigningTest : public test::BootstrapFixture, public unotest::MacrosTest, p
{
uno::Reference<uno::XComponentContext> mxComponentContext;
uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<xml::crypto::XSEInitializer> mxSEInitializer;
+ uno::Reference<xml::crypto::XXMLSecurityContext> mxSecurityContext;
public:
SigningTest();
@@ -136,6 +138,8 @@ void SigningTest::setUp()
mxComponentContext.set(comphelper::getComponentContext(getMultiServiceFactory()));
mxDesktop.set(frame::Desktop::create(mxComponentContext));
+ mxSEInitializer = xml::crypto::SEInitializer::create(mxComponentContext);
+ mxSecurityContext = mxSEInitializer->createSecurityContext(OUString());
#ifndef _WIN32
// Set up cert8.db in workdir/CppunitTest/
@@ -215,7 +219,7 @@ void SigningTest::testDescription()
return;
OUString aDescription("SigningTest::testDescription");
sal_Int32 nSecurityId;
- aManager.add(xCertificate, aDescription, nSecurityId, false);
+ aManager.add(xCertificate, mxSecurityContext, aDescription, nSecurityId, false);
// Read back the signature and make sure that the description survives the roundtrip.
aManager.read(/*bUseTempStream=*/true);
@@ -249,7 +253,7 @@ void SigningTest::testOOXMLDescription()
return;
OUString aDescription("SigningTest::testDescription");
sal_Int32 nSecurityId;
- aManager.add(xCertificate, aDescription, nSecurityId, false);
+ aManager.add(xCertificate, mxSecurityContext, aDescription, nSecurityId, false);
// Read back the signature and make sure that the description survives the roundtrip.
aManager.read(/*bUseTempStream=*/true);
@@ -282,7 +286,7 @@ void SigningTest::testOOXMLAppend()
if (!xCertificate.is())
return;
sal_Int32 nSecurityId;
- aManager.add(xCertificate, OUString(), nSecurityId, false);
+ aManager.add(xCertificate, mxSecurityContext, OUString(), nSecurityId, false);
// Read back the signatures and make sure that we have the expected amount.
aManager.read(/*bUseTempStream=*/true);
@@ -589,7 +593,7 @@ void SigningTest::testXAdES()
if (!xCertificate.is())
return;
sal_Int32 nSecurityId;
- aManager.add(xCertificate, /*rDescription=*/OUString(), nSecurityId, /*bAdESCompliant=*/true);
+ aManager.add(xCertificate, mxSecurityContext, /*rDescription=*/OUString(), nSecurityId, /*bAdESCompliant=*/true);
// Write to storage.
aManager.read(/*bUseTempStream=*/true);