summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx2
-rw-r--r--xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx2
-rw-r--r--xmlsecurity/inc/xmlsecurity/biginteger.hxx4
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificatechooser.hxx24
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificateviewer.hxx78
-rw-r--r--xmlsecurity/inc/xmlsecurity/certvalidity.hxx2
-rw-r--r--xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx52
-rw-r--r--xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx18
-rw-r--r--xmlsecurity/inc/xmlsecurity/global.hrc2
-rw-r--r--xmlsecurity/inc/xmlsecurity/macrosecurity.hxx80
-rw-r--r--xmlsecurity/inc/xmlsecurity/sigstruct.hxx28
-rw-r--r--xmlsecurity/inc/xmlsecurity/stbcontrl.hxx10
-rw-r--r--xmlsecurity/inc/xmlsecurity/warnings.hxx36
-rw-r--r--xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx20
-rw-r--r--xmlsecurity/source/component/certificatecontainer.cxx50
-rw-r--r--xmlsecurity/source/component/certificatecontainer.hxx30
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx4
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.hxx24
-rw-r--r--xmlsecurity/source/component/registerservices.cxx28
-rw-r--r--xmlsecurity/source/component/warnbox.src2
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx28
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.src2
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx114
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.src2
-rw-r--r--xmlsecurity/source/dialogs/dialogs.hrc436
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx148
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc2
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.src6
-rw-r--r--xmlsecurity/source/dialogs/helpids.hrc2
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx76
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.src2
-rw-r--r--xmlsecurity/source/dialogs/resourcemanager.cxx76
-rw-r--r--xmlsecurity/source/dialogs/resourcemanager.hxx28
-rw-r--r--xmlsecurity/source/dialogs/stbcontrl.cxx44
-rw-r--r--xmlsecurity/source/dialogs/warnings.cxx62
-rw-r--r--xmlsecurity/source/dialogs/warnings.src2
-rw-r--r--xmlsecurity/source/framework/buffernode.cxx676
-rw-r--r--xmlsecurity/source/framework/buffernode.hxx42
-rw-r--r--xmlsecurity/source/framework/decryptorimpl.cxx86
-rw-r--r--xmlsecurity/source/framework/decryptorimpl.hxx56
-rw-r--r--xmlsecurity/source/framework/elementcollector.cxx150
-rw-r--r--xmlsecurity/source/framework/elementcollector.hxx28
-rw-r--r--xmlsecurity/source/framework/elementmark.cxx30
-rw-r--r--xmlsecurity/source/framework/elementmark.hxx24
-rw-r--r--xmlsecurity/source/framework/encryptionengine.cxx114
-rw-r--r--xmlsecurity/source/framework/encryptionengine.hxx30
-rw-r--r--xmlsecurity/source/framework/encryptorimpl.cxx102
-rw-r--r--xmlsecurity/source/framework/encryptorimpl.hxx58
-rw-r--r--xmlsecurity/source/framework/saxeventkeeperimpl.cxx678
-rw-r--r--xmlsecurity/source/framework/saxeventkeeperimpl.hxx202
-rw-r--r--xmlsecurity/source/framework/securityengine.cxx12
-rw-r--r--xmlsecurity/source/framework/securityengine.hxx56
-rw-r--r--xmlsecurity/source/framework/signaturecreatorimpl.cxx124
-rw-r--r--xmlsecurity/source/framework/signaturecreatorimpl.hxx62
-rw-r--r--xmlsecurity/source/framework/signatureengine.cxx136
-rw-r--r--xmlsecurity/source/framework/signatureengine.hxx36
-rw-r--r--xmlsecurity/source/framework/signatureverifierimpl.cxx92
-rw-r--r--xmlsecurity/source/framework/signatureverifierimpl.hxx58
-rw-r--r--xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx12
-rw-r--r--xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx8
-rw-r--r--xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx18
-rw-r--r--xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx8
-rw-r--r--xmlsecurity/source/framework/xsec_framework.cxx38
-rw-r--r--xmlsecurity/source/helper/documentsignaturehelper.cxx54
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx80
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper2.cxx24
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper2.hxx40
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx538
-rw-r--r--xmlsecurity/source/helper/xsecctl.hxx248
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx42
-rw-r--r--xmlsecurity/source/helper/xsecparser.hxx66
-rw-r--r--xmlsecurity/source/helper/xsecsign.cxx98
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx74
-rw-r--r--xmlsecurity/source/xmlsec/biginteger.cxx8
-rw-r--r--xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx4
-rw-r--r--xmlsecurity/source/xmlsec/certvalidity.cxx4
-rw-r--r--xmlsecurity/source/xmlsec/diagnose.cxx6
-rw-r--r--xmlsecurity/source/xmlsec/diagnose.hxx2
-rw-r--r--xmlsecurity/source/xmlsec/errorcallback.cxx240
-rw-r--r--xmlsecurity/source/xmlsec/errorcallback.hxx2
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/oid.hxx232
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx88
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx32
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx66
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx44
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx74
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx10
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx20
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx4
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx24
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx20
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx18
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx6
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx10
-rw-r--r--xmlsecurity/source/xmlsec/nss/certerrors.h18
-rw-r--r--xmlsecurity/source/xmlsec/nss/nssrenam.h16
-rw-r--r--xmlsecurity/source/xmlsec/nss/secerror.cxx10
-rw-r--r--xmlsecurity/source/xmlsec/nss/secerror.hxx4
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx132
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx18
-rw-r--r--xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx78
-rw-r--r--xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx44
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx34
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx10
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx32
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx4
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx28
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx24
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx28
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx6
-rw-r--r--xmlsecurity/source/xmlsec/nss/xsec_nss.cxx10
-rw-r--r--xmlsecurity/source/xmlsec/saxhelper.cxx106
-rw-r--r--xmlsecurity/source/xmlsec/saxhelper.hxx2
-rw-r--r--xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx498
-rw-r--r--xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx160
-rw-r--r--xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx46
-rw-r--r--xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx38
-rw-r--r--xmlsecurity/source/xmlsec/xmlstreamio.cxx34
-rw-r--r--xmlsecurity/source/xmlsec/xmlstreamio.hxx4
-rw-r--r--xmlsecurity/source/xmlsec/xsec_xmlsec.cxx20
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/build.xml20
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml4
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java4
-rw-r--r--xmlsecurity/tools/demo/JavaFlatFilter.java106
-rw-r--r--xmlsecurity/tools/demo/mozprofile.cxx12
-rw-r--r--xmlsecurity/tools/demo/multisigdemo.cxx42
-rw-r--r--xmlsecurity/tools/demo/performance.cxx730
-rw-r--r--xmlsecurity/tools/demo/signdemo.cxx32
-rw-r--r--xmlsecurity/tools/demo/util.cxx10
-rw-r--r--xmlsecurity/tools/demo/util.hxx4
-rw-r--r--xmlsecurity/tools/demo/util2.cxx72
-rw-r--r--xmlsecurity/tools/demo/verifydemo.cxx10
-rw-r--r--xmlsecurity/tools/examples/enc-1.xml8
-rw-r--r--xmlsecurity/tools/examples/enc-2.xml16
-rw-r--r--xmlsecurity/tools/examples/s-in-e-1.xml10
-rw-r--r--xmlsecurity/tools/examples/s-in-e-2.xml10
-rw-r--r--xmlsecurity/tools/standalone/csfit/certmngr.cxx8
-rw-r--r--xmlsecurity/tools/standalone/csfit/decrypter.cxx20
-rw-r--r--xmlsecurity/tools/standalone/csfit/encrypter.cxx20
-rw-r--r--xmlsecurity/tools/standalone/csfit/helper.cxx8
-rw-r--r--xmlsecurity/tools/standalone/csfit/helper.hxx8
-rw-r--r--xmlsecurity/tools/standalone/csfit/signer.cxx32
-rw-r--r--xmlsecurity/tools/standalone/csfit/verifier.cxx36
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/certmngr.cxx2
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/decrypter.cxx18
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/encrypter.cxx24
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/helper.cxx6
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/helper.hxx6
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/signer.cxx38
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/verifier.cxx42
-rw-r--r--xmlsecurity/tools/uno/AdapterNode.java72
-rw-r--r--xmlsecurity/tools/uno/AttributeListHelper.java26
-rw-r--r--xmlsecurity/tools/uno/DomToTreeModelAdapter.java78
-rw-r--r--xmlsecurity/tools/uno/EncryptionEntity.java54
-rw-r--r--xmlsecurity/tools/uno/ParsingThread.java76
-rw-r--r--xmlsecurity/tools/uno/SAXEventCollector.java60
-rw-r--r--xmlsecurity/tools/uno/SAXEventPrinter.java92
-rw-r--r--xmlsecurity/tools/uno/SecurityEntity.java44
-rw-r--r--xmlsecurity/tools/uno/SignatureEntity.java82
-rw-r--r--xmlsecurity/tools/uno/TestTool.java362
-rw-r--r--xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java40
-rw-r--r--xmlsecurity/tools/uno/XMLFileFilter.java22
-rw-r--r--xmlsecurity/tools/uno/XMLSecurityFrameworkController.java266
-rw-r--r--xmlsecurity/tools/uno/XMLTreeCellRanderer.java22
-rw-r--r--xmlsecurity/workben/signaturetest.cxx96
166 files changed, 5398 insertions, 5398 deletions
diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx
index 7aa8a6192009..92fe51505bbf 100644
--- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx
+++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx
index ade8fb78ecc0..3d8c8630b78f 100644
--- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx
+++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/inc/xmlsecurity/biginteger.hxx b/xmlsecurity/inc/xmlsecurity/biginteger.hxx
index 74d25bef987d..1103857c7ff3 100644
--- a/xmlsecurity/inc/xmlsecurity/biginteger.hxx
+++ b/xmlsecurity/inc/xmlsecurity/biginteger.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,7 +36,7 @@
#include "com/sun/star/uno/Sequence.h"
rtl::OUString bigIntegerToNumericString( ::com::sun::star::uno::Sequence< sal_Int8 > serial );
-::com::sun::star::uno::Sequence< sal_Int8 > numericStringToBigInteger ( rtl::OUString serialNumber );
+::com::sun::star::uno::Sequence< sal_Int8 > numericStringToBigInteger ( rtl::OUString serialNumber );
#endif
diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
index e74aa1f5cece..b70745032b95 100644
--- a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -60,23 +60,23 @@ private:
cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts;
SignatureInformations maCertsToIgnore;
- FixedText maHintFT;
+ FixedText maHintFT;
SvxSimpleTable maCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
- PushButton maViewBtn;
+ PushButton maViewBtn;
- FixedLine maBottomSepFL;
- OKButton maOKBtn;
+ FixedLine maBottomSepFL;
+ OKButton maOKBtn;
CancelButton maCancelBtn;
- HelpButton maHelpBtn;
+ HelpButton maHelpBtn;
- BOOL mbInitialized;
+ BOOL mbInitialized;
- USHORT GetSelectedEntryPos( void ) const;
-// DECL_LINK( Initialize, void* );
- DECL_LINK( ViewButtonHdl, Button* );
- DECL_LINK( CertificateHighlightHdl, void* );
- DECL_LINK( CertificateSelectHdl, void* );
+ USHORT GetSelectedEntryPos( void ) const;
+// DECL_LINK( Initialize, void* );
+ DECL_LINK( ViewButtonHdl, Button* );
+ DECL_LINK( CertificateHighlightHdl, void* );
+ DECL_LINK( CertificateSelectHdl, void* );
void ImplShowCertificateDetails();
void ImplInitialize();
diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
index f9031a9514ed..c35360931d57 100644
--- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -59,27 +59,27 @@ private:
friend class CertificateViewerDetailsTP;
friend class CertificateViewerCertPathTP;
- TabControl maTabCtrl;
- OKButton maOkBtn;
- HelpButton maHelpBtn;
+ TabControl maTabCtrl;
+ OKButton maOkBtn;
+ HelpButton maHelpBtn;
- BOOL mbCheckForPrivateKey;
+ BOOL mbCheckForPrivateKey;
cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
cssu::Reference< dcss::security::XCertificate > mxCert;
public:
CertificateViewer( Window* pParent, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const cssu::Reference< dcss::security::XCertificate >& rXCert, BOOL bCheckForPrivateKey );
- virtual ~CertificateViewer();
+ virtual ~CertificateViewer();
};
class CertificateViewerTP : public TabPage
{
protected:
- CertificateViewer* mpDlg;
+ CertificateViewer* mpDlg;
public:
CertificateViewerTP( Window* _pParent, const ResId& _rResId, CertificateViewer* _pDlg );
- inline void SetTabDlg( CertificateViewer* pTabDlg );
+ inline void SetTabDlg( CertificateViewer* pTabDlg );
};
inline void CertificateViewerTP::SetTabDlg( CertificateViewer* _pTabDlg )
@@ -91,23 +91,23 @@ inline void CertificateViewerTP::SetTabDlg( CertificateViewer* _pTabDlg )
class CertificateViewerGeneralTP : public CertificateViewerTP
{
private:
- Window maFrameWin;
- FixedImage maCertImg;
- FixedInfo maCertInfoFI;
- FixedLine maSep1FL;
- FixedInfo maHintNotTrustedFI;
- FixedLine maSep2FL;
- FixedInfo maIssuedToLabelFI;
- FixedInfo maIssuedToFI;
- FixedInfo maIssuedByLabelFI;
- FixedInfo maIssuedByFI;
+ Window maFrameWin;
+ FixedImage maCertImg;
+ FixedInfo maCertInfoFI;
+ FixedLine maSep1FL;
+ FixedInfo maHintNotTrustedFI;
+ FixedLine maSep2FL;
+ FixedInfo maIssuedToLabelFI;
+ FixedInfo maIssuedToFI;
+ FixedInfo maIssuedByLabelFI;
+ FixedInfo maIssuedByFI;
FixedInfo maValidDateFI;
- FixedImage maKeyImg;
- FixedInfo maHintCorrespPrivKeyFI;
+ FixedImage maKeyImg;
+ FixedInfo maHintCorrespPrivKeyFI;
public:
CertificateViewerGeneralTP( Window* pParent, CertificateViewer* _pDlg );
- virtual void ActivatePage();
+ virtual void ActivatePage();
};
@@ -115,30 +115,30 @@ class CertificateViewerDetailsTP : public CertificateViewerTP
{
private:
SvxSimpleTable maElementsLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
- MultiLineEdit maElementML;
- Font maStdFont;
- Font maFixedWidthFont;
+ MultiLineEdit maElementML;
+ Font maStdFont;
+ Font maFixedWidthFont;
- DECL_LINK( ElementSelectHdl, void* );
- void Clear( void );
- void InsertElement( const String& _rField, const String& _rValue,
+ DECL_LINK( ElementSelectHdl, void* );
+ void Clear( void );
+ void InsertElement( const String& _rField, const String& _rValue,
const String& _rDetails, bool _bFixedWidthFont = false );
public:
CertificateViewerDetailsTP( Window* pParent, CertificateViewer* _pDlg );
- virtual ~CertificateViewerDetailsTP();
+ virtual ~CertificateViewerDetailsTP();
- virtual void ActivatePage();
+ virtual void ActivatePage();
};
class CertificateViewerCertPathTP : public CertificateViewerTP
{
private:
- FixedText maCertPathFT;
- SvTreeListBox maCertPathLB;
+ FixedText maCertPathFT;
+ SvTreeListBox maCertPathLB;
PushButton maViewCertPB;
- FixedText maCertStatusFT;
- MultiLineEdit maCertStatusML;
+ FixedText maCertStatusFT;
+ MultiLineEdit maCertStatusML;
CertificateViewer* mpParent;
bool mbFirstActivateDone;
@@ -147,18 +147,18 @@ private:
String msCertOK;
String msCertNotValidated;
- DECL_LINK( ViewCertHdl, void* );
- DECL_LINK( CertSelectHdl, void* );
- void Clear( void );
- SvLBoxEntry* InsertCert( SvLBoxEntry* _pParent, const String& _rName,
+ DECL_LINK( ViewCertHdl, void* );
+ DECL_LINK( CertSelectHdl, void* );
+ void Clear( void );
+ SvLBoxEntry* InsertCert( SvLBoxEntry* _pParent, const String& _rName,
cssu::Reference< dcss::security::XCertificate > rxCert,
bool bValid);
public:
CertificateViewerCertPathTP( Window* pParent, CertificateViewer* _pDlg );
- virtual ~CertificateViewerCertPathTP();
+ virtual ~CertificateViewerCertPathTP();
- virtual void ActivatePage();
+ virtual void ActivatePage();
};
diff --git a/xmlsecurity/inc/xmlsecurity/certvalidity.hxx b/xmlsecurity/inc/xmlsecurity/certvalidity.hxx
index 837d5c29786d..f77d27f6981d 100644
--- a/xmlsecurity/inc/xmlsecurity/certvalidity.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certvalidity.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx
index 292653745f80..9084e8296ce8 100644
--- a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx
+++ b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -66,7 +66,7 @@ class DigitalSignaturesDialog : public ModalDialog
{
private:
cssu::Reference< cssu::XComponentContext >& mxCtx;
- XMLSignatureHelper maSignatureHelper;
+ XMLSignatureHelper maSignatureHelper;
css::uno::Reference < css::embed::XStorage > mxStore;
css::uno::Reference < css::io::XStream > mxSignatureStream;
@@ -74,49 +74,49 @@ private:
SignatureInformations maCurrentSignatureInformations;
bool mbVerifySignatures;
bool mbSignaturesChanged;
- DocumentSignatureMode meSignatureMode;
+ DocumentSignatureMode meSignatureMode;
css::uno::Sequence < css::uno::Sequence < css::beans::PropertyValue > > m_manifest;
- FixedText maHintDocFT;
- FixedText maHintBasicFT;
- FixedText maHintPackageFT;
+ FixedText maHintDocFT;
+ FixedText maHintBasicFT;
+ FixedText maHintPackageFT;
SvxSimpleTable maSignaturesLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
- FixedImage maSigsValidImg;
- FixedInfo maSigsValidFI;
+ FixedImage maSigsValidImg;
+ FixedInfo maSigsValidFI;
FixedImage maSigsInvalidImg;
FixedInfo maSigsInvalidFI;
FixedImage maSigsNotvalidatedImg;
FixedInfo maSigsNotvalidatedFI;
FixedInfo maSigsOldSignatureFI;
- PushButton maViewBtn;
- PushButton maAddBtn;
- PushButton maRemoveBtn;
+ PushButton maViewBtn;
+ PushButton maAddBtn;
+ PushButton maRemoveBtn;
- FixedLine maBottomSepFL;
- OKButton maOKBtn;
- HelpButton maHelpBtn;
+ FixedLine maBottomSepFL;
+ OKButton maOKBtn;
+ HelpButton maHelpBtn;
::rtl::OUString m_sODFVersion;
- //Signals if the document contains already a document signature. This is only
+ //Signals if the document contains already a document signature. This is only
//importent when we are signing macros and if the value is true.
bool m_bHasDocumentSignature;
bool m_bWarningShowSignMacro;
- DECL_LINK( ViewButtonHdl, Button* );
- DECL_LINK( AddButtonHdl, Button* );
- DECL_LINK( RemoveButtonHdl, Button* );
- DECL_LINK( SignatureHighlightHdl, void* );
- DECL_LINK( SignatureSelectHdl, void* );
- DECL_LINK( StartVerifySignatureHdl, void* );
- DECL_LINK( OKButtonHdl, void* );
+ DECL_LINK( ViewButtonHdl, Button* );
+ DECL_LINK( AddButtonHdl, Button* );
+ DECL_LINK( RemoveButtonHdl, Button* );
+ DECL_LINK( SignatureHighlightHdl, void* );
+ DECL_LINK( SignatureSelectHdl, void* );
+ DECL_LINK( StartVerifySignatureHdl, void* );
+ DECL_LINK( OKButtonHdl, void* );
void ImplGetSignatureInformations(bool bUseTempStream);
void ImplFillSignaturesBox();
void ImplShowSignaturesDetails();
SignatureStreamHelper ImplOpenSignatureStream( sal_Int32 eStreamMode, bool bTempStream );
- //Checks if adding is allowed.
+ //Checks if adding is allowed.
//See the spec at specs/www/appwide/security/Electronic_Signatures_and_Security.sxw
//(6.6.2)Behaviour with regard to ODF 1.2
bool canAdd();
@@ -128,8 +128,8 @@ private:
bool canAddRemove();
public:
- DigitalSignaturesDialog( Window* pParent, cssu::Reference<
- cssu::XComponentContext >& rxCtx, DocumentSignatureMode eMode,
+ DigitalSignaturesDialog( Window* pParent, cssu::Reference<
+ cssu::XComponentContext >& rxCtx, DocumentSignatureMode eMode,
sal_Bool bReadOnly, const ::rtl::OUString& sODFVersion, bool bHasDocumentSignature);
~DigitalSignaturesDialog();
@@ -141,7 +141,7 @@ public:
void SetSignatureStream( const cssu::Reference < css::io::XStream >& rxStream );
// Execute the dialog...
- short Execute();
+ short Execute();
// Did signatures change?
sal_Bool SignaturesChanged() const { return mbSignaturesChanged; }
diff --git a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx
index beb089060039..2f1f018297d8 100644
--- a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx
+++ b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -57,7 +57,7 @@ namespace css = com::sun::star;
Functions:
1. help to create a list of content to be signed/verified
-
+
**********************************************************/
enum DocumentSignatureMode { SignatureModeDocumentContent, SignatureModeMacros, SignatureModePackage };
@@ -80,24 +80,24 @@ class DocumentSignatureHelper
{
public:
- static SignatureStreamHelper OpenSignatureStream(
- const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode,
+ static SignatureStreamHelper OpenSignatureStream(
+ const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode,
DocumentSignatureMode eDocSigMode );
- static std::vector< rtl::OUString > CreateElementList(
- const css::uno::Reference < css::embed::XStorage >& rxStore,
- const ::rtl::OUString rRootStorageName, DocumentSignatureMode eMode,
+ static std::vector< rtl::OUString > CreateElementList(
+ const css::uno::Reference < css::embed::XStorage >& rxStore,
+ const ::rtl::OUString rRootStorageName, DocumentSignatureMode eMode,
const DocumentSignatureAlgorithm mode);
static bool isODFPre_1_2(const ::rtl::OUString & sODFVersion);
static bool isOOo3_2_Signature(const SignatureInformation & sigInfo);
static DocumentSignatureAlgorithm getDocumentAlgorithm(
const ::rtl::OUString & sODFVersion, const SignatureInformation & sigInfo);
- static bool checkIfAllFilesAreSigned( const ::std::vector< ::rtl::OUString > & sElementList,
+ static bool checkIfAllFilesAreSigned( const ::std::vector< ::rtl::OUString > & sElementList,
const SignatureInformation & sigInfo, const DocumentSignatureAlgorithm alg);
static bool equalsReferenceUriManifestPath(
const ::rtl::OUString & rUri, const ::rtl::OUString & rPath);
static ::rtl::OUString GetDocumentContentSignatureDefaultStreamName();
static ::rtl::OUString GetScriptingContentSignatureDefaultStreamName();
- static ::rtl::OUString GetPackageSignatureDefaultStreamName();
+ static ::rtl::OUString GetPackageSignatureDefaultStreamName();
};
diff --git a/xmlsecurity/inc/xmlsecurity/global.hrc b/xmlsecurity/inc/xmlsecurity/global.hrc
index 57a9a95e88b3..8761f7170573 100644
--- a/xmlsecurity/inc/xmlsecurity/global.hrc
+++ b/xmlsecurity/inc/xmlsecurity/global.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
index 46854d04d604..7ed8b292919b 100644
--- a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
+++ b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -68,25 +68,25 @@ private:
friend class MacroSecurityLevelTP;
friend class MacroSecurityTrustedSourcesTP;
- TabControl maTabCtrl;
- OKButton maOkBtn;
- CancelButton maCancelBtn;
- HelpButton maHelpBtn;
- PushButton maResetBtn;
+ TabControl maTabCtrl;
+ OKButton maOkBtn;
+ CancelButton maCancelBtn;
+ HelpButton maHelpBtn;
+ PushButton maResetBtn;
- cssu::Reference< cssu::XComponentContext > mxCtx;
- cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
- SvtSecurityOptions maSecOptions;
+ cssu::Reference< cssu::XComponentContext > mxCtx;
+ cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
+ SvtSecurityOptions maSecOptions;
- MacroSecurityTP* mpLevelTP;
- MacroSecurityTP* mpTrustSrcTP;
+ MacroSecurityTP* mpLevelTP;
+ MacroSecurityTP* mpTrustSrcTP;
- DECL_LINK( OkBtnHdl, void* );
+ DECL_LINK( OkBtnHdl, void* );
public:
MacroSecurity( Window* pParent, const cssu::Reference< cssu::XComponentContext>& rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment );
- virtual ~MacroSecurity();
+ virtual ~MacroSecurity();
- inline void EnableReset( bool _bEnable = true );
+ inline void EnableReset( bool _bEnable = true );
};
inline void MacroSecurity::EnableReset( bool _bEnable )
@@ -97,12 +97,12 @@ inline void MacroSecurity::EnableReset( bool _bEnable )
class MacroSecurityTP : public TabPage
{
protected:
- MacroSecurity* mpDlg;
+ MacroSecurity* mpDlg;
public:
MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroSecurity* _pDlg );
- inline void SetTabDlg( MacroSecurity* pTabDlg );
+ inline void SetTabDlg( MacroSecurity* pTabDlg );
- virtual void ClosePage( void ) = 0;
+ virtual void ClosePage( void ) = 0;
};
inline void MacroSecurityTP::SetTabDlg( MacroSecurity* _pTabDlg )
@@ -114,61 +114,61 @@ inline void MacroSecurityTP::SetTabDlg( MacroSecurity* _pTabDlg )
class MacroSecurityLevelTP : public MacroSecurityTP
{
private:
- FixedLine maSecLevelFL;
+ FixedLine maSecLevelFL;
ReadOnlyImage maSecReadonlyFI;
RadioButton maVeryHighRB;
- RadioButton maHighRB;
- RadioButton maMediumRB;
- RadioButton maLowRB;
+ RadioButton maHighRB;
+ RadioButton maMediumRB;
+ RadioButton maLowRB;
USHORT mnCurLevel;
protected:
- DECL_LINK( RadioButtonHdl, RadioButton* );
+ DECL_LINK( RadioButtonHdl, RadioButton* );
public:
MacroSecurityLevelTP( Window* pParent, MacroSecurity* _pDlg );
- virtual void ClosePage( void );
+ virtual void ClosePage( void );
};
class MacroSecurityTrustedSourcesTP : public MacroSecurityTP
{
private:
- FixedLine maTrustCertFL;
+ FixedLine maTrustCertFL;
ReadOnlyImage maTrustCertROFI;
SvxSimpleTable maTrustCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
- PushButton maAddCertPB;
- PushButton maViewCertPB;
- PushButton maRemoveCertPB;
- FixedLine maTrustFileLocFL;
+ PushButton maAddCertPB;
+ PushButton maViewCertPB;
+ PushButton maRemoveCertPB;
+ FixedLine maTrustFileLocFL;
ReadOnlyImage maTrustFileROFI;
FixedInfo maTrustFileLocFI;
- ListBox maTrustFileLocLB;
- PushButton maAddLocPB;
- PushButton maRemoveLocPB;
+ ListBox maTrustFileLocLB;
+ PushButton maAddLocPB;
+ PushButton maRemoveLocPB;
cssu::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors;
sal_Bool mbAuthorsReadonly;
sal_Bool mbURLsReadonly;
- DECL_LINK( ViewCertPBHdl, void* );
- DECL_LINK( RemoveCertPBHdl, void* );
- DECL_LINK( AddLocPBHdl, void* );
- DECL_LINK( RemoveLocPBHdl, void* );
- DECL_LINK( TrustCertLBSelectHdl, void* );
- DECL_LINK( TrustFileLocLBSelectHdl, void* );
+ DECL_LINK( ViewCertPBHdl, void* );
+ DECL_LINK( RemoveCertPBHdl, void* );
+ DECL_LINK( AddLocPBHdl, void* );
+ DECL_LINK( RemoveLocPBHdl, void* );
+ DECL_LINK( TrustCertLBSelectHdl, void* );
+ DECL_LINK( TrustFileLocLBSelectHdl, void* );
- void FillCertLB( void );
+ void FillCertLB( void );
void ImplCheckButtons();
public:
MacroSecurityTrustedSourcesTP( Window* pParent, MacroSecurity* _pDlg );
- virtual void ActivatePage();
- virtual void ClosePage( void );
+ virtual void ActivatePage();
+ virtual void ClosePage( void );
};
diff --git a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx
index fb1be3f86137..f3a8f293fab7 100644
--- a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx
+++ b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,27 +42,27 @@
/*
* signature status
*/
-/*
-#define STATUS_INIT 0
-#define STATUS_CREATION_SUCCEED 1
-#define STATUS_CREATION_FAIL 2
-#define STATUS_VERIFY_SUCCEED 3
-#define STATUS_VERIFY_FAIL 4
+/*
+#define STATUS_INIT 0
+#define STATUS_CREATION_SUCCEED 1
+#define STATUS_CREATION_FAIL 2
+#define STATUS_VERIFY_SUCCEED 3
+#define STATUS_VERIFY_FAIL 4
*/
/*
* type of reference
*/
-#define TYPE_SAMEDOCUMENT_REFERENCE 1
-#define TYPE_BINARYSTREAM_REFERENCE 2
-#define TYPE_XMLSTREAM_REFERENCE 3
+#define TYPE_SAMEDOCUMENT_REFERENCE 1
+#define TYPE_BINARYSTREAM_REFERENCE 2
+#define TYPE_XMLSTREAM_REFERENCE 3
struct SignatureReferenceInformation
{
sal_Int32 nType;
rtl::OUString ouURI;
rtl::OUString ouDigestValue;
-
+
SignatureReferenceInformation( sal_Int32 type, rtl::OUString uri )
{
nType = type;
@@ -90,11 +90,11 @@ struct SignatureInformation
//XML signatures are written again (unless they have been removed).
//If the date time string is converted into the DateTime structure
//then information can be lost because it only holds a fractional
- //of a second with a accuracy of one hundredth of second.
+ //of a second with a accuracy of one hundredth of second.
//If the string contains
//milli seconds (because the document was created by an application other than OOo)
//and the converted time is written back, then the string looks different
- //and the signature is broken.
+ //and the signature is broken.
rtl::OUString ouDateTime;
rtl::OUString ouSignatureId;
rtl::OUString ouPropertyId;
@@ -105,7 +105,7 @@ struct SignatureInformation
nStatus = ::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN;
nSecurityEnvironmentIndex = -1;
}
-};
+};
typedef ::std::vector< SignatureInformation > SignatureInformations;
diff --git a/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx b/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx
index 1afc073eac9f..8a3be384e394 100644
--- a/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx
+++ b/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ class XmlSecStatusBarControl : public SfxStatusBarControl
private:
struct XmlSecStatusBarControl_Impl;
- XmlSecStatusBarControl_Impl* mpImpl;
+ XmlSecStatusBarControl_Impl* mpImpl;
public:
SFX_DECL_STATUSBAR_CONTROL();
@@ -49,9 +49,9 @@ public:
XmlSecStatusBarControl( USHORT _nId, StatusBar& _rStb, SfxBindings& _rBind );
~XmlSecStatusBarControl();
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
- virtual void Paint( const UserDrawEvent& rEvt );
- virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void Paint( const UserDrawEvent& rEvt );
+ virtual void Command( const CommandEvent& rCEvt );
};
#endif
diff --git a/xmlsecurity/inc/xmlsecurity/warnings.hxx b/xmlsecurity/inc/xmlsecurity/warnings.hxx
index 8ac38118f4c0..b9bf69dd1746 100644
--- a/xmlsecurity/inc/xmlsecurity/warnings.hxx
+++ b/xmlsecurity/inc/xmlsecurity/warnings.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -58,27 +58,27 @@ private:
// XSecurityEnvironment is needed for building the certification path
cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
-// cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts;
+// cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts;
cssu::Reference< dcss::security::XCertificate > mxCert;
-// FixedImage maQuestionMarkFI;
- FixedInfo maDocNameFI;
- FixedInfo maDescr1aFI;
- FixedInfo maDescr1bFI;
- FixedInfo maSignsFI;
- PushButton maViewSignsBtn;
- FixedInfo maDescr2FI;
- CheckBox maAlwaysTrustCB;
- FixedLine maBottomSepFL;
- PushButton maEnableBtn;
- CancelButton maDisableBtn;
- HelpButton maHelpBtn;
+// FixedImage maQuestionMarkFI;
+ FixedInfo maDocNameFI;
+ FixedInfo maDescr1aFI;
+ FixedInfo maDescr1bFI;
+ FixedInfo maSignsFI;
+ PushButton maViewSignsBtn;
+ FixedInfo maDescr2FI;
+ CheckBox maAlwaysTrustCB;
+ FixedLine maBottomSepFL;
+ PushButton maEnableBtn;
+ CancelButton maDisableBtn;
+ HelpButton maHelpBtn;
- const bool mbSignedMode; // modus of dialog (signed / unsigned macros)
+ const bool mbSignedMode; // modus of dialog (signed / unsigned macros)
- DECL_LINK( ViewSignsBtnHdl, void* );
- DECL_LINK( EnableBtnHdl, void* );
-// DECL_LINK( DisableBtnHdl, void* );
+ DECL_LINK( ViewSignsBtnHdl, void* );
+ DECL_LINK( EnableBtnHdl, void* );
+// DECL_LINK( DisableBtnHdl, void* );
public:
MacroWarning( Window* pParent, cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, cssu::Reference< dcss::security::XCertificate >& _rxCert );
diff --git a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
index 9e416fe37d0f..7401f23a73ac 100644
--- a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
+++ b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -63,7 +63,7 @@ namespace embed {
struct XMLSignatureCreationResult
{
- sal_Int32 nSecurityId;
+ sal_Int32 nSecurityId;
com::sun::star::xml::crypto::SecurityOperationStatus nSignatureCreationResult;
XMLSignatureCreationResult( sal_Int32 nId, com::sun::star::xml::crypto::SecurityOperationStatus nResult )
@@ -75,7 +75,7 @@ struct XMLSignatureCreationResult
struct XMLSignatureVerifyResult
{
- sal_Int32 nSecurityId;
+ sal_Int32 nSecurityId;
com::sun::star::xml::crypto::SecurityOperationStatus nSignatureVerifyResult;
XMLSignatureVerifyResult( sal_Int32 nId, com::sun::star::xml::crypto::SecurityOperationStatus nResult )
@@ -100,7 +100,7 @@ typedef ::std::vector<XMLSignatureVerifyResult> XMLSignatureVerifyResults;
2. help to listen signature creation result;
3. help to listen signature verify result;
4. help to indicate which signature to verify.
-
+
**********************************************************/
class XMLSignatureHelper
@@ -184,19 +184,19 @@ public:
for finding the certificate apparently use memcmp - hence they fail to find the
certificate.
*/
- void SetX509Certificate(sal_Int32 nSecurityId, const rtl::OUString& ouX509IssuerName,
+ void SetX509Certificate(sal_Int32 nSecurityId, const rtl::OUString& ouX509IssuerName,
const rtl::OUString& ouX509SerialNumber, const rtl::OUString& ouX509Cert);
-
- void SetX509Certificate(sal_Int32 nSecurityId, sal_Int32 nSecurityEnvironmentIndex,
- const rtl::OUString& ouX509IssuerName, const rtl::OUString& ouX509SerialNumber,
+
+ void SetX509Certificate(sal_Int32 nSecurityId, sal_Int32 nSecurityEnvironmentIndex,
+ const rtl::OUString& ouX509IssuerName, const rtl::OUString& ouX509SerialNumber,
const rtl::OUString& ouX509Cert);
- void SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime );
+ void SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime );
void AddForSigning( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool bBinary );
bool CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler );
bool CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
bool ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream );
-
+
// MT: ??? I think only for adding/removing, not for new signatures...
// MM: Yes, but if you want to insert a new signature into an existing signature file, those function
// will be very usefull, see Mission 3 in the new "multisigdemo" program :-)
diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx
index 7759ad731686..a7a41601b66b 100644
--- a/xmlsecurity/source/component/certificatecontainer.cxx
+++ b/xmlsecurity/source/component/certificatecontainer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,13 +28,13 @@
#include "precompiled_xmlsecurity.hxx"
#include <certificatecontainer.hxx>
-
+
#include <sal/config.h>
using namespace ::com::sun::star::uno;
-sal_Bool
+sal_Bool
CertificateContainer::searchMap( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, Map &_certMap )
{
Map::iterator p = _certMap.find(url);
@@ -44,7 +44,7 @@ CertificateContainer::searchMap( const ::rtl::OUString & url, const ::rtl::OUStr
while( p != _certMap.end() )
{
ret = (sal_Bool) (*p).second.equals(certificate_name);
- if( ret )
+ if( ret )
break;
p++;
}
@@ -53,7 +53,7 @@ CertificateContainer::searchMap( const ::rtl::OUString & url, const ::rtl::OUStr
}
// -------------------------------------------------------------------
-sal_Bool
+sal_Bool
CertificateContainer::isTemporaryCertificate ( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name )
throw(::com::sun::star::uno::RuntimeException)
{
@@ -62,7 +62,7 @@ CertificateContainer::isTemporaryCertificate ( const ::rtl::OUString & url, cons
// -------------------------------------------------------------------
-sal_Bool
+sal_Bool
CertificateContainer::isCertificateTrust ( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name )
throw(::com::sun::star::uno::RuntimeException)
{
@@ -70,21 +70,21 @@ CertificateContainer::isCertificateTrust ( const ::rtl::OUString & url, const ::
}
// -------------------------------------------------------------------
-sal_Bool
+sal_Bool
CertificateContainer::addCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, ::sal_Bool trust )
throw(::com::sun::star::uno::RuntimeException)
{
certMap.insert( Map::value_type( url, certificate_name ) );
-
+
//remember that the cert is trusted
if (trust)
certTrustMap.insert( Map::value_type( url, certificate_name ) );
-
+
return true;
}
//-------------------------------------------------------------------------
-::security::CertificateContainerStatus
+::security::CertificateContainerStatus
CertificateContainer::hasCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException)
{
if ( isTemporaryCertificate( url, certificate_name ) )
@@ -100,8 +100,8 @@ CertificateContainer::hasCertificate( const ::rtl::OUString & url, const ::rtl::
}
//-------------------------------------------------------------------------
-::rtl::OUString SAL_CALL
-CertificateContainer::getImplementationName( )
+::rtl::OUString SAL_CALL
+CertificateContainer::getImplementationName( )
throw(::com::sun::star::uno::RuntimeException)
{
return impl_getStaticImplementationName();
@@ -109,8 +109,8 @@ CertificateContainer::getImplementationName( )
//-------------------------------------------------------------------------
-sal_Bool SAL_CALL
-CertificateContainer::supportsService( const ::rtl::OUString& ServiceName )
+sal_Bool SAL_CALL
+CertificateContainer::supportsService( const ::rtl::OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException)
{
if ( ServiceName.compareToAscii("com.sun.star.security.CertificateContainer") == 0 )
@@ -121,8 +121,8 @@ CertificateContainer::supportsService( const ::rtl::OUString& ServiceName )
//-------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL
-CertificateContainer::getSupportedServiceNames( )
+Sequence< ::rtl::OUString > SAL_CALL
+CertificateContainer::getSupportedServiceNames( )
throw(::com::sun::star::uno::RuntimeException)
{
return impl_getStaticSupportedServiceNames();
@@ -130,8 +130,8 @@ CertificateContainer::getSupportedServiceNames( )
//-------------------------------------------------------------------------
-Sequence< ::rtl::OUString > SAL_CALL
-CertificateContainer::impl_getStaticSupportedServiceNames( )
+Sequence< ::rtl::OUString > SAL_CALL
+CertificateContainer::impl_getStaticSupportedServiceNames( )
throw(::com::sun::star::uno::RuntimeException)
{
Sequence< ::rtl::OUString > aRet(1);
@@ -141,8 +141,8 @@ CertificateContainer::impl_getStaticSupportedServiceNames( )
//-------------------------------------------------------------------------
-::rtl::OUString SAL_CALL
-CertificateContainer::impl_getStaticImplementationName()
+::rtl::OUString SAL_CALL
+CertificateContainer::impl_getStaticImplementationName()
throw(::com::sun::star::uno::RuntimeException)
{
return ::rtl::OUString::createFromAscii("com.sun.star.security.CertificateContainer");
@@ -150,7 +150,7 @@ CertificateContainer::impl_getStaticImplementationName()
//-------------------------------------------------------------------------
-Reference< XInterface > SAL_CALL CertificateContainer::impl_createInstance( const Reference< XMultiServiceFactory >& xServiceManager )
+Reference< XInterface > SAL_CALL CertificateContainer::impl_createInstance( const Reference< XMultiServiceFactory >& xServiceManager )
throw( RuntimeException )
{
return Reference< XInterface >( *new CertificateContainer( xServiceManager ) );
@@ -158,16 +158,16 @@ Reference< XInterface > SAL_CALL CertificateContainer::impl_createInstance( cons
//-------------------------------------------------------------------------
-Reference< XSingleServiceFactory > SAL_CALL
-CertificateContainer::impl_createFactory( const Reference< XMultiServiceFactory >& ServiceManager )
+Reference< XSingleServiceFactory > SAL_CALL
+CertificateContainer::impl_createFactory( const Reference< XMultiServiceFactory >& ServiceManager )
throw(RuntimeException)
{
- Reference< XSingleServiceFactory > xReturn( ::cppu::createOneInstanceFactory( ServiceManager,
+ Reference< XSingleServiceFactory > xReturn( ::cppu::createOneInstanceFactory( ServiceManager,
CertificateContainer::impl_getStaticImplementationName(),
CertificateContainer::impl_createInstance,
CertificateContainer::impl_getStaticSupportedServiceNames()));
- return xReturn;
+ return xReturn;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/component/certificatecontainer.hxx b/xmlsecurity/source/component/certificatecontainer.hxx
index abea11bf61f0..0a0c88c6285d 100644
--- a/xmlsecurity/source/component/certificatecontainer.hxx
+++ b/xmlsecurity/source/component/certificatecontainer.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -51,43 +51,43 @@ using namespace ::com::sun::star::lang;
class CertificateContainer : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::security::XCertificateContainer >
{
private:
- typedef std::map< ::rtl::OUString, ::rtl::OUString > Map;
+ typedef std::map< ::rtl::OUString, ::rtl::OUString > Map;
Map certMap;
Map certTrustMap;
-
+
::sal_Bool SAL_CALL searchMap( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, Map &_certMap );
virtual ::sal_Bool SAL_CALL isTemporaryCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isCertificateTrust( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
-
+
public:
-
+
CertificateContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) {};
virtual ~CertificateContainer(){};
-
+
virtual ::sal_Bool SAL_CALL addCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, ::sal_Bool trust ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::security::CertificateContainerStatus SAL_CALL hasCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::security::CertificateContainerStatus SAL_CALL hasCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException);
// provide factory
- static ::rtl::OUString SAL_CALL
+ static ::rtl::OUString SAL_CALL
impl_getStaticImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
-
+
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
impl_getStaticSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
+
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ServiceManager ) throw(::com::sun::star::uno::RuntimeException);
-
+
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) throw( ::com::sun::star::uno::RuntimeException );
-
+
// XServiceInfo
- virtual ::rtl::OUString SAL_CALL
+ virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL
+ virtual ::sal_Bool SAL_CALL
supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
+
};
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index f5930feb7308..ba0d11d00ced 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -441,7 +441,7 @@ void DocumentDigitalSignatures::showCertificate(
//warning free code
//if ( aLocObj.GetProtocol() == INET_PROT_FILE && ( pBroker = ::ucbhelper::ContentBroker::get() ) )
- // xContentProvider = pBroker->getContentProviderInterface();
+ // xContentProvider = pBroker->getContentProviderInterface();
if ( aLocObj.GetProtocol() == INET_PROT_FILE)
{
pBroker = ::ucbhelper::ContentBroker::get();
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.hxx b/xmlsecurity/source/component/documentdigitalsignatures.hxx
index 3525370d10b5..204f53cf7f67 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.hxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,15 +37,15 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <xmlsecurity/documentsignaturehelper.hxx>
-namespace com { namespace sun { namespace star {
-
+namespace com { namespace sun { namespace star {
+
namespace uno {
class XComponentContext;
}
}}}
-class DocumentDigitalSignatures : public cppu::WeakImplHelper2
-<
+class DocumentDigitalSignatures : public cppu::WeakImplHelper2
+<
com::sun::star::security::XDocumentDigitalSignatures,
com::sun::star::lang::XInitialization
>
@@ -57,8 +57,8 @@ private:
//The number of arguments which were passed in XInitialization::initialize
int m_nArgumentsCount;
//Indicates if the document already contains a document signature
- bool m_bHasDocumentSignature;
-
+ bool m_bHasDocumentSignature;
+
sal_Bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException);
sal_Bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException);
com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > ImplVerifySignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode ) throw (::com::sun::star::uno::RuntimeException);
@@ -67,11 +67,11 @@ public:
DocumentDigitalSignatures( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext>& rxCtx );
// for service registration...
- static ::rtl::OUString GetImplementationName() throw (com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence < ::rtl::OUString > GetSupportedServiceNames() throw (com::sun::star::uno::RuntimeException);
-
+ static ::rtl::OUString GetImplementationName() throw (com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence < ::rtl::OUString > GetSupportedServiceNames() throw (com::sun::star::uno::RuntimeException);
+
//XInitialization
- void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
// XDocumentDigitalSignatures
@@ -96,7 +96,7 @@ public:
};
-com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL DocumentDigitalSignatures_CreateInstance(
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL DocumentDigitalSignatures_CreateInstance(
const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rCtx) throw ( com::sun::star::uno::Exception );
#endif // _XMLSECURITY_DOCUMENTDIGITALSIGNATURES_HXX
diff --git a/xmlsecurity/source/component/registerservices.cxx b/xmlsecurity/source/component/registerservices.cxx
index c9f7475abb83..36bddc967aa3 100644
--- a/xmlsecurity/source/component/registerservices.cxx
+++ b/xmlsecurity/source/component/registerservices.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -57,10 +57,10 @@ sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistr
// SERVICE DocumentDigitalSignatures
nPos = 0;
uno::Reference< registry::XRegistryKey > xNewKey(
- reinterpret_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( DocumentDigitalSignatures::GetImplementationName() ) );
-
+ reinterpret_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( DocumentDigitalSignatures::GetImplementationName() ) );
+
xNewKey = xNewKey->createKey( rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
-
+
const uno::Sequence< rtl::OUString >& rSNL = DocumentDigitalSignatures::GetSupportedServiceNames();
const rtl::OUString* pArray = rSNL.getConstArray();
for ( nPos = rSNL.getLength(); nPos--; )
@@ -69,16 +69,16 @@ sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistr
// SERVICE CertificateContainer
nPos = 0;
uno::Reference< registry::XRegistryKey > xNewKeyCertificateContainer(
- reinterpret_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( CertificateContainer::impl_getStaticImplementationName() ) );
+ reinterpret_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( CertificateContainer::impl_getStaticImplementationName() ) );
xNewKeyCertificateContainer = xNewKeyCertificateContainer->createKey( rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
-
+
const uno::Sequence< rtl::OUString >& rSNLCertificateContainer = CertificateContainer::impl_getStaticSupportedServiceNames();
const rtl::OUString* pArrayCertificateContainer = rSNLCertificateContainer.getConstArray();
for ( nPos = rSNLCertificateContainer.getLength(); nPos--; )
- xNewKeyCertificateContainer->createKey( pArrayCertificateContainer[nPos] );
-
+ xNewKeyCertificateContainer->createKey( pArrayCertificateContainer[nPos] );
+
//-----------------------------
-
+
return sal_True;
}
catch (registry::InvalidRegistryException &)
@@ -93,10 +93,10 @@ void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pService
{
void* pRet = 0;
uno::Reference< XInterface > xFactory;
-
+
//Decryptor
rtl::OUString implName = rtl::OUString::createFromAscii( pImplName );
-
+
if ( pServiceManager && implName.equals( DocumentDigitalSignatures::GetImplementationName() ) )
{
// DocumentDigitalSignatures
@@ -110,11 +110,11 @@ void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pService
// CertificateContainer
xFactory = cppu::createOneInstanceFactory(
reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- rtl::OUString::createFromAscii( pImplName ),
- CertificateContainer::impl_createInstance,
+ rtl::OUString::createFromAscii( pImplName ),
+ CertificateContainer::impl_createInstance,
CertificateContainer::impl_getStaticSupportedServiceNames() );
}
-
+
if (xFactory.is())
{
xFactory->acquire();
diff --git a/xmlsecurity/source/component/warnbox.src b/xmlsecurity/source/component/warnbox.src
index dd55cad7558b..814952d82010 100644
--- a/xmlsecurity/source/component/warnbox.src
+++ b/xmlsecurity/source/component/warnbox.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index d07f5071e618..fa82427d2fe1 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,16 +46,16 @@
/* HACK: disable some warnings for MS-C */
#ifdef _MSC_VER
-#pragma warning (disable : 4355) // 4355: this used in initializer-list
+#pragma warning (disable : 4355) // 4355: this used in initializer-list
#endif
using namespace ::com::sun::star;
-#define INVAL_SEL 0xFFFF
+#define INVAL_SEL 0xFFFF
USHORT CertificateChooser::GetSelectedEntryPos( void ) const
{
- USHORT nSel = INVAL_SEL;
+ USHORT nSel = INVAL_SEL;
SvLBoxEntry* pSel = maCertLB.FirstSelected();
if( pSel )
@@ -65,15 +65,15 @@ USHORT CertificateChooser::GetSelectedEntryPos( void ) const
}
CertificateChooser::CertificateChooser( Window* _pParent, uno::Reference< uno::XComponentContext>& _rxCtx, uno::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, const SignatureInformations& _rCertsToIgnore )
- :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTCHOOSER ) )
+ :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTCHOOSER ) )
,maCertsToIgnore( _rCertsToIgnore )
- ,maHintFT ( this, XMLSEC_RES( FT_HINT_SELECT ) )
- ,maCertLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
- ,maViewBtn ( this, XMLSEC_RES( BTN_VIEWCERT ) )
- ,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) )
- ,maOKBtn ( this, XMLSEC_RES( BTN_OK ) )
- ,maCancelBtn ( this, XMLSEC_RES( BTN_CANCEL ) )
- ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
+ ,maHintFT ( this, XMLSEC_RES( FT_HINT_SELECT ) )
+ ,maCertLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
+ ,maViewBtn ( this, XMLSEC_RES( BTN_VIEWCERT ) )
+ ,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) )
+ ,maOKBtn ( this, XMLSEC_RES( BTN_OK ) )
+ ,maCancelBtn ( this, XMLSEC_RES( BTN_CANCEL ) )
+ ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
{
static long nTabs[] = { 3, 0, 30*CS_LB_WIDTH/100, 60*CS_LB_WIDTH/100 };
maCertLB.SetTabs( &nTabs[0] );
@@ -100,7 +100,7 @@ short CertificateChooser::Execute()
{
// #i48432#
// We can't check for personal certificates before raising this dialog,
- // because the mozilla implementation throws a NoPassword exception,
+ // because the mozilla implementation throws a NoPassword exception,
// if the user pressed cancel, and also if the database does not exist!
// But in the later case, the is no password query, and the user is confused
// that nothing happens when pressing "Add..." in the SignatureDialog.
@@ -201,7 +201,7 @@ void CertificateChooser::ImplInitialize()
uno::Reference< dcss::security::XCertificate > CertificateChooser::GetSelectedCertificate()
{
uno::Reference< dcss::security::XCertificate > xCert;
- USHORT nSelected = GetSelectedEntryPos();
+ USHORT nSelected = GetSelectedEntryPos();
if ( nSelected < maCerts.getLength() )
xCert = maCerts[ nSelected ];
return xCert;
diff --git a/xmlsecurity/source/dialogs/certificatechooser.src b/xmlsecurity/source/dialogs/certificatechooser.src
index 13ce734e46df..9fa8e5ec78b6 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.src
+++ b/xmlsecurity/source/dialogs/certificatechooser.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 7980b8046cbf..10e1487b9978 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,7 +43,7 @@
/* HACK: disable some warnings for MS-C */
#ifdef _MSC_VER
-#pragma warning (disable : 4355) // 4355: this used in initializer-list
+#pragma warning (disable : 4355) // 4355: this used in initializer-list
#endif
using namespace ::com::sun::star;
@@ -72,10 +72,10 @@ CertificateViewer::CertificateViewer(
Window* _pParent,
const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment,
const cssu::Reference< dcss::security::XCertificate >& _rXCert, BOOL bCheckForPrivateKey )
- :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTVIEWER ) )
- ,maTabCtrl ( this, XMLSEC_RES( 1 ) )
- ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) )
- ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
+ :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTVIEWER ) )
+ ,maTabCtrl ( this, XMLSEC_RES( 1 ) )
+ ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) )
+ ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
{
FreeResource();
@@ -98,27 +98,27 @@ CertificateViewer::~CertificateViewer()
}
CertificateViewerTP::CertificateViewerTP( Window* _pParent, const ResId& _rResId, CertificateViewer* _pDlg )
- :TabPage ( _pParent, _rResId )
- ,mpDlg ( _pDlg )
+ :TabPage ( _pParent, _rResId )
+ ,mpDlg ( _pDlg )
{
}
CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, CertificateViewer* _pDlg )
- :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_GENERAL ), _pDlg )
- ,maFrameWin ( this, XMLSEC_RES( WIN_FRAME ) )
- ,maCertImg ( this, XMLSEC_RES( IMG_CERT ) )
- ,maCertInfoFI ( this, XMLSEC_RES( FI_CERTINFO ) )
- ,maSep1FL ( this, XMLSEC_RES( FL_SEP1 ) )
- ,maHintNotTrustedFI ( this, XMLSEC_RES( FI_HINTNOTTRUST ) )
- ,maSep2FL ( this, XMLSEC_RES( FL_SEP2 ) )
- ,maIssuedToLabelFI ( this, XMLSEC_RES( FI_ISSTOLABEL ) )
- ,maIssuedToFI ( this, XMLSEC_RES( FI_ISSTO ) )
- ,maIssuedByLabelFI ( this, XMLSEC_RES( FI_ISSBYLABEL ) )
- ,maIssuedByFI ( this, XMLSEC_RES( FI_ISSBY ) )
+ :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_GENERAL ), _pDlg )
+ ,maFrameWin ( this, XMLSEC_RES( WIN_FRAME ) )
+ ,maCertImg ( this, XMLSEC_RES( IMG_CERT ) )
+ ,maCertInfoFI ( this, XMLSEC_RES( FI_CERTINFO ) )
+ ,maSep1FL ( this, XMLSEC_RES( FL_SEP1 ) )
+ ,maHintNotTrustedFI ( this, XMLSEC_RES( FI_HINTNOTTRUST ) )
+ ,maSep2FL ( this, XMLSEC_RES( FL_SEP2 ) )
+ ,maIssuedToLabelFI ( this, XMLSEC_RES( FI_ISSTOLABEL ) )
+ ,maIssuedToFI ( this, XMLSEC_RES( FI_ISSTO ) )
+ ,maIssuedByLabelFI ( this, XMLSEC_RES( FI_ISSBYLABEL ) )
+ ,maIssuedByFI ( this, XMLSEC_RES( FI_ISSBY ) )
,maValidDateFI ( this, XMLSEC_RES( FI_VALIDDATE ) )
- ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) )
- ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) )
+ ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) )
+ ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) )
{
if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
maKeyImg.SetImage( Image( XMLSEC_RES( IMG_KEY_HC ) ) );
@@ -157,7 +157,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
maHintCorrespPrivKeyFI.SetBackground( aBack );
// make some bold
- Font aFnt( maCertInfoFI.GetFont() );
+ Font aFnt( maCertInfoFI.GetFont() );
aFnt.SetWeight( WEIGHT_BOLD );
maCertInfoFI.SetFont( aFnt );
maHintNotTrustedFI.SetFont( aFnt );
@@ -166,7 +166,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
maValidDateFI.SetFont( aFnt );
// insert data
- cssu::Reference< dcss::security::XCertificate > xCert = mpDlg->mxCert;
+ cssu::Reference< dcss::security::XCertificate > xCert = mpDlg->mxCert;
maIssuedToFI.SetText( XmlSec::GetContentPart( xCert->getSubjectName() ) );
maIssuedByFI.SetText( XmlSec::GetContentPart( xCert->getIssuerName() ) );
@@ -232,15 +232,15 @@ void CertificateViewerGeneralTP::ActivatePage()
struct Details_UserDatat
{
- String maTxt;
- bool mbFixedWidthFont;
+ String maTxt;
+ bool mbFixedWidthFont;
- inline Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont );
+ inline Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont );
};
inline Details_UserDatat::Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont )
- :maTxt ( _rTxt )
- ,mbFixedWidthFont ( _bFixedWidthFont )
+ :maTxt ( _rTxt )
+ ,mbFixedWidthFont ( _bFixedWidthFont )
{
}
@@ -248,8 +248,8 @@ inline Details_UserDatat::Details_UserDatat( const String& _rTxt, bool _bFixedWi
void CertificateViewerDetailsTP::Clear( void )
{
maElementML.SetText( String() );
- ULONG i = 0;
- SvLBoxEntry* pEntry = maElementsLB.GetEntry( i );
+ ULONG i = 0;
+ SvLBoxEntry* pEntry = maElementsLB.GetEntry( i );
while( pEntry )
{
delete ( Details_UserDatat* ) pEntry->GetUserData();
@@ -263,17 +263,17 @@ void CertificateViewerDetailsTP::Clear( void )
void CertificateViewerDetailsTP::InsertElement( const String& _rField, const String& _rValue,
const String& _rDetails, bool _bFixedWidthFont )
{
- SvLBoxEntry* pEntry = maElementsLB.InsertEntry( _rField );
+ SvLBoxEntry* pEntry = maElementsLB.InsertEntry( _rField );
maElementsLB.SetEntryText( _rValue, pEntry, 1 );
pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) );
}
CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg )
- :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg )
- ,maElementsLB ( this, XMLSEC_RES( LB_ELEMENTS ) )
- ,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) )
- ,maStdFont ( maElementML.GetControlFont() )
- ,maFixedWidthFont ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) )
+ :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg )
+ ,maElementsLB ( this, XMLSEC_RES( LB_ELEMENTS ) )
+ ,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) )
+ ,maStdFont ( maElementML.GetControlFont() )
+ ,maFixedWidthFont ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) )
{
WinBits nStyle = maElementsLB.GetStyle();
nStyle &= ~WB_HSCROLL;
@@ -281,30 +281,30 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif
maFixedWidthFont.SetHeight( maStdFont.GetHeight() );
- static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 };
+ static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 };
maElementsLB.SetTabs( &nTabs[ 0 ] );
maElementsLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) );
// fill list box
Reference< security::XCertificate > xCert = mpDlg->mxCert;
- UINT16 nLineBreak = 16;
- const char* pHexSep = " ";
- String aLBEntry;
- String aDetails;
+ UINT16 nLineBreak = 16;
+ const char* pHexSep = " ";
+ String aLBEntry;
+ String aDetails;
// --> PB 2004-10-11 #i35107# - 0 == "V1", 1 == "V2", ..., n = "V(n+1)"
aLBEntry = String::CreateFromAscii( "V" );
aLBEntry += String::CreateFromInt32( xCert->getVersion() + 1 );
// <--
InsertElement( String( XMLSEC_RES( STR_VERSION ) ), aLBEntry, aLBEntry );
- Sequence< sal_Int8 > aSeq = xCert->getSerialNumber();
+ Sequence< sal_Int8 > aSeq = xCert->getSerialNumber();
aLBEntry = XmlSec::GetHexString( aSeq, pHexSep );
aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak );
InsertElement( String( XMLSEC_RES( STR_SERIALNUM ) ), aLBEntry, aDetails, true );
- std::pair< ::rtl::OUString, ::rtl::OUString> pairIssuer =
+ std::pair< ::rtl::OUString, ::rtl::OUString> pairIssuer =
XmlSec::GetDNForCertDetailsView(xCert->getIssuerName());
aLBEntry = pairIssuer.first;
- aDetails = pairIssuer.second;
+ aDetails = pairIssuer.second;
InsertElement( String( XMLSEC_RES( STR_ISSUER ) ), aLBEntry, aDetails );
/*
aSeq = xCert->getIssuerUniqueID();
@@ -325,7 +325,7 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif
aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( aDateTime.GetTime() );
InsertElement( String( XMLSEC_RES( STR_VALIDTO ) ), aLBEntry, aLBEntry );
- std::pair< ::rtl::OUString, ::rtl::OUString > pairSubject =
+ std::pair< ::rtl::OUString, ::rtl::OUString > pairSubject =
XmlSec::GetDNForCertDetailsView(xCert->getSubjectName());
aLBEntry = pairSubject.first;
aDetails = pairSubject.second;
@@ -372,12 +372,12 @@ void CertificateViewerDetailsTP::ActivatePage()
IMPL_LINK( CertificateViewerDetailsTP, ElementSelectHdl, void*, EMPTYARG )
{
- SvLBoxEntry* pEntry = maElementsLB.FirstSelected();
- String aElementText;
- bool bFixedWidthFont;
+ SvLBoxEntry* pEntry = maElementsLB.FirstSelected();
+ String aElementText;
+ bool bFixedWidthFont;
if( pEntry )
{
- const Details_UserDatat* p = ( Details_UserDatat* ) pEntry->GetUserData();
+ const Details_UserDatat* p = ( Details_UserDatat* ) pEntry->GetUserData();
aElementText = p->maTxt;
bFixedWidthFont = p->mbFixedWidthFont;
}
@@ -394,7 +394,7 @@ IMPL_LINK( CertificateViewerDetailsTP, ElementSelectHdl, void*, EMPTYARG )
struct CertPath_UserData
{
cssu::Reference< dcss::security::XCertificate > mxCert;
- String maStatus;
+ String maStatus;
bool mbValid;
CertPath_UserData( cssu::Reference< dcss::security::XCertificate > xCert, bool bValid):
@@ -406,12 +406,12 @@ struct CertPath_UserData
CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, CertificateViewer* _pDlg )
- :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_CERTPATH ), _pDlg )
- ,maCertPathFT ( this, XMLSEC_RES( FT_CERTPATH ) )
- ,maCertPathLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
+ :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_CERTPATH ), _pDlg )
+ ,maCertPathFT ( this, XMLSEC_RES( FT_CERTPATH ) )
+ ,maCertPathLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
,maViewCertPB ( this, XMLSEC_RES( BTN_VIEWCERT ) )
- ,maCertStatusFT ( this, XMLSEC_RES( FT_CERTSTATUS ) )
- ,maCertStatusML ( this, XMLSEC_RES( ML_CERTSTATUS ) )
+ ,maCertStatusFT ( this, XMLSEC_RES( FT_CERTSTATUS ) )
+ ,maCertStatusML ( this, XMLSEC_RES( ML_CERTSTATUS ) )
,mpParent ( _pDlg )
,mbFirstActivateDone ( false )
,maCertImage ( XMLSEC_RES( IMG_CERT_SMALL ) )
@@ -526,8 +526,8 @@ IMPL_LINK( CertificateViewerCertPathTP, CertSelectHdl, void*, EMPTYARG )
void CertificateViewerCertPathTP::Clear( void )
{
maCertStatusML.SetText( String() );
- ULONG i = 0;
- SvLBoxEntry* pEntry = maCertPathLB.GetEntry( i );
+ ULONG i = 0;
+ SvLBoxEntry* pEntry = maCertPathLB.GetEntry( i );
while( pEntry )
{
delete ( CertPath_UserData* ) pEntry->GetUserData();
diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src
index 3a9466aeb9a8..19f90de45099 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.src
+++ b/xmlsecurity/source/dialogs/certificateviewer.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc
index b30eb9198e32..eb6fd0347e2a 100644
--- a/xmlsecurity/source/dialogs/dialogs.hrc
+++ b/xmlsecurity/source/dialogs/dialogs.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,53 +31,53 @@
#include <svtools/controldims.hrc>
#include <xmlsecurity/global.hrc>
-#define STD_MASKCOLOR Color{Red=0xffff;Green=0x0000;Blue=0xffff;}
+#define STD_MASKCOLOR Color{Red=0xffff;Green=0x0000;Blue=0xffff;}
-#define FL_BOTTOM_SEP 50
-#define BTN_OK 51
-#define BTN_CANCEL 52
-#define BTN_HELP 53
-#define LB_SIGNATURES 54
-#define BTN_VIEWCERT 55
-#define STR_HEADERBAR 56
-#define BTN_RESET 57
+#define FL_BOTTOM_SEP 50
+#define BTN_OK 51
+#define BTN_CANCEL 52
+#define BTN_HELP 53
+#define LB_SIGNATURES 54
+#define BTN_VIEWCERT 55
+#define STR_HEADERBAR 56
+#define BTN_RESET 57
#define STR_VALID_SIGNATURE 58
#define STR_NO_INFO_TO_VERIFY 59
#define STR_INVALID_SIGNATURE 60
// --------- general metrics ---------
-#define DLGS_WIDTH 287
-#define DLGS_HEIGHT 195
+#define DLGS_WIDTH 287
+#define DLGS_HEIGHT 195
// --------- ... for tab dialogs -----
-#define TP_WIDTH 260
-#define TP_HEIGHT 185
-#define RIDDER_HEIGHT (RSC_CD_PUSHBUTTON_HEIGHT)
-#define TD_SP_INNERBORDER_LEFT 3
-#define TD_SP_INNERBORDER_RIGHT 3
-#define TD_SP_INNERBORDER_TOP 3
-#define TD_SP_INNERBORDER_BOTTOM 3
+#define TP_WIDTH 260
+#define TP_HEIGHT 185
+#define RIDDER_HEIGHT (RSC_CD_PUSHBUTTON_HEIGHT)
+#define TD_SP_INNERBORDER_LEFT 3
+#define TD_SP_INNERBORDER_RIGHT 3
+#define TD_SP_INNERBORDER_TOP 3
+#define TD_SP_INNERBORDER_BOTTOM 3
#define TD_WIDTH (TP_WIDTH+RSC_SP_DLG_INNERBORDER_LEFT+RSC_SP_DLG_INNERBORDER_RIGHT)
-#define TD_HEIGHT (TP_HEIGHT+TD_SP_INNERBORDER_TOP+2*TD_SP_INNERBORDER_BOTTOM+RSC_CD_PUSHBUTTON_HEIGHT+RIDDER_HEIGHT)
-
-#define SEP_FL_SPACE_Y 6
-#define SEP_FL_ADJ_Y(val) (val-3)
-#define DLGS_BOTTOM_BTN_L(dlgh) (dlgh-RSC_SP_DLG_INNERBORDER_BOTTOM)
-#define DLGS_BOTTOM_BTN_Y(dlgh) (DLGS_BOTTOM_BTN_L(dlgh)-RSC_CD_PUSHBUTTON_HEIGHT)
-#define DLGS_BOTTOM_FL_Y(dlgh) (DLGS_BOTTOM_BTN_Y(dlgh)-SEP_FL_SPACE_Y-5)
-#define DLGS_BOTTOM_LAST_CTRL_L(dlgh) (DLGS_BOTTOM_BTN_Y(dlgh)-2*SEP_FL_SPACE_Y-3)
-#define DLGS_BOTTOM_HELP_X(dlgw) (dlgw-RSC_SP_DLG_INNERBORDER_RIGHT-RSC_CD_PUSHBUTTON_WIDTH)
-#define DLGS_BOTTOM_CANCEL_X(dlgw) (DLGS_BOTTOM_HELP_X(dlgw)-RSC_SP_CTRL_X-RSC_CD_PUSHBUTTON_WIDTH)
+#define TD_HEIGHT (TP_HEIGHT+TD_SP_INNERBORDER_TOP+2*TD_SP_INNERBORDER_BOTTOM+RSC_CD_PUSHBUTTON_HEIGHT+RIDDER_HEIGHT)
+
+#define SEP_FL_SPACE_Y 6
+#define SEP_FL_ADJ_Y(val) (val-3)
+#define DLGS_BOTTOM_BTN_L(dlgh) (dlgh-RSC_SP_DLG_INNERBORDER_BOTTOM)
+#define DLGS_BOTTOM_BTN_Y(dlgh) (DLGS_BOTTOM_BTN_L(dlgh)-RSC_CD_PUSHBUTTON_HEIGHT)
+#define DLGS_BOTTOM_FL_Y(dlgh) (DLGS_BOTTOM_BTN_Y(dlgh)-SEP_FL_SPACE_Y-5)
+#define DLGS_BOTTOM_LAST_CTRL_L(dlgh) (DLGS_BOTTOM_BTN_Y(dlgh)-2*SEP_FL_SPACE_Y-3)
+#define DLGS_BOTTOM_HELP_X(dlgw) (dlgw-RSC_SP_DLG_INNERBORDER_RIGHT-RSC_CD_PUSHBUTTON_WIDTH)
+#define DLGS_BOTTOM_CANCEL_X(dlgw) (DLGS_BOTTOM_HELP_X(dlgw)-RSC_SP_CTRL_X-RSC_CD_PUSHBUTTON_WIDTH)
#define DLGS_BOTTOM_OK_X(dlgw) (DLGS_BOTTOM_CANCEL_X(dlgw)-RSC_SP_CTRL_DESC_X-RSC_CD_PUSHBUTTON_WIDTH)
// --------- dialog Digital Signatures ---------
-#define BTN_ADDCERT 2
-#define BTN_REMOVECERT 3
-#define FT_HINT_DOC 4
-#define FT_HINT_BASIC 5
-#define FT_HINT_PACK 6
-#define IMG_STATE_VALID 7
-#define FI_STATE_VALID 8
+#define BTN_ADDCERT 2
+#define BTN_REMOVECERT 3
+#define FT_HINT_DOC 4
+#define FT_HINT_BASIC 5
+#define FT_HINT_PACK 6
+#define IMG_STATE_VALID 7
+#define FI_STATE_VALID 8
#define IMG_STATE_BROKEN 9
#define FI_STATE_BROKEN 10
#define IMG_STATE_NOTVALIDATED 11
@@ -87,89 +87,89 @@
#define IMG_STATE_NOTVALIDATED_HC 15
#define FI_STATE_OLDSIGNATURE 16
-//#define DS_WIDTH DLGS_WIDTH
-//#define DS_HEIGHT DLGS_HEIGHT
-#define DS_BTNWIDTH_1 70
-#define DS_BTNSPACE_X RSC_SP_CTRL_X
-#define DS_WIDTH (RSC_SP_DLG_INNERBORDER_LEFT+RSC_SP_DLG_INNERBORDER_RIGHT+2*DS_BTNSPACE_X+3*DS_BTNWIDTH_1)
-#define DS_HEIGHT (DLGS_WIDTH*2/3)
-
-#define DS_COL_0 RSC_SP_DLG_INNERBORDER_LEFT
-//#define DS_COL_MID (DS_WIDTH/2)
-//#define DS_COL_3 (DS_COL_MID-(DS_BTNWIDTH_1/2))
-//#define DS_COL_4 (DS_COL_2+DS_BTNWIDTH_1)
-//#define DS_COL_2 (DS_COL_3-DS_BTNSPACE_X)
-//#define DS_COL_1 (DS_COL_2-DS_BTNWIDTH_1)
-#define DS_COL_1 DS_COL_0
-#define DS_COL_2 (DS_COL_1+DS_BTNWIDTH_1)
-#define DS_COL_3 (DS_COL_2+DS_BTNSPACE_X)
-#define DS_COL_4 (DS_COL_3+DS_BTNWIDTH_1)
-#define DS_COL_5 (DS_COL_4+DS_BTNSPACE_X)
-//#define DS_COL_6 (DS_COL_5+DS_BTNWIDTH_1)
-#define DS_COL_7 (DS_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define DS_COL_6 DS_COL_7
-
-#define DS_ROW_0 RSC_SP_DLG_INNERBORDER_TOP
-#define DS_ROW_1 (DS_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_X)
-#define DS_ROW_7 DLGS_BOTTOM_BTN_L(DS_HEIGHT)
-#define DS_ROW_6 DLGS_BOTTOM_BTN_Y(DS_HEIGHT)
-#define DS_ROW_5 DLGS_BOTTOM_FL_Y(DS_HEIGHT)
-#define DS_ROW_4 DLGS_BOTTOM_LAST_CTRL_L(DS_HEIGHT)
-#define DS_ROW_3 (DS_ROW_4-RSC_CD_PUSHBUTTON_HEIGHT)
-#define DS_ROW_2A (DS_ROW_3-RSC_CD_FIXEDTEXT_HEIGHT-RSC_SP_CTRL_Y)
-#define DS_ROW_2 (DS_ROW_2A-RSC_SP_CTRL_GROUP_Y)
-
-#define DS_LB_WIDTH (DS_COL_7-DS_COL_0)
+//#define DS_WIDTH DLGS_WIDTH
+//#define DS_HEIGHT DLGS_HEIGHT
+#define DS_BTNWIDTH_1 70
+#define DS_BTNSPACE_X RSC_SP_CTRL_X
+#define DS_WIDTH (RSC_SP_DLG_INNERBORDER_LEFT+RSC_SP_DLG_INNERBORDER_RIGHT+2*DS_BTNSPACE_X+3*DS_BTNWIDTH_1)
+#define DS_HEIGHT (DLGS_WIDTH*2/3)
+
+#define DS_COL_0 RSC_SP_DLG_INNERBORDER_LEFT
+//#define DS_COL_MID (DS_WIDTH/2)
+//#define DS_COL_3 (DS_COL_MID-(DS_BTNWIDTH_1/2))
+//#define DS_COL_4 (DS_COL_2+DS_BTNWIDTH_1)
+//#define DS_COL_2 (DS_COL_3-DS_BTNSPACE_X)
+//#define DS_COL_1 (DS_COL_2-DS_BTNWIDTH_1)
+#define DS_COL_1 DS_COL_0
+#define DS_COL_2 (DS_COL_1+DS_BTNWIDTH_1)
+#define DS_COL_3 (DS_COL_2+DS_BTNSPACE_X)
+#define DS_COL_4 (DS_COL_3+DS_BTNWIDTH_1)
+#define DS_COL_5 (DS_COL_4+DS_BTNSPACE_X)
+//#define DS_COL_6 (DS_COL_5+DS_BTNWIDTH_1)
+#define DS_COL_7 (DS_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
+#define DS_COL_6 DS_COL_7
+
+#define DS_ROW_0 RSC_SP_DLG_INNERBORDER_TOP
+#define DS_ROW_1 (DS_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_X)
+#define DS_ROW_7 DLGS_BOTTOM_BTN_L(DS_HEIGHT)
+#define DS_ROW_6 DLGS_BOTTOM_BTN_Y(DS_HEIGHT)
+#define DS_ROW_5 DLGS_BOTTOM_FL_Y(DS_HEIGHT)
+#define DS_ROW_4 DLGS_BOTTOM_LAST_CTRL_L(DS_HEIGHT)
+#define DS_ROW_3 (DS_ROW_4-RSC_CD_PUSHBUTTON_HEIGHT)
+#define DS_ROW_2A (DS_ROW_3-RSC_CD_FIXEDTEXT_HEIGHT-RSC_SP_CTRL_Y)
+#define DS_ROW_2 (DS_ROW_2A-RSC_SP_CTRL_GROUP_Y)
+
+#define DS_LB_WIDTH (DS_COL_7-DS_COL_0)
// --------- dialog Ceritficate chooser ---------
-#define FT_HINT_SELECT 1
+#define FT_HINT_SELECT 1
-#define CS_WIDTH DLGS_WIDTH
-#define CS_HEIGHT DLGS_HEIGHT
-#define CS_BTNWIDTH_1 DS_BTNWIDTH_1
+#define CS_WIDTH DLGS_WIDTH
+#define CS_HEIGHT DLGS_HEIGHT
+#define CS_BTNWIDTH_1 DS_BTNWIDTH_1
-#define CS_COL_0 RSC_SP_DLG_INNERBORDER_LEFT
-#define CS_COL_2 (CS_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define CS_COL_1 (CS_COL_2-CS_BTNWIDTH_1)
+#define CS_COL_0 RSC_SP_DLG_INNERBORDER_LEFT
+#define CS_COL_2 (CS_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
+#define CS_COL_1 (CS_COL_2-CS_BTNWIDTH_1)
-#define CS_ROW_0 RSC_SP_DLG_INNERBORDER_TOP
-#define CS_ROW_1 (CS_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_X)
-#define CS_ROW_4 DLGS_BOTTOM_LAST_CTRL_L(CS_HEIGHT)
-#define CS_ROW_3 (CS_ROW_4-RSC_CD_PUSHBUTTON_HEIGHT)
-#define CS_ROW_2 (CS_ROW_3-RSC_SP_CTRL_Y)
+#define CS_ROW_0 RSC_SP_DLG_INNERBORDER_TOP
+#define CS_ROW_1 (CS_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_X)
+#define CS_ROW_4 DLGS_BOTTOM_LAST_CTRL_L(CS_HEIGHT)
+#define CS_ROW_3 (CS_ROW_4-RSC_CD_PUSHBUTTON_HEIGHT)
+#define CS_ROW_2 (CS_ROW_3-RSC_SP_CTRL_Y)
-#define CS_LB_WIDTH (CS_COL_2-CS_COL_0)
+#define CS_LB_WIDTH (CS_COL_2-CS_COL_0)
// --------- tab dialog Certificate viewer ---------
-#define CV_COL_0 TD_SP_INNERBORDER_LEFT
-#define CV_COL_1 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT)
-#define CV_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP
-#define CV_ROW_3 (TP_HEIGHT-RSC_SP_TBPG_INNERBORDER_BOTTOM)
-#define CV_CONT_WIDTH (CV_COL_1-CV_COL_0)
-#define CV_CONT_HEIGHT (CV_ROW_3-CV_ROW_0)
-#define CV_ROW_1 (CV_ROW_0+2*CV_CONT_HEIGHT/3)
-#define CV_ROW_2 (CV_ROW_1+RSC_SP_CTRL_GROUP_Y)
+#define CV_COL_0 TD_SP_INNERBORDER_LEFT
+#define CV_COL_1 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT)
+#define CV_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP
+#define CV_ROW_3 (TP_HEIGHT-RSC_SP_TBPG_INNERBORDER_BOTTOM)
+#define CV_CONT_WIDTH (CV_COL_1-CV_COL_0)
+#define CV_CONT_HEIGHT (CV_ROW_3-CV_ROW_0)
+#define CV_ROW_1 (CV_ROW_0+2*CV_CONT_HEIGHT/3)
+#define CV_ROW_2 (CV_ROW_1+RSC_SP_CTRL_GROUP_Y)
-#define CV_COL_D (TD_WIDTH-TD_SP_INNERBORDER_RIGHT)
-#define CV_COL_C (CV_COL_D-RSC_CD_PUSHBUTTON_WIDTH)
-#define CV_COL_B (CV_COL_C-RSC_SP_CTRL_X)
-#define CV_COL_A (CV_COL_B-RSC_CD_PUSHBUTTON_WIDTH)
+#define CV_COL_D (TD_WIDTH-TD_SP_INNERBORDER_RIGHT)
+#define CV_COL_C (CV_COL_D-RSC_CD_PUSHBUTTON_WIDTH)
+#define CV_COL_B (CV_COL_C-RSC_SP_CTRL_X)
+#define CV_COL_A (CV_COL_B-RSC_CD_PUSHBUTTON_WIDTH)
-#define CV_ROW_B (TD_HEIGHT-TD_SP_INNERBORDER_BOTTOM)
-#define CV_ROW_A (CV_ROW_B-RSC_CD_PUSHBUTTON_HEIGHT)
+#define CV_ROW_B (TD_HEIGHT-TD_SP_INNERBORDER_BOTTOM)
+#define CV_ROW_A (CV_ROW_B-RSC_CD_PUSHBUTTON_HEIGHT)
// --------- tab page Certificate viewer - General ---------
-#define WIN_FRAME 2
-#define IMG_CERT 3
-#define FI_CERTINFO 4
-#define FL_SEP1 5
-#define FI_HINTNOTTRUST 6
-#define FL_SEP2 7
-#define FI_ISSTOLABEL 8
-#define FI_ISSTO 9
-#define FI_ISSBYLABEL 10
-#define FI_ISSBY 11
+#define WIN_FRAME 2
+#define IMG_CERT 3
+#define FI_CERTINFO 4
+#define FL_SEP1 5
+#define FI_HINTNOTTRUST 6
+#define FL_SEP2 7
+#define FI_ISSTOLABEL 8
+#define FI_ISSTO 9
+#define FI_ISSBYLABEL 10
+#define FI_ISSBY 11
#define FI_VALIDDATE 12
#define IMG_KEY 13
#define FI_CORRPRIVKEY 14
@@ -179,63 +179,63 @@
#define IMG_STATE_NOT_VALIDATED_HC 18
#define IMG_KEY_HC 19
-#define IMG1_WIDTH 33
-#define IMG1_HEIGHT 22
-#define IMG2_WIDTH 20
-#define IMG2_HEIGHT 20
-#define DATE_WIDTH 30
-#define CW_COL_0 (CV_COL_0+RSC_SP_GRP_INNERBORDER_LEFT)
-#define CW_COL_1 (CW_COL_0+RSC_SP_FLGR_SPACE_X)
-#define CW_COL_1a (CW_COL_0+IMG2_WIDTH+1)
-#define CW_COL_2 (CW_COL_0+IMG1_WIDTH)
-#define CW_COL_3 (CW_COL_2+RSC_SP_CTRL_GROUP_X)
-#define CW_COL_4 (CW_COL_1+40)
-#define CW_COL_5 (CV_CONT_WIDTH-RSC_SP_GRP_INNERBORDER_RIGHT)
-#define CW_COL_5a (CW_COL_5-RSC_SP_GRP_INNERBORDER_RIGHT)
-#define CW_COL_4a (CW_COL_1+38)
-#define CW_COL_4b (CW_COL_4a+DATE_WIDTH)
-#define CW_COL_4c (CW_COL_4b+3)
-#define CW_COL_4d (CW_COL_4c+8)
-#define CW_COL_4e (CW_COL_4d+3)
-#define CW_ROW_0 (CV_ROW_0+RSC_SP_GRP_INNERBORDER_TOP)
-#define CW_ROW_1 (CW_ROW_0+RSC_SP_GRP_INNERBORDER_TOP)
-#define CW_ROW_2 (CW_ROW_0+IMG1_HEIGHT)
-#define CW_ROW_3 (CW_ROW_2+3)
-#define CW_ROW_4 (CW_ROW_3+RSC_SP_CTRL_Y+RSC_CD_FIXEDLINE_HEIGHT)
-#define CW_ROW_4a (CW_ROW_4+35)
-#define CW_ROW_5 (CW_ROW_4a+3)
-#define CW_ROW_6 (CW_ROW_5+RSC_SP_CTRL_Y+RSC_CD_FIXEDLINE_HEIGHT)
-#define CW_ROW_7 (CW_ROW_6+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
-#define CW_ROW_8 (CW_ROW_7+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
-#define CW_ROW_9 (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
-#define CW_ROW_10 (CW_ROW_9+2)
-#define CW_ROW_11 (CW_ROW_9+IMG2_HEIGHT)
+#define IMG1_WIDTH 33
+#define IMG1_HEIGHT 22
+#define IMG2_WIDTH 20
+#define IMG2_HEIGHT 20
+#define DATE_WIDTH 30
+#define CW_COL_0 (CV_COL_0+RSC_SP_GRP_INNERBORDER_LEFT)
+#define CW_COL_1 (CW_COL_0+RSC_SP_FLGR_SPACE_X)
+#define CW_COL_1a (CW_COL_0+IMG2_WIDTH+1)
+#define CW_COL_2 (CW_COL_0+IMG1_WIDTH)
+#define CW_COL_3 (CW_COL_2+RSC_SP_CTRL_GROUP_X)
+#define CW_COL_4 (CW_COL_1+40)
+#define CW_COL_5 (CV_CONT_WIDTH-RSC_SP_GRP_INNERBORDER_RIGHT)
+#define CW_COL_5a (CW_COL_5-RSC_SP_GRP_INNERBORDER_RIGHT)
+#define CW_COL_4a (CW_COL_1+38)
+#define CW_COL_4b (CW_COL_4a+DATE_WIDTH)
+#define CW_COL_4c (CW_COL_4b+3)
+#define CW_COL_4d (CW_COL_4c+8)
+#define CW_COL_4e (CW_COL_4d+3)
+#define CW_ROW_0 (CV_ROW_0+RSC_SP_GRP_INNERBORDER_TOP)
+#define CW_ROW_1 (CW_ROW_0+RSC_SP_GRP_INNERBORDER_TOP)
+#define CW_ROW_2 (CW_ROW_0+IMG1_HEIGHT)
+#define CW_ROW_3 (CW_ROW_2+3)
+#define CW_ROW_4 (CW_ROW_3+RSC_SP_CTRL_Y+RSC_CD_FIXEDLINE_HEIGHT)
+#define CW_ROW_4a (CW_ROW_4+35)
+#define CW_ROW_5 (CW_ROW_4a+3)
+#define CW_ROW_6 (CW_ROW_5+RSC_SP_CTRL_Y+RSC_CD_FIXEDLINE_HEIGHT)
+#define CW_ROW_7 (CW_ROW_6+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
+#define CW_ROW_8 (CW_ROW_7+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
+#define CW_ROW_9 (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
+#define CW_ROW_10 (CW_ROW_9+2)
+#define CW_ROW_11 (CW_ROW_9+IMG2_HEIGHT)
// --------- tab page Certificate viewer - Details ---------
-#define LB_ELEMENTS 1
-#define ML_ELEMENT 2
-
-#define STR_VERSION 1
-#define STR_SERIALNUM 2
-#define STR_SIGALGORITHM 3
-#define STR_ISSUER 4
-#define STR_ISSUER_ID 5
-#define STR_VALIDFROM 6
-#define STR_VALIDTO 7
-#define STR_SUBJECT 8
-#define STR_SUBJECT_ID 9
-#define STR_SUBJECT_PUBKEY_ALGO 10
-#define STR_SUBJECT_PUBKEY_VAL 11
-#define STR_SIGNATURE_ALGO 12
-#define STR_THUMBPRINT_SHA1 13
-#define STR_THUMBPRINT_MD5 14
+#define LB_ELEMENTS 1
+#define ML_ELEMENT 2
+
+#define STR_VERSION 1
+#define STR_SERIALNUM 2
+#define STR_SIGALGORITHM 3
+#define STR_ISSUER 4
+#define STR_ISSUER_ID 5
+#define STR_VALIDFROM 6
+#define STR_VALIDTO 7
+#define STR_SUBJECT 8
+#define STR_SUBJECT_ID 9
+#define STR_SUBJECT_PUBKEY_ALGO 10
+#define STR_SUBJECT_PUBKEY_VAL 11
+#define STR_SIGNATURE_ALGO 12
+#define STR_THUMBPRINT_SHA1 13
+#define STR_THUMBPRINT_MD5 14
// --------- tab page Certificate viewer - Certification Path ---------
-#define FT_CERTPATH 1
-#define FT_CERTSTATUS 2
-#define ML_CERTSTATUS 3
+#define FT_CERTPATH 1
+#define FT_CERTSTATUS 2
+#define ML_CERTSTATUS 3
#define IMG_CERT_SMALL 4
#define IMG_CERT_SMALL_HC 5
#define IMG_CERT_NOTVALIDATED_SMALL 6
@@ -256,30 +256,30 @@
// --------- tab dialog macro security ---------
#define MS_COL_A (TD_WIDTH-RSC_SP_DLG_INNERBORDER_LEFT)
-#define MS_COL_B (MS_COL_A-RSC_CD_PUSHBUTTON_WIDTH)
-#define MS_COL_C (MS_COL_B-RSC_SP_CTRL_X)
-#define MS_COL_D (MS_COL_C-RSC_CD_PUSHBUTTON_WIDTH)
-#define MS_COL_E (MS_COL_D-RSC_SP_CTRL_X)
-#define MS_COL_F (MS_COL_E-RSC_CD_PUSHBUTTON_WIDTH)
-#define MS_COL_G (MS_COL_F-RSC_SP_CTRL_X)
-#define MS_COL_H (MS_COL_G-RSC_CD_PUSHBUTTON_WIDTH)
+#define MS_COL_B (MS_COL_A-RSC_CD_PUSHBUTTON_WIDTH)
+#define MS_COL_C (MS_COL_B-RSC_SP_CTRL_X)
+#define MS_COL_D (MS_COL_C-RSC_CD_PUSHBUTTON_WIDTH)
+#define MS_COL_E (MS_COL_D-RSC_SP_CTRL_X)
+#define MS_COL_F (MS_COL_E-RSC_CD_PUSHBUTTON_WIDTH)
+#define MS_COL_G (MS_COL_F-RSC_SP_CTRL_X)
+#define MS_COL_H (MS_COL_G-RSC_CD_PUSHBUTTON_WIDTH)
// --------- tab page security level ---------
-#define FL_SECLEVEL 1
-#define RB_VERYHIGH 2
-#define RB_HIGH 3
-#define RB_MEDIUM 4
-#define RB_LOW 5
+#define FL_SECLEVEL 1
+#define RB_VERYHIGH 2
+#define RB_HIGH 3
+#define RB_MEDIUM 4
+#define RB_LOW 5
#define FI_SEC_READONLY 6
#define RSC_BIG_RADIOBUTTON 40
#define SL_RB_DIST_Y (RSC_SP_FLGR_SPACE_Y+RSC_BIG_RADIOBUTTON)
#define SL_COL_0 RSC_SP_TBPG_INNERBORDER_LEFT
-#define SL_COL_1 (SL_COL_0+RSC_SP_FLGR_SPACE_X)
-#define SL_COL_3 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT)
+#define SL_COL_1 (SL_COL_0+RSC_SP_FLGR_SPACE_X)
+#define SL_COL_3 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT)
#define SL_COL_2 ((SL_COL_3-SL_COL_1)*100/105)
-#define SL_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP
+#define SL_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP
#define SL_ROW_1 (SL_ROW_0+SL_RB_DIST_Y)
#define SL_ROW_2 (SL_ROW_1+SL_RB_DIST_Y)
#define SL_ROW_3 (SL_ROW_2+SL_RB_DIST_Y)
@@ -287,28 +287,28 @@
// --------- tab page trusted sources ---------
-#define FL_TRUSTCERT 1
-#define LB_TRUSTCERT 2
-#define PB_ADD_TRUSTCERT 3
-#define PB_VIEW_TRUSTCERT 4
-#define PB_REMOVE_TRUSTCERT 5
-#define FL_TRUSTFILELOC 6
-#define FI_TRUSTFILELOC 7
-#define LB_TRUSTFILELOC 8
-#define FL_ADD_TRUSTFILELOC 9
-#define FL_REMOVE_TRUSTFILELOC 10
+#define FL_TRUSTCERT 1
+#define LB_TRUSTCERT 2
+#define PB_ADD_TRUSTCERT 3
+#define PB_VIEW_TRUSTCERT 4
+#define PB_REMOVE_TRUSTCERT 5
+#define FL_TRUSTFILELOC 6
+#define FI_TRUSTFILELOC 7
+#define LB_TRUSTFILELOC 8
+#define FL_ADD_TRUSTFILELOC 9
+#define FL_REMOVE_TRUSTFILELOC 10
#define FI_TRUSTCERT_RO 11
#define FI_TRUSTFILE_RO 12
#define TS_COL_0 RSC_SP_TBPG_INNERBORDER_LEFT
-#define TS_COL_1 (TS_COL_0+RSC_SP_FLGR_SPACE_X)
+#define TS_COL_1 (TS_COL_0+RSC_SP_FLGR_SPACE_X)
#define TS_COL_8 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT)
#define TS_COL_7 (TS_COL_8-RSC_SP_FLGR_SPACE_X)
#define TS_COL_6 (TS_COL_7-RSC_CD_PUSHBUTTON_WIDTH)
-#define TS_COL_5 (TS_COL_6-RSC_SP_CTRL_GROUP_X)
-#define TS_COL_4 (TS_COL_5-RSC_CD_PUSHBUTTON_WIDTH)
-#define TS_COL_3 (TS_COL_4-RSC_SP_CTRL_GROUP_X)
-#define TS_COL_2 (TS_COL_3-RSC_CD_PUSHBUTTON_WIDTH)
+#define TS_COL_5 (TS_COL_6-RSC_SP_CTRL_GROUP_X)
+#define TS_COL_4 (TS_COL_5-RSC_CD_PUSHBUTTON_WIDTH)
+#define TS_COL_3 (TS_COL_4-RSC_SP_CTRL_GROUP_X)
+#define TS_COL_2 (TS_COL_3-RSC_CD_PUSHBUTTON_WIDTH)
#define RSC_CD_TABLISTBOX_HEIGHT 6*RSC_BS_CHARHEIGHT
#define TS_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP
@@ -324,37 +324,37 @@
// --------- signed macro warning ---------
-#define FI_DOCNAME 1
-#define FI_DESCR1A 2
-#define FI_SIGNS 3
-#define PB_VIEWSIGNS 4
-#define FI_DESCR2 5
-#define CB_ALWAYSTRUST 6
-#define PB_ENABLE 7
-#define PB_DISABLE 8
-#define FI_DESCR1B 9
-
-#define MW_WIDTH DLGS_WIDTH
-#define MW_HEIGHT DLGS_HEIGHT
-
-#define MW_SYMBOL_WIDTH (20)
-
-#define MW_COL_0 (RSC_SP_DLG_INNERBORDER_LEFT)
-#define MW_COL_1 (MW_COL_0+MW_SYMBOL_WIDTH)
-#define MW_COL_4 (MW_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define MW_COL_3 (MW_COL_4-RSC_CD_PUSHBUTTON_WIDTH)
-#define MW_COL_2 (MW_COL_3-RSC_SP_CTRL_DESC_X)
-#define MW_COL_A (DLGS_BOTTOM_OK_X(MW_WIDTH))
-#define MW_COL_C (DLGS_BOTTOM_CANCEL_X(MW_WIDTH))
-#define MW_COL_E (DLGS_BOTTOM_HELP_X(MW_WIDTH))
-#define MW_ROW_0 (RSC_SP_DLG_INNERBORDER_TOP)
-#define MW_ROW_1 (MW_ROW_0+3*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
-#define MW_ROW_2 (MW_ROW_1+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
-#define MW_ROW_7 (MW_HEIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM)
-#define MW_ROW_6 (DLGS_BOTTOM_BTN_Y(MW_HEIGHT))
-#define MW_ROW_5 (DLGS_BOTTOM_FL_Y(MW_HEIGHT))
-#define MW_ROW_4 (MW_ROW_5-RSC_CD_CHECKBOX_HEIGHT-RSC_SP_CTRL_Y)
-#define MW_ROW_3 (MW_ROW_4-4*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
+#define FI_DOCNAME 1
+#define FI_DESCR1A 2
+#define FI_SIGNS 3
+#define PB_VIEWSIGNS 4
+#define FI_DESCR2 5
+#define CB_ALWAYSTRUST 6
+#define PB_ENABLE 7
+#define PB_DISABLE 8
+#define FI_DESCR1B 9
+
+#define MW_WIDTH DLGS_WIDTH
+#define MW_HEIGHT DLGS_HEIGHT
+
+#define MW_SYMBOL_WIDTH (20)
+
+#define MW_COL_0 (RSC_SP_DLG_INNERBORDER_LEFT)
+#define MW_COL_1 (MW_COL_0+MW_SYMBOL_WIDTH)
+#define MW_COL_4 (MW_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
+#define MW_COL_3 (MW_COL_4-RSC_CD_PUSHBUTTON_WIDTH)
+#define MW_COL_2 (MW_COL_3-RSC_SP_CTRL_DESC_X)
+#define MW_COL_A (DLGS_BOTTOM_OK_X(MW_WIDTH))
+#define MW_COL_C (DLGS_BOTTOM_CANCEL_X(MW_WIDTH))
+#define MW_COL_E (DLGS_BOTTOM_HELP_X(MW_WIDTH))
+#define MW_ROW_0 (RSC_SP_DLG_INNERBORDER_TOP)
+#define MW_ROW_1 (MW_ROW_0+3*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
+#define MW_ROW_2 (MW_ROW_1+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
+#define MW_ROW_7 (MW_HEIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM)
+#define MW_ROW_6 (DLGS_BOTTOM_BTN_Y(MW_HEIGHT))
+#define MW_ROW_5 (DLGS_BOTTOM_FL_Y(MW_HEIGHT))
+#define MW_ROW_4 (MW_ROW_5-RSC_CD_CHECKBOX_HEIGHT-RSC_SP_CTRL_Y)
+#define MW_ROW_3 (MW_ROW_4-4*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
#endif
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 03abc233ab3b..301952ed9077 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -71,7 +71,7 @@
/* HACK: disable some warnings for MS-C */
#ifdef _MSC_VER
-#pragma warning (disable : 4355) // 4355: this used in initializer-list
+#pragma warning (disable : 4355) // 4355: this used in initializer-list
#endif
using namespace ::com::sun::star::security;
@@ -80,12 +80,12 @@ using namespace ::com::sun::star;
namespace css = ::com::sun::star;
using ::rtl::OUString;
-namespace
+namespace
{
class SaveODFItem: public utl::ConfigItem
{
sal_Int16 m_nODF;
- public:
+ public:
virtual void Commit();
virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
SaveODFItem();
@@ -180,31 +180,31 @@ bool DigitalSignaturesDialog::isXML(const rtl::OUString& rURI )
return bIsXML;
}
-DigitalSignaturesDialog::DigitalSignaturesDialog(
- Window* pParent,
- uno::Reference< uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode,
+DigitalSignaturesDialog::DigitalSignaturesDialog(
+ Window* pParent,
+ uno::Reference< uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode,
sal_Bool bReadOnly, const ::rtl::OUString& sODFVersion, bool bHasDocumentSignature)
- :ModalDialog ( pParent, XMLSEC_RES( RID_XMLSECDLG_DIGSIG ) )
- ,mxCtx ( rxCtx )
- ,maSignatureHelper ( rxCtx )
- ,meSignatureMode ( eMode )
- ,maHintDocFT ( this, XMLSEC_RES( FT_HINT_DOC ) )
- ,maHintBasicFT ( this, XMLSEC_RES( FT_HINT_BASIC ) )
- ,maHintPackageFT ( this, XMLSEC_RES( FT_HINT_PACK ) )
- ,maSignaturesLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
- ,maSigsValidImg ( this, XMLSEC_RES( IMG_STATE_VALID ) )
- ,maSigsValidFI ( this, XMLSEC_RES( FI_STATE_VALID ) )
- ,maSigsInvalidImg ( this, XMLSEC_RES( IMG_STATE_BROKEN ) )
+ :ModalDialog ( pParent, XMLSEC_RES( RID_XMLSECDLG_DIGSIG ) )
+ ,mxCtx ( rxCtx )
+ ,maSignatureHelper ( rxCtx )
+ ,meSignatureMode ( eMode )
+ ,maHintDocFT ( this, XMLSEC_RES( FT_HINT_DOC ) )
+ ,maHintBasicFT ( this, XMLSEC_RES( FT_HINT_BASIC ) )
+ ,maHintPackageFT ( this, XMLSEC_RES( FT_HINT_PACK ) )
+ ,maSignaturesLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
+ ,maSigsValidImg ( this, XMLSEC_RES( IMG_STATE_VALID ) )
+ ,maSigsValidFI ( this, XMLSEC_RES( FI_STATE_VALID ) )
+ ,maSigsInvalidImg ( this, XMLSEC_RES( IMG_STATE_BROKEN ) )
,maSigsInvalidFI ( this, XMLSEC_RES( FI_STATE_BROKEN ) )
,maSigsNotvalidatedImg( this, XMLSEC_RES( IMG_STATE_NOTVALIDATED ) )
,maSigsNotvalidatedFI ( this, XMLSEC_RES( FI_STATE_NOTVALIDATED ) )
,maSigsOldSignatureFI ( this, XMLSEC_RES( FI_STATE_OLDSIGNATURE) )
,maViewBtn ( this, XMLSEC_RES( BTN_VIEWCERT ) )
- ,maAddBtn ( this, XMLSEC_RES( BTN_ADDCERT ) )
- ,maRemoveBtn ( this, XMLSEC_RES( BTN_REMOVECERT ) )
- ,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) )
- ,maOKBtn ( this, XMLSEC_RES( BTN_OK ) )
- ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
+ ,maAddBtn ( this, XMLSEC_RES( BTN_ADDCERT ) )
+ ,maRemoveBtn ( this, XMLSEC_RES( BTN_REMOVECERT ) )
+ ,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) )
+ ,maOKBtn ( this, XMLSEC_RES( BTN_OK ) )
+ ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
,m_sODFVersion (sODFVersion)
,m_bHasDocumentSignature(bHasDocumentSignature)
,m_bWarningShowSignMacro(false)
@@ -251,9 +251,9 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
switch( meSignatureMode )
{
- case SignatureModeDocumentContent: maHintDocFT.Show(); break;
- case SignatureModeMacros: maHintBasicFT.Show(); break;
- case SignatureModePackage: maHintPackageFT.Show(); break;
+ case SignatureModeDocumentContent: maHintDocFT.Show(); break;
+ case SignatureModeMacros: maHintBasicFT.Show(); break;
+ case SignatureModePackage: maHintPackageFT.Show(); break;
}
// adjust fixed text to images
@@ -285,17 +285,17 @@ void DigitalSignaturesDialog::SetStorage( const com::sun::star::uno::Reference <
{
mxStore = rxStore;
maSignatureHelper.SetStorage( mxStore, m_sODFVersion);
-
+
Reference < css::packages::manifest::XManifestReader > xReader(
mxCtx->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.packages.manifest.ManifestReader"), mxCtx), UNO_QUERY_THROW);
//Get the manifest.xml
- Reference < css::embed::XStorage > xSubStore(rxStore->openStorageElement(
+ Reference < css::embed::XStorage > xSubStore(rxStore->openStorageElement(
OUSTR("META-INF"), css::embed::ElementModes::READ), UNO_QUERY_THROW);
Reference< css::io::XInputStream > xStream(
- xSubStore->openStreamElement(OUSTR("manifest.xml"), css::embed::ElementModes::READ),
+ xSubStore->openStreamElement(OUSTR("manifest.xml"), css::embed::ElementModes::READ),
UNO_QUERY_THROW);
m_manifest = xReader->readManifestSequence(xStream);
@@ -314,7 +314,7 @@ bool DigitalSignaturesDialog::canAddRemove()
bool bDoc1_1 = DocumentSignatureHelper::isODFPre_1_2(m_sODFVersion);
SaveODFItem item;
bool bSave1_1 = item.isLessODF1_2();
-
+
// see specification
//cvs: specs/www/appwide/security/Electronic_Signatures_and_Security.sxw
//Paragraph 'Behavior with regard to ODF 1.2'
@@ -325,9 +325,9 @@ bool DigitalSignaturesDialog::canAddRemove()
ErrorBox err(NULL, XMLSEC_RES(RID_XMLSECDLG_OLD_ODF_FORMAT));
err.Execute();
ret = false;
- }
+ }
- //As of OOo 3.2 the document signature includes in macrosignatures.xml. That is
+ //As of OOo 3.2 the document signature includes in macrosignatures.xml. That is
//adding a macro signature will break an existing document signature.
//The sfx2 will remove the documentsignature when the user adds a macro signature
if (meSignatureMode == SignatureModeMacros
@@ -336,7 +336,7 @@ bool DigitalSignaturesDialog::canAddRemove()
if (m_bHasDocumentSignature && !m_bWarningShowSignMacro)
{
//The warning says that the document signatures will be removed if the user
- //continues. He can then either press 'OK' or 'NO'
+ //continues. He can then either press 'OK' or 'NO'
//It the user presses 'Add' or 'Remove' several times then, then the warning
//is shown every time until the user presses 'OK'. From then on, the warning
//is not displayed anymore as long as the signatures dialog is alive.
@@ -349,7 +349,7 @@ bool DigitalSignaturesDialog::canAddRemove()
}
}
return ret;
-}
+}
bool DigitalSignaturesDialog::canAdd()
{
@@ -392,16 +392,16 @@ IMPL_LINK( DigitalSignaturesDialog, SignatureHighlightHdl, void*, EMPTYARG )
IMPL_LINK( DigitalSignaturesDialog, OKButtonHdl, void*, EMPTYARG )
{
// Export all other signatures...
- SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream(
+ SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream(
embed::ElementModes::WRITE|embed::ElementModes::TRUNCATE, false );
- uno::Reference< io::XOutputStream > xOutputStream(
+ uno::Reference< io::XOutputStream > xOutputStream(
aStreamHelper.xSignatureStream, uno::UNO_QUERY );
- uno::Reference< com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler =
+ uno::Reference< com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler =
maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream );
int nInfos = maCurrentSignatureInformations.size();
for( int n = 0 ; n < nInfos ; ++n )
- maSignatureHelper.ExportSignature(
+ maSignatureHelper.ExportSignature(
xDocumentHandler, maCurrentSignatureInformations[ n ] );
maSignatureHelper.CloseDocumentHandler( xDocumentHandler);
@@ -409,10 +409,10 @@ IMPL_LINK( DigitalSignaturesDialog, OKButtonHdl, void*, EMPTYARG )
// If stream was not provided, we are responsible for committing it....
if ( !mxSignatureStream.is() )
{
- uno::Reference< embed::XTransactedObject > xTrans(
+ uno::Reference< embed::XTransactedObject > xTrans(
aStreamHelper.xSignatureStorage, uno::UNO_QUERY );
xTrans->commit();
- }
+ }
EndDialog(RET_OK);
return 0;
@@ -438,7 +438,7 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG )
{
uno::Reference<com::sun::star::xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureHelper.GetSecurityEnvironment();
- uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
+ uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
CertificateChooser aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations );
if ( aChooser.Execute() == RET_OK )
@@ -462,13 +462,13 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG )
rtl::OUStringBuffer aStrBuffer;
SvXMLUnitConverter::encodeBase64(aStrBuffer, xCert->getEncoded());
-
+
maSignatureHelper.SetX509Certificate( nSecurityId,
- xCert->getIssuerName(), aCertSerial,
+ xCert->getIssuerName(), aCertSerial,
aStrBuffer.makeStringAndClear());
- std::vector< rtl::OUString > aElements =
- DocumentSignatureHelper::CreateElementList(
+ std::vector< rtl::OUString > aElements =
+ DocumentSignatureHelper::CreateElementList(
mxStore, rtl::OUString(), meSignatureMode, OOo3_2Document);
sal_Int32 nElements = aElements.size();
@@ -480,16 +480,16 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG )
maSignatureHelper.SetDateTime( nSecurityId, Date(), Time() );
- // We open a signature stream in which the existing and the new
+ // We open a signature stream in which the existing and the new
//signature is written. ImplGetSignatureInformation (later in this function) will
//then read the stream an will fill maCurrentSignatureInformations. The final signature
- //is written when the user presses OK. Then only maCurrentSignatureInformation and
+ //is written when the user presses OK. Then only maCurrentSignatureInformation and
//a sax writer are used to write the information.
SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream(
css::embed::ElementModes::WRITE|css::embed::ElementModes::TRUNCATE, true);
- Reference< css::io::XOutputStream > xOutputStream(
+ Reference< css::io::XOutputStream > xOutputStream(
aStreamHelper.xSignatureStream, UNO_QUERY_THROW);
- Reference< css::xml::sax::XDocumentHandler> xDocumentHandler =
+ Reference< css::xml::sax::XDocumentHandler> xDocumentHandler =
maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream );
// Export old signatures...
@@ -505,8 +505,8 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG )
maSignatureHelper.EndMission();
- aStreamHelper = SignatureStreamHelper(); // release objects...
-
+ aStreamHelper = SignatureStreamHelper(); // release objects...
+
mbSignaturesChanged = true;
sal_Int32 nStatus = maSignatureHelper.GetSignatureInformation( nSecurityId ).nStatus;
@@ -550,9 +550,9 @@ IMPL_LINK( DigitalSignaturesDialog, RemoveButtonHdl, Button*, EMPTYARG )
// Export all other signatures...
SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream(
css::embed::ElementModes::WRITE | css::embed::ElementModes::TRUNCATE, true);
- Reference< css::io::XOutputStream > xOutputStream(
+ Reference< css::io::XOutputStream > xOutputStream(
aStreamHelper.xSignatureStream, UNO_QUERY_THROW);
- Reference< css::xml::sax::XDocumentHandler> xDocumentHandler =
+ Reference< css::xml::sax::XDocumentHandler> xDocumentHandler =
maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream );
int nInfos = maCurrentSignatureInformations.size();
@@ -563,7 +563,7 @@ IMPL_LINK( DigitalSignaturesDialog, RemoveButtonHdl, Button*, EMPTYARG )
mbSignaturesChanged = true;
- aStreamHelper = SignatureStreamHelper(); // release objects...
+ aStreamHelper = SignatureStreamHelper(); // release objects...
ImplFillSignaturesBox();
}
@@ -589,7 +589,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
maSignaturesLB.Clear();
uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecEnv = maSignatureHelper.GetSecurityEnvironment();
- uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
+ uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
uno::Reference< ::com::sun::star::security::XCertificate > xCert;
@@ -605,8 +605,8 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
{
DocumentSignatureAlgorithm mode = DocumentSignatureHelper::getDocumentAlgorithm(
m_sODFVersion, maCurrentSignatureInformations[n]);
- std::vector< rtl::OUString > aElementsToBeVerified =
- DocumentSignatureHelper::CreateElementList(
+ std::vector< rtl::OUString > aElementsToBeVerified =
+ DocumentSignatureHelper::CreateElementList(
mxStore, ::rtl::OUString(), meSignatureMode, mode);
const SignatureInformation& rInfo = maCurrentSignatureInformations[n];
@@ -622,7 +622,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
//to find out if the X509IssuerName was modified does not work. See #i62684
DBG_ASSERT(sal_False, "Could not find embedded certificate!");
}
-
+
//In case there is no embedded certificate we try to get it from a local store
//Todo: This probably could be removed, see above.
if (!xCert.is())
@@ -630,9 +630,9 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
DBG_ASSERT( xCert.is(), "Certificate not found and can't be created!" );
- String aSubject;
- String aIssuer;
- String aDateTimeStr;
+ String aSubject;
+ String aIssuer;
+ String aDateTimeStr;
bool bSigValid = false;
bool bCertValid = false;
@@ -642,7 +642,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
try {
sal_Int32 certResult = xSecEnv->verifyCertificate(xCert,
Sequence<css::uno::Reference<css::security::XCertificate> >());
-
+
bCertValid = certResult == css::security::CertificateValidity::VALID ? true : false;
if ( bCertValid )
nValidCerts++;
@@ -667,7 +667,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
if( bSigValid )
nValidSigs++;
}
-
+
Image aImage;
if (!bSigValid)
{
@@ -679,7 +679,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
}
//Check if the signature is a "old" document signature, that is, which was created
//by an version of OOo previous to 3.2
- else if (meSignatureMode == SignatureModeDocumentContent
+ else if (meSignatureMode == SignatureModeDocumentContent
&& bSigValid && bCertValid && !DocumentSignatureHelper::isOOo3_2_Signature(
maCurrentSignatureInformations[n]))
{
@@ -697,19 +697,19 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
{
aImage = aImage = maSigsValidImg.GetImage();
}
-
+
SvLBoxEntry* pEntry = maSignaturesLB.InsertEntry( aNullStr, aImage, aImage );
maSignaturesLB.SetEntryText( aSubject, pEntry, 1 );
maSignaturesLB.SetEntryText( aIssuer, pEntry, 2 );
maSignaturesLB.SetEntryText( aDateTimeStr, pEntry, 3 );
- pEntry->SetUserData( ( void* ) n ); // missuse user data as index
+ pEntry->SetUserData( ( void* ) n ); // missuse user data as index
}
}
bool bAllSigsValid = (nValidSigs == nInfos);
bool bAllCertsValid = (nValidCerts == nInfos);
bool bShowValidState = nInfos && (bAllSigsValid && bAllCertsValid && bAllNewSignatures);
-
+
bool bShowNotValidatedState = nInfos && (bAllSigsValid && (!bAllCertsValid || !bAllNewSignatures));
bool bShowInvalidState = nInfos && !bAllSigsValid;
@@ -754,10 +754,10 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
if( maSignaturesLB.FirstSelected() )
{
USHORT nSelected = (USHORT) (sal_uIntPtr) maSignaturesLB.FirstSelected()->GetUserData();
- const SignatureInformation& rInfo = maCurrentSignatureInformations[ nSelected ];
+ const SignatureInformation& rInfo = maCurrentSignatureInformations[ nSelected ];
css::uno::Reference<css::xml::crypto::XSecurityEnvironment > xSecEnv =
maSignatureHelper.GetSecurityEnvironment();
- css::uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
+ css::uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
// Use Certificate from doc, not from key store
uno::Reference< dcss::security::XCertificate > xCert;
@@ -780,7 +780,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
//signature stream is used.
//Everytime the user presses Add a new temporary stream is created.
//We keep the temporary stream as member because ImplGetSignatureInformations
-//will later access the stream to create DocumentSignatureInformation objects
+//will later access the stream to create DocumentSignatureInformation objects
//which are stored in maCurrentSignatureInformations.
SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream(
sal_Int32 nStreamOpenMode, bool bTempStream)
@@ -791,7 +791,7 @@ SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream(
if (nStreamOpenMode & css::embed::ElementModes::TRUNCATE)
{
//We write always into a new temporary stream.
- mxTempSignatureStream = Reference < css::io::XStream >(
+ mxTempSignatureStream = Reference < css::io::XStream >(
mxCtx->getServiceManager()->createInstanceWithContext(
OUSTR( "com.sun.star.io.TempFile" ), mxCtx) ,
UNO_QUERY_THROW);
@@ -799,7 +799,7 @@ SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream(
}
else
{
- //When we read from the temp stream, then we must have previously
+ //When we read from the temp stream, then we must have previously
//created one.
OSL_ASSERT(mxTempSignatureStream.is());
}
@@ -813,7 +813,7 @@ SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream(
//We may not have a dedicated stream for writing the signature
//So we take one directly from the storage
//Or DocumentDigitalSignatures::showDocumentContentSignatures was called,
- //in which case Add/Remove is not allowed. This is done, for example, if the
+ //in which case Add/Remove is not allowed. This is done, for example, if the
//document is readonly
aHelper = DocumentSignatureHelper::OpenSignatureStream(
mxStore, nStreamOpenMode, meSignatureMode );
@@ -826,7 +826,7 @@ SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream(
if (nStreamOpenMode & css::embed::ElementModes::TRUNCATE)
{
- css::uno::Reference < css::io::XTruncate > xTruncate(
+ css::uno::Reference < css::io::XTruncate > xTruncate(
aHelper.xSignatureStream, UNO_QUERY_THROW);
DBG_ASSERT( xTruncate.is(), "ImplOpenSignatureStream - Stream does not support xTruncate!" );
xTruncate->truncate();
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
index d63b44834f2c..98cb51782d97 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
index 87d2de520103..fcdc60bee5f4 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -85,7 +85,7 @@ ModalDialog RID_XMLSECDLG_DIGSIG
{
Text [ en-US ] = "The signatures in this document are invalid";
};
-
+
FixedImage IMG_STATE_VALID
{
Pos = MAP_APPFONT( 6, 127 );
@@ -200,7 +200,7 @@ ErrorBox RID_XMLSECDLG_OLD_ODF_FORMAT
{
Buttons = WB_OK ;
DefButton = WB_DEF_OK ;
- Message [ en-US ] =
+ Message [ en-US ] =
"This document contains signatures in ODF 1.1 (OpenOffice.org 2.x) format. "
"Signing documents in %PRODUCTNAME %PRODUCTVERSION requires ODF 1.2 format version. "
"Thus no signatures can be added or removed to this document.\n\n"
diff --git a/xmlsecurity/source/dialogs/helpids.hrc b/xmlsecurity/source/dialogs/helpids.hrc
index 6456dddb47b9..4b0329de3eb3 100644
--- a/xmlsecurity/source/dialogs/helpids.hrc
+++ b/xmlsecurity/source/dialogs/helpids.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index e9474b4b957b..3bacce05c045 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -57,7 +57,7 @@
/* HACK: disable some warnings for MS-C */
#ifdef _MSC_VER
-#pragma warning (disable : 4355) // 4355: this used in initializer-list
+#pragma warning (disable : 4355) // 4355: this used in initializer-list
#endif
using namespace ::com::sun::star;
@@ -74,12 +74,12 @@ IMPL_LINK( MacroSecurity, OkBtnHdl, void*, EMPTYARG )
}
MacroSecurity::MacroSecurity( Window* _pParent, const cssu::Reference< cssu::XComponentContext> &_rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment )
- :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROSEC ) )
- ,maTabCtrl ( this, XMLSEC_RES( 1 ) )
- ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) )
- ,maCancelBtn ( this, XMLSEC_RES( BTN_CANCEL ) )
- ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
- ,maResetBtn ( this, XMLSEC_RES( BTN_RESET ) )
+ :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROSEC ) )
+ ,maTabCtrl ( this, XMLSEC_RES( 1 ) )
+ ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) )
+ ,maCancelBtn ( this, XMLSEC_RES( BTN_CANCEL ) )
+ ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
+ ,maResetBtn ( this, XMLSEC_RES( BTN_RESET ) )
{
FreeResource();
@@ -104,19 +104,19 @@ MacroSecurity::~MacroSecurity()
MacroSecurityTP::MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroSecurity* _pDlg )
- :TabPage ( _pParent, _rResId )
- ,mpDlg ( _pDlg )
+ :TabPage ( _pParent, _rResId )
+ ,mpDlg ( _pDlg )
{
}
MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pDlg )
- :MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_SECLEVEL ), _pDlg )
- ,maSecLevelFL ( this, XMLSEC_RES( FL_SECLEVEL ) )
+ :MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_SECLEVEL ), _pDlg )
+ ,maSecLevelFL ( this, XMLSEC_RES( FL_SECLEVEL ) )
,maSecReadonlyFI ( this, XMLSEC_RES( FI_SEC_READONLY ))
,maVeryHighRB ( this, XMLSEC_RES( RB_VERYHIGH ) )
- ,maHighRB ( this, XMLSEC_RES( RB_HIGH ) )
- ,maMediumRB ( this, XMLSEC_RES( RB_MEDIUM ) )
- ,maLowRB ( this, XMLSEC_RES( RB_LOW ) )
+ ,maHighRB ( this, XMLSEC_RES( RB_HIGH ) )
+ ,maMediumRB ( this, XMLSEC_RES( RB_MEDIUM ) )
+ ,maLowRB ( this, XMLSEC_RES( RB_LOW ) )
{
FreeResource();
@@ -141,18 +141,18 @@ MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pD
else
{
DBG_ERROR("illegal macro security level");
- }
+ }
maSecReadonlyFI.Show(bReadonly);
if(bReadonly)
{
//move to the selected button
if( pCheck && pCheck != &maVeryHighRB)
- {
+ {
long nDiff = pCheck->GetPosPixel().Y() - maVeryHighRB.GetPosPixel().Y();
Point aPos(maSecReadonlyFI.GetPosPixel());
aPos.Y() += nDiff;
maSecReadonlyFI.SetPosPixel(aPos);
- }
+ }
maVeryHighRB.Enable(sal_False);
maHighRB.Enable(sal_False);
maMediumRB.Enable(sal_False);
@@ -279,7 +279,7 @@ IMPL_LINK( MacroSecurityTrustedSourcesTP, AddLocPBHdl, void*, EMPTYARG )
IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, void*, EMPTYARG )
{
- USHORT nSel = maTrustFileLocLB.GetSelectEntryPos();
+ USHORT nSel = maTrustFileLocLB.GetSelectEntryPos();
if( nSel != LISTBOX_ENTRY_NOTFOUND )
{
maTrustFileLocLB.RemoveEntry( nSel );
@@ -321,8 +321,8 @@ void MacroSecurityTrustedSourcesTP::FillCertLB( void )
{
for( sal_uInt32 nEntry = 0 ; nEntry < nEntries ; ++nEntry )
{
- cssu::Sequence< ::rtl::OUString >& rEntry = maTrustedAuthors[ nEntry ];
- uno::Reference< css::security::XCertificate > xCert;
+ cssu::Sequence< ::rtl::OUString >& rEntry = maTrustedAuthors[ nEntry ];
+ uno::Reference< css::security::XCertificate > xCert;
// create from RawData
xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( rEntry[ 2 ] );
@@ -330,34 +330,34 @@ void MacroSecurityTrustedSourcesTP::FillCertLB( void )
SvLBoxEntry* pLBEntry = maTrustCertLB.InsertEntry( XmlSec::GetContentPart( xCert->getSubjectName() ) );
maTrustCertLB.SetEntryText( XmlSec::GetContentPart( xCert->getIssuerName() ), pLBEntry, 1 );
maTrustCertLB.SetEntryText( XmlSec::GetDateTimeString( xCert->getNotValidAfter() ), pLBEntry, 2 );
- pLBEntry->SetUserData( ( void* ) sal_Int32( nEntry ) ); // missuse user data as index
+ pLBEntry->SetUserData( ( void* ) sal_Int32( nEntry ) ); // missuse user data as index
}
}
}
MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent, MacroSecurity* _pDlg )
- :MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_TRUSTSOURCES ), _pDlg )
- ,maTrustCertFL ( this, XMLSEC_RES( FL_TRUSTCERT ) )
+ :MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_TRUSTSOURCES ), _pDlg )
+ ,maTrustCertFL ( this, XMLSEC_RES( FL_TRUSTCERT ) )
,maTrustCertROFI ( this, XMLSEC_RES( FI_TRUSTCERT_RO ) )
,maTrustCertLB ( this, XMLSEC_RES( LB_TRUSTCERT ) )
- ,maAddCertPB ( this, XMLSEC_RES( PB_ADD_TRUSTCERT ) )
- ,maViewCertPB ( this, XMLSEC_RES( PB_VIEW_TRUSTCERT ) )
- ,maRemoveCertPB ( this, XMLSEC_RES( PB_REMOVE_TRUSTCERT ) )
- ,maTrustFileLocFL ( this, XMLSEC_RES( FL_TRUSTFILELOC ) )
+ ,maAddCertPB ( this, XMLSEC_RES( PB_ADD_TRUSTCERT ) )
+ ,maViewCertPB ( this, XMLSEC_RES( PB_VIEW_TRUSTCERT ) )
+ ,maRemoveCertPB ( this, XMLSEC_RES( PB_REMOVE_TRUSTCERT ) )
+ ,maTrustFileLocFL ( this, XMLSEC_RES( FL_TRUSTFILELOC ) )
,maTrustFileROFI ( this, XMLSEC_RES( FI_TRUSTFILE_RO ) )
,maTrustFileLocFI ( this, XMLSEC_RES( FI_TRUSTFILELOC ) )
- ,maTrustFileLocLB ( this, XMLSEC_RES( LB_TRUSTFILELOC ) )
- ,maAddLocPB ( this, XMLSEC_RES( FL_ADD_TRUSTFILELOC ) )
- ,maRemoveLocPB ( this, XMLSEC_RES( FL_REMOVE_TRUSTFILELOC ) )
+ ,maTrustFileLocLB ( this, XMLSEC_RES( LB_TRUSTFILELOC ) )
+ ,maAddLocPB ( this, XMLSEC_RES( FL_ADD_TRUSTFILELOC ) )
+ ,maRemoveLocPB ( this, XMLSEC_RES( FL_REMOVE_TRUSTFILELOC ) )
{
- static long nTabs[] = { 3, 0, 35*CS_LB_WIDTH/100, 70*CS_LB_WIDTH/100 };
+ static long nTabs[] = { 3, 0, 35*CS_LB_WIDTH/100, 70*CS_LB_WIDTH/100 };
maTrustCertLB.SetTabs( &nTabs[ 0 ] );
maTrustCertLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) );
FreeResource();
maTrustCertLB.SetSelectHdl( LINK( this, MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl ) );
- maAddCertPB.Hide(); // not used in the moment...
+ maAddCertPB.Hide(); // not used in the moment...
maViewCertPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, ViewCertPBHdl ) );
maViewCertPB.Disable();
maRemoveCertPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, RemoveCertPBHdl ) );
@@ -372,12 +372,12 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent,
mbAuthorsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS );
maTrustCertROFI.Show( mbAuthorsReadonly );
mbAuthorsReadonly ? maTrustCertLB.DisableTable() : maTrustCertLB.EnableTable();
-// unused button
+// unused button
// maAddCertPB.Enable( !mbAuthorsReadonly );
FillCertLB();
- cssu::Sequence< rtl::OUString > aSecureURLs = mpDlg->maSecOptions.GetSecureURLs();
+ cssu::Sequence< rtl::OUString > aSecureURLs = mpDlg->maSecOptions.GetSecureURLs();
mbURLsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_SECUREURLS );
maTrustFileROFI.Show( mbURLsReadonly );
maTrustFileLocLB.Enable( !mbURLsReadonly );
@@ -400,10 +400,10 @@ void MacroSecurityTrustedSourcesTP::ActivatePage()
void MacroSecurityTrustedSourcesTP::ClosePage( void )
{
- USHORT nEntryCnt = maTrustFileLocLB.GetEntryCount();
+ USHORT nEntryCnt = maTrustFileLocLB.GetEntryCount();
if( nEntryCnt )
{
- cssu::Sequence< rtl::OUString > aSecureURLs( nEntryCnt );
+ cssu::Sequence< rtl::OUString > aSecureURLs( nEntryCnt );
for( USHORT i = 0 ; i < nEntryCnt ; ++i )
{
::rtl::OUString aURL( maTrustFileLocLB.GetEntry( i ) );
@@ -450,7 +450,7 @@ void ReadOnlyImage::RequestHelp( const HelpEvent& rHEvt )
String aStr(ReadOnlyImage::GetHelpTip());
if ( Help::IsBalloonHelpEnabled() )
- Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aScreenRect,
+ Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aScreenRect,
aStr );
else if ( Help::IsQuickHelpEnabled() )
Help::ShowQuickHelp( this, aScreenRect, aStr );
diff --git a/xmlsecurity/source/dialogs/macrosecurity.src b/xmlsecurity/source/dialogs/macrosecurity.src
index 0683606f500c..9e7411ef92c2 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.src
+++ b/xmlsecurity/source/dialogs/macrosecurity.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx
index 2bb2bd1fa262..4022f497e98e 100644
--- a/xmlsecurity/source/dialogs/resourcemanager.cxx
+++ b/xmlsecurity/source/dialogs/resourcemanager.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -45,17 +45,17 @@ using namespace std;
namespace XmlSec
{
- static ResMgr* pResMgr = 0;
+ static ResMgr* pResMgr = 0;
static SvtSysLocale* pSysLocale = 0;
ResMgr* GetResMgr( void )
{
if( !pResMgr )
{
- ByteString aName( "xmlsec" );
-// pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), Application::GetSettings().GetUILanguage() );
-// LanguageType aLang( LANGUAGE_ENGLISH_US );
-// pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), aLang );
+ ByteString aName( "xmlsec" );
+// pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), Application::GetSettings().GetUILanguage() );
+// LanguageType aLang( LANGUAGE_ENGLISH_US );
+// pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), aLang );
// MT: Change to Locale
pResMgr = ResMgr::CreateResMgr( aName.GetBuffer() );
}
@@ -114,11 +114,11 @@ namespace XmlSec
}
/*
- Creates two strings based on the distinguished name which are displayed in the
+ Creates two strings based on the distinguished name which are displayed in the
certificate details view. The first string contains only the values of the attribute
and valudes pairs, which are separated by commas. All escape characters ('"') are
removed.
- The second string is for the details view at the bottom. It shows the attribute/value
+ The second string is for the details view at the bottom. It shows the attribute/value
pairs on different lines. All escape characters ('"') are removed.
*/
pair< OUString, OUString> GetDNForCertDetailsView( const OUString & rRawString)
@@ -141,11 +141,11 @@ namespace XmlSec
}
return make_pair(s1.makeStringAndClear(), s2.makeStringAndClear());
}
-
+
/*
Whenever the attribute value contains special characters, such as '"' or ',' (without '')
then the value will be enclosed in double quotes by the respective Windows or NSS function
- which we use to retrieve, for example, the subject name. If double quotes appear in the value then
+ which we use to retrieve, for example, the subject name. If double quotes appear in the value then
they are escaped with a double quote. This function removes the escape characters.
*/
#ifdef WNT
@@ -163,7 +163,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
for (sal_Int32 i = 0; i < length; i++)
{
sal_Unicode c = rRawString[i];
-
+
if (c == '=')
{
if (! bInValue)
@@ -181,9 +181,9 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
{
if (!bInEscape)
{
- //If this is the quote is the first of the couple which enclose the
+ //If this is the quote is the first of the couple which enclose the
//whole value, because the value contains special characters
- //then we just drop it. That is, this character must be followed by
+ //then we just drop it. That is, this character must be followed by
//a character which is not '"'.
if ( i + 1 < length && rRawString[i+1] == '"')
bInEscape = true;
@@ -192,7 +192,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
}
else
{
- //This quote is escaped by a preceding quote and therefore is
+ //This quote is escaped by a preceding quote and therefore is
//part of the value
sbufValue.append(c);
bInEscape = false;
@@ -200,8 +200,8 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
}
else if (c == ',' || c == '+')
{
- //The comma separate the attribute value pairs.
- //If the comma is not part of a value (the value would then be enclosed in '"'),
+ //The comma separate the attribute value pairs.
+ //If the comma is not part of a value (the value would then be enclosed in '"'),
//then we have reached the end of the value
if (!bInValue)
{
@@ -215,7 +215,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
else
{
//The whole string is enclosed because it contains special characters.
- //The enclosing '"' are not part of certificate but will be added by
+ //The enclosing '"' are not part of certificate but will be added by
//the function (Windows or NSS) which retrieves DN
sbufValue.append(c);
}
@@ -249,7 +249,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
for (sal_Int32 i = 0; i < length; i++)
{
sal_Unicode c = rRawString[i];
-
+
if (c == '=')
{
if (! bInValue)
@@ -273,7 +273,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
{ // bInEscape is true
sbufValue.append(c);
bInEscape = false;
- }
+ }
}
else if (c == '"')
{
@@ -287,7 +287,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
}
else
{
- //This quote is escaped by a preceding quote and therefore is
+ //This quote is escaped by a preceding quote and therefore is
//part of the value
sbufValue.append(c);
bInEscape = false;
@@ -295,8 +295,8 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
}
else if (c == ',' || c == '+')
{
- //The comma separate the attribute value pairs.
- //If the comma is not part of a value (the value would then be enclosed in '"'),
+ //The comma separate the attribute value pairs.
+ //If the comma is not part of a value (the value would then be enclosed in '"'),
//then we have reached the end of the value
if (!bInValue)
{
@@ -310,7 +310,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
else
{
//The whole string is enclosed because it contains special characters.
- //The enclosing '"' are not part of certificate but will be added by
+ //The enclosing '"' are not part of certificate but will be added by
//the function (Windows or NSS) which retrieves DN
sbufValue.append(c);
}
@@ -360,14 +360,14 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
String GetHexString( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rSeq, const char* _pSep, UINT16 _nLineBreak )
{
- const sal_Int8* pSerNumSeq = _rSeq.getConstArray();
- int nCnt = _rSeq.getLength();
- String aStr;
- const char pHexDigs[ 17 ] = "0123456789ABCDEF";
- char pBuffer[ 3 ] = " ";
- UINT8 nNum;
- UINT16 nBreakStart = _nLineBreak? _nLineBreak : 1;
- UINT16 nBreak = nBreakStart;
+ const sal_Int8* pSerNumSeq = _rSeq.getConstArray();
+ int nCnt = _rSeq.getLength();
+ String aStr;
+ const char pHexDigs[ 17 ] = "0123456789ABCDEF";
+ char pBuffer[ 3 ] = " ";
+ UINT8 nNum;
+ UINT16 nBreakStart = _nLineBreak? _nLineBreak : 1;
+ UINT16 nBreak = nBreakStart;
for( int i = 0 ; i < nCnt ; ++i )
{
nNum = UINT8( pSerNumSeq[ i ] );
@@ -393,8 +393,8 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
long ShrinkToFitWidth( Control& _rCtrl, long _nOffs )
{
- long nWidth = _rCtrl.GetTextWidth( _rCtrl.GetText() );
- Size aSize( _rCtrl.GetSizePixel() );
+ long nWidth = _rCtrl.GetTextWidth( _rCtrl.GetText() );
+ Size aSize( _rCtrl.GetSizePixel() );
nWidth += _nOffs;
aSize.Width() = nWidth;
_rCtrl.SetSizePixel( aSize );
@@ -403,15 +403,15 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
void AlignAfterImage( const FixedImage& _rImage, Control& _rCtrl, long _nXOffset )
{
- Point aPos( _rImage.GetPosPixel() );
- Size aSize( _rImage.GetSizePixel() );
- long n = aPos.X();
+ Point aPos( _rImage.GetPosPixel() );
+ Size aSize( _rImage.GetSizePixel() );
+ long n = aPos.X();
n += aSize.Width();
n += _nXOffset;
aPos.X() = n;
n = aPos.Y();
- n += aSize.Height() / 2; // y-position is in the middle of the image
- n -= _rCtrl.GetSizePixel().Height() / 2; // center Control
+ n += aSize.Height() / 2; // y-position is in the middle of the image
+ n -= _rCtrl.GetSizePixel().Height() / 2; // center Control
aPos.Y() = n;
_rCtrl.SetPosPixel( aPos );
}
diff --git a/xmlsecurity/source/dialogs/resourcemanager.hxx b/xmlsecurity/source/dialogs/resourcemanager.hxx
index ffea19c9a0a8..3f3e552eb8b4 100644
--- a/xmlsecurity/source/dialogs/resourcemanager.hxx
+++ b/xmlsecurity/source/dialogs/resourcemanager.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,29 +43,29 @@ class LocaleDataWrapper;
namespace XmlSec
{
- ResMgr* GetResMgr( void );
+ ResMgr* GetResMgr( void );
const LocaleDataWrapper& GetLocaleData( void );
- DateTime GetDateTime( const ::com::sun::star::util::DateTime& _rDT );
- String GetDateTimeString( const ::com::sun::star::util::DateTime& _rDT );
- String GetDateTimeString( const rtl::OUString& _rDate, const rtl::OUString& _rTime );
- String GetDateString( const ::com::sun::star::util::DateTime& _rDT );
+ DateTime GetDateTime( const ::com::sun::star::util::DateTime& _rDT );
+ String GetDateTimeString( const ::com::sun::star::util::DateTime& _rDT );
+ String GetDateTimeString( const rtl::OUString& _rDate, const rtl::OUString& _rTime );
+ String GetDateString( const ::com::sun::star::util::DateTime& _rDT );
- std::vector< std::pair< ::rtl::OUString, ::rtl::OUString> >
+ std::vector< std::pair< ::rtl::OUString, ::rtl::OUString> >
parseDN(const ::rtl::OUString& rRawString);
- std::pair< ::rtl::OUString, ::rtl::OUString> GetDNForCertDetailsView(
+ std::pair< ::rtl::OUString, ::rtl::OUString> GetDNForCertDetailsView(
const ::rtl::OUString & rRawString);
String GetContentPart( const String& _rRawString );
- String GetHexString( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rSeq, const char* _pSep = ":", UINT16 _nLineBreak = 0xFFFF );
+ String GetHexString( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rSeq, const char* _pSep = ":", UINT16 _nLineBreak = 0xFFFF );
- long ShrinkToFitWidth( Control& _rCtrl, long _nOffs = 0 ); // return = new width
- void AlignAfterImage( const FixedImage& _rImage, Control& _rCtrl, long _nXOffset = 0 );
- void AlignAfterImage( const FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset = 0 );
- void AlignAndFitImageAndControl( FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset = 0 );
+ long ShrinkToFitWidth( Control& _rCtrl, long _nOffs = 0 ); // return = new width
+ void AlignAfterImage( const FixedImage& _rImage, Control& _rCtrl, long _nXOffset = 0 );
+ void AlignAfterImage( const FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset = 0 );
+ void AlignAndFitImageAndControl( FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset = 0 );
}
-#define XMLSEC_RES(id) ResId(id,*XmlSec::GetResMgr())
+#define XMLSEC_RES(id) ResId(id,*XmlSec::GetResMgr())
#endif
diff --git a/xmlsecurity/source/dialogs/stbcontrl.cxx b/xmlsecurity/source/dialogs/stbcontrl.cxx
index 19a8cc675622..ee726d8a9524 100644
--- a/xmlsecurity/source/dialogs/stbcontrl.cxx
+++ b/xmlsecurity/source/dialogs/stbcontrl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,7 +43,7 @@
#include <xmlsecurity/stbcontrl.hxx>
-#define PAINT_OFFSET 5
+#define PAINT_OFFSET 5
SFX_IMPL_STATUSBAR_CONTROL( XmlSecStatusBarControl, SfxBoolItem );
@@ -53,10 +53,10 @@ class FunctionPopup_Impl : public PopupMenu
public:
FunctionPopup_Impl( USHORT nCheck );
- USHORT GetSelected() const { return nSelected; }
+ USHORT GetSelected() const { return nSelected; }
private:
- USHORT nSelected;
+ USHORT nSelected;
virtual void Select();
};
@@ -83,10 +83,10 @@ void FunctionPopup_Impl::Select()
struct XmlSecStatusBarControl::XmlSecStatusBarControl_Impl
{
- Point maPos;
- Size maSize;
- bool mbSigned;
- Image maImage;
+ Point maPos;
+ Size maSize;
+ bool mbSigned;
+ Image maImage;
};
@@ -96,7 +96,7 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( USHORT _nId, StatusBar& _rStb, S
,mpImpl( new XmlSecStatusBarControl_Impl )
{
mpImpl->mbSigned = false;
-// pImp->maImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) );
+// pImp->maImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) );
}
XmlSecStatusBarControl::~XmlSecStatusBarControl()
@@ -106,8 +106,8 @@ XmlSecStatusBarControl::~XmlSecStatusBarControl()
void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
{
- GetStatusBar().SetHelpText( GetId(), String() ); // necessary ?
- GetStatusBar().SetHelpId( GetId(), nSID ); // necessary ?
+ GetStatusBar().SetHelpText( GetId(), String() ); // necessary ?
+ GetStatusBar().SetHelpId( GetId(), nSID ); // necessary ?
if( SFX_ITEM_AVAILABLE != eState )
{
@@ -123,19 +123,19 @@ void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, con
mpImpl->mbSigned = false;
}
- if( GetStatusBar().AreItemsVisible() ) // necessary ?
+ if( GetStatusBar().AreItemsVisible() ) // necessary ?
GetStatusBar().SetItemData( GetId(), 0 );
- GetStatusBar().SetItemText( GetId(), String() ); // necessary ?
+ GetStatusBar().SetItemText( GetId(), String() ); // necessary ?
}
void XmlSecStatusBarControl::Command( const CommandEvent& rCEvt )
{
// can / has to be done when integrated in Office!
-// if( rCEvt.GetCommand() == .... )
+// if( rCEvt.GetCommand() == .... )
if( false )
{
-// GetBindings().GetDispatcher()->Execute( SID_PSZ_FUNCTION, SFX_CALLMODE_RECORD, &aItem, 0L );
+// GetBindings().GetDispatcher()->Execute( SID_PSZ_FUNCTION, SFX_CALLMODE_RECORD, &aItem, 0L );
}
else
SfxStatusBarControl::Command( rCEvt );
@@ -143,19 +143,19 @@ void XmlSecStatusBarControl::Command( const CommandEvent& rCEvt )
void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt )
{
- OutputDevice* pDev = rUsrEvt.GetDevice();
+ OutputDevice* pDev = rUsrEvt.GetDevice();
DBG_ASSERT( pDev, "-XmlSecStatusBarControl::Paint(): no Output Device... this will lead to nirvana..." );
- const Rectangle& rRect = rUsrEvt.GetRect();
- StatusBar& rBar = GetStatusBar();
- Point aItemPos = rBar.GetItemTextPos( GetId() );
- Color aOldLineColor = pDev->GetLineColor();
- Color aOldFillColor = pDev->GetFillColor();
+ const Rectangle& rRect = rUsrEvt.GetRect();
+ StatusBar& rBar = GetStatusBar();
+ Point aItemPos = rBar.GetItemTextPos( GetId() );
+ Color aOldLineColor = pDev->GetLineColor();
+ Color aOldFillColor = pDev->GetFillColor();
// just 4 testing until we've got a bitmap
pDev->SetLineColor();
pDev->SetFillColor( pDev->GetBackground().GetColor() );
- String s( String::CreateFromAscii( mpImpl->mbSigned? "X" : "-" ) );
+ String s( String::CreateFromAscii( mpImpl->mbSigned? "X" : "-" ) );
pDev->DrawRect( rRect );
pDev->DrawText( Point( rRect.Left() + rRect.GetWidth() / 2 - pDev->GetTextWidth( s ) / 2, aItemPos.Y() ), s );
diff --git a/xmlsecurity/source/dialogs/warnings.cxx b/xmlsecurity/source/dialogs/warnings.cxx
index a5dd33ca9cca..be836a92de26 100644
--- a/xmlsecurity/source/dialogs/warnings.cxx
+++ b/xmlsecurity/source/dialogs/warnings.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -45,7 +45,7 @@ using namespace ::com::sun::star::security;
/* HACK: disable some warnings for MS-C */
#ifdef _MSC_VER
-#pragma warning (disable : 4355) // 4355: this used in initializer-list
+#pragma warning (disable : 4355) // 4355: this used in initializer-list
#endif
using namespace ::com::sun::star;
@@ -53,19 +53,19 @@ using namespace ::com::sun::star;
MacroWarning::MacroWarning( Window* _pParent, uno::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, cssu::Reference< dcss::security::XCertificate >& _rxCert )
- :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROWARN ) )
- ,maDocNameFI ( this, ResId( FI_DOCNAME ) )
- ,maDescr1aFI ( this, ResId( FI_DESCR1A ) )
- ,maDescr1bFI ( this, ResId( FI_DESCR1B ) )
- ,maSignsFI ( this, ResId( FI_SIGNS ) )
- ,maViewSignsBtn ( this, ResId( PB_VIEWSIGNS ) )
- ,maDescr2FI ( this, ResId( FI_DESCR2 ) )
- ,maAlwaysTrustCB ( this, ResId( CB_ALWAYSTRUST ) )
- ,maBottomSepFL ( this, ResId( FL_BOTTOM_SEP ) )
- ,maEnableBtn ( this, ResId( PB_DISABLE ) )
- ,maDisableBtn ( this, ResId( PB_DISABLE ) )
- ,maHelpBtn ( this, ResId( BTN_HELP ) )
- ,mbSignedMode ( true )
+ :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROWARN ) )
+ ,maDocNameFI ( this, ResId( FI_DOCNAME ) )
+ ,maDescr1aFI ( this, ResId( FI_DESCR1A ) )
+ ,maDescr1bFI ( this, ResId( FI_DESCR1B ) )
+ ,maSignsFI ( this, ResId( FI_SIGNS ) )
+ ,maViewSignsBtn ( this, ResId( PB_VIEWSIGNS ) )
+ ,maDescr2FI ( this, ResId( FI_DESCR2 ) )
+ ,maAlwaysTrustCB ( this, ResId( CB_ALWAYSTRUST ) )
+ ,maBottomSepFL ( this, ResId( FL_BOTTOM_SEP ) )
+ ,maEnableBtn ( this, ResId( PB_DISABLE ) )
+ ,maDisableBtn ( this, ResId( PB_DISABLE ) )
+ ,maHelpBtn ( this, ResId( BTN_HELP ) )
+ ,mbSignedMode ( true )
{
FreeResource();
@@ -77,7 +77,7 @@ MacroWarning::MacroWarning( Window* _pParent, uno::Reference< dcss::xml::crypto:
maViewSignsBtn.SetClickHdl( LINK( this, MacroWarning, ViewSignsBtnHdl ) );
maEnableBtn.SetClickHdl( LINK( this, MacroWarning, EnableBtnHdl ) );
-// maDisableBtn.SetClickHdl( LINK( this, MacroWarning, DisableBtnHdl ) );
+// maDisableBtn.SetClickHdl( LINK( this, MacroWarning, DisableBtnHdl ) );
if( mxCert.is() )
maSignsFI.SetText( XmlSec::GetContentPart( mxCert->getSubjectName() ) );
@@ -87,19 +87,19 @@ MacroWarning::MacroWarning( Window* _pParent, uno::Reference< dcss::xml::crypto:
}
MacroWarning::MacroWarning( Window* _pParent )
- :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROWARN ) )
- ,maDocNameFI ( this, ResId( FI_DOCNAME ) )
- ,maDescr1aFI ( this, ResId( FI_DESCR1A ) )
- ,maDescr1bFI ( this, ResId( FI_DESCR1B ) )
- ,maSignsFI ( this, ResId( FI_SIGNS ) )
- ,maViewSignsBtn ( this, ResId( PB_VIEWSIGNS ) )
- ,maDescr2FI ( this, ResId( FI_DESCR2 ) )
- ,maAlwaysTrustCB ( this, ResId( CB_ALWAYSTRUST ) )
- ,maBottomSepFL ( this, ResId( FL_BOTTOM_SEP ) )
- ,maEnableBtn ( this, ResId( PB_DISABLE ) )
- ,maDisableBtn ( this, ResId( PB_DISABLE ) )
- ,maHelpBtn ( this, ResId( BTN_HELP ) )
- ,mbSignedMode ( false )
+ :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROWARN ) )
+ ,maDocNameFI ( this, ResId( FI_DOCNAME ) )
+ ,maDescr1aFI ( this, ResId( FI_DESCR1A ) )
+ ,maDescr1bFI ( this, ResId( FI_DESCR1B ) )
+ ,maSignsFI ( this, ResId( FI_SIGNS ) )
+ ,maViewSignsBtn ( this, ResId( PB_VIEWSIGNS ) )
+ ,maDescr2FI ( this, ResId( FI_DESCR2 ) )
+ ,maAlwaysTrustCB ( this, ResId( CB_ALWAYSTRUST ) )
+ ,maBottomSepFL ( this, ResId( FL_BOTTOM_SEP ) )
+ ,maEnableBtn ( this, ResId( PB_DISABLE ) )
+ ,maDisableBtn ( this, ResId( PB_DISABLE ) )
+ ,maHelpBtn ( this, ResId( BTN_HELP ) )
+ ,mbSignedMode ( false )
{
FreeResource();
@@ -122,7 +122,7 @@ IMPL_LINK( MacroWarning, ViewSignsBtnHdl, void*, EMPTYARG )
{
DBG_ASSERT( mxCert.is(), "*MacroWarning::ViewSignsBtnHdl(): no certificate set!" );
- CertificateViewer aViewer( this, mxSecurityEnvironment, mxCert );
+ CertificateViewer aViewer( this, mxSecurityEnvironment, mxCert );
aViewer.Execute();
return 0;
@@ -131,7 +131,7 @@ IMPL_LINK( MacroWarning, ViewSignsBtnHdl, void*, EMPTYARG )
IMPL_LINK( MacroWarning, EnableBtnHdl, void*, EMPTYARG )
{
if( mbSignedMode && maAlwaysTrustCB.IsChecked() )
- { // insert path into trusted path list
+ { // insert path into trusted path list
}
diff --git a/xmlsecurity/source/dialogs/warnings.src b/xmlsecurity/source/dialogs/warnings.src
index 2e0e697dae1f..913717d3beb0 100644
--- a/xmlsecurity/source/dialogs/warnings.src
+++ b/xmlsecurity/source/dialogs/warnings.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx
index 2cf283cf5bc4..1ce46eb188a3 100644
--- a/xmlsecurity/source/framework/buffernode.cxx
+++ b/xmlsecurity/source/framework/buffernode.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,42 +50,42 @@ bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const
/****** BufferNode/isECOfBeforeModifyIncluded ********************************
*
* NAME
- * isECOfBeforeModifyIncluded -- checks whether there is some
- * ElementCollector on this BufferNode, that has BEFORE-MODIFY priority.
+ * isECOfBeforeModifyIncluded -- checks whether there is some
+ * ElementCollector on this BufferNode, that has BEFORE-MODIFY priority.
*
* SYNOPSIS
- * bExist = isECOfBeforeModifyIncluded(nIgnoredSecurityId);
+ * bExist = isECOfBeforeModifyIncluded(nIgnoredSecurityId);
*
* FUNCTION
- * checks each ElementCollector on this BufferNode, if all following
- * conditions are satisfied, then returns true:
- * 1. the ElementCollector's priority is BEFOREMODIFY;
- * 2. the ElementCollector's securityId can't be ignored.
- * otherwise, returns false.
+ * checks each ElementCollector on this BufferNode, if all following
+ * conditions are satisfied, then returns true:
+ * 1. the ElementCollector's priority is BEFOREMODIFY;
+ * 2. the ElementCollector's securityId can't be ignored.
+ * otherwise, returns false.
*
* INPUTS
- * nIgnoredSecurityId - the security Id to be ignored. If it equals
- * to UNDEFINEDSECURITYID, then no security Id
- * will be ignored.
+ * nIgnoredSecurityId - the security Id to be ignored. If it equals
+ * to UNDEFINEDSECURITYID, then no security Id
+ * will be ignored.
*
* RESULT
- * bExist - true if a match found, false otherwise
+ * bExist - true if a match found, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = false;
std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin();
- for( ; ii != m_vElementCollectors.end() ; ++ii )
+ for( ; ii != m_vElementCollectors.end() ; ++ii )
{
ElementCollector* pElementCollector = (ElementCollector*)*ii;
-
+
if ((nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID ||
pElementCollector->getSecurityId() != nIgnoredSecurityId) &&
(pElementCollector->getPriority() == cssxc::sax::ElementMarkPriority_BEFOREMODIFY))
@@ -94,7 +94,7 @@ bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const
break;
}
}
-
+
return rc;
}
@@ -102,28 +102,28 @@ void BufferNode::setReceivedAll()
/****** BufferNode/setReceiveAll *********************************************
*
* NAME
- * setReceivedAll -- indicates that the element in this BufferNode has
- * been compeletely bufferred.
+ * setReceivedAll -- indicates that the element in this BufferNode has
+ * been compeletely bufferred.
*
* SYNOPSIS
- * setReceivedAll();
+ * setReceivedAll();
*
* FUNCTION
- * sets the all-received flag and launches ElementCollector's notify
- * process.
+ * sets the all-received flag and launches ElementCollector's notify
+ * process.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_bAllReceived = true;
@@ -139,26 +139,26 @@ void BufferNode::addElementCollector(const ElementCollector* pElementCollector)
/****** BufferNode/addElementCollector ***************************************
*
* NAME
- * addElementCollector -- adds a new ElementCollector to this BufferNode.
+ * addElementCollector -- adds a new ElementCollector to this BufferNode.
*
* SYNOPSIS
- * addElementCollector(pElementCollector);
+ * addElementCollector(pElementCollector);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pElementCollector - the ElementCollector to be added
+ * pElementCollector - the ElementCollector to be added
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_vElementCollectors.push_back( pElementCollector );
@@ -169,34 +169,34 @@ void BufferNode::removeElementCollector(const ElementCollector* pElementCollecto
/****** BufferNode/removeElementCollector ************************************
*
* NAME
- * removeElementCollector -- removes an ElementCollector from this
- * BufferNode.
+ * removeElementCollector -- removes an ElementCollector from this
+ * BufferNode.
*
* SYNOPSIS
- * removeElementCollector(pElementCollector);
+ * removeElementCollector(pElementCollector);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pElementCollector - the ElementCollector to be removed
+ * pElementCollector - the ElementCollector to be removed
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< const ElementCollector* >::iterator ii = m_vElementCollectors.begin();
- for( ; ii != m_vElementCollectors.end() ; ++ii )
+ for( ; ii != m_vElementCollectors.end() ; ++ii )
{
- if( *ii == pElementCollector )
+ if( *ii == pElementCollector )
{
m_vElementCollectors.erase( ii );
((ElementCollector*)pElementCollector)->setBufferNode(NULL);
@@ -214,34 +214,34 @@ void BufferNode::setBlocker(const ElementMark* pBlocker)
/****** BufferNode/setBlocker ************************************************
*
* NAME
- * setBlocker -- adds a blocker to this BufferNode.
+ * setBlocker -- adds a blocker to this BufferNode.
*
* SYNOPSIS
- * setBlocker(pBlocker);
+ * setBlocker(pBlocker);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pBlocker - the new blocker to be attached
+ * pBlocker - the new blocker to be attached
*
* RESULT
- * empty
+ * empty
*
* NOTES
- * Because there is only one blocker permited for a BufferNode, so the
- * old blocker on this BufferNode, if there is one, will be overcasted.
+ * Because there is only one blocker permited for a BufferNode, so the
+ * old blocker on this BufferNode, if there is one, will be overcasted.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
OSL_ASSERT(!(m_pBlocker != NULL && pBlocker != NULL));
-
+
m_pBlocker = (ElementMark*)pBlocker;
if (m_pBlocker != NULL)
{
@@ -253,32 +253,32 @@ rtl::OUString BufferNode::printChildren() const
/****** BufferNode/printChildren *********************************************
*
* NAME
- * printChildren -- prints children information into a string.
+ * printChildren -- prints children information into a string.
*
* SYNOPSIS
- * result = printChildren();
+ * result = printChildren();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * result - the information string
+ * result - the information string
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
-{
+{
rtl::OUString rc;
std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin();
-
- for( ; ii != m_vElementCollectors.end() ; ++ii )
+
+ for( ; ii != m_vElementCollectors.end() ; ++ii )
{
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BufID=" ));
rc += rtl::OUString::valueOf((*ii)->getBufferId());
@@ -287,9 +287,9 @@ rtl::OUString BufferNode::printChildren() const
{
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[M]" ));
}
-
+
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ",Pri=" ));
-
+
switch (((ElementCollector*)(*ii))->getPriority())
{
case cssxc::sax::ElementMarkPriority_BEFOREMODIFY:
@@ -302,7 +302,7 @@ rtl::OUString BufferNode::printChildren() const
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UNKNOWN" ));
break;
}
-
+
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "(" ));
/*
if (((ElementCollector*)(*ii))->isInternalNotificationSuppressed())
@@ -315,7 +315,7 @@ rtl::OUString BufferNode::printChildren() const
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" ));
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ));
}
-
+
return rc;
}
@@ -323,27 +323,27 @@ bool BufferNode::hasAnything() const
/****** BufferNode/hasAnything ***********************************************
*
* NAME
- * hasAnything -- checks whether there is any ElementCollector or blocker
- * on this BufferNode.
+ * hasAnything -- checks whether there is any ElementCollector or blocker
+ * on this BufferNode.
*
* SYNOPSIS
- * bExist = hasAnything();
+ * bExist = hasAnything();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bExist - true if there is, false otherwise.
+ * bExist - true if there is, false otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return (m_pBlocker != NULL || m_vElementCollectors.size() > 0);
@@ -353,27 +353,27 @@ bool BufferNode::hasChildren() const
/****** BufferNode/hasChildren ***********************************************
*
* NAME
- * hasChildren -- checks whether this BufferNode has any child
- * BufferNode.
+ * hasChildren -- checks whether this BufferNode has any child
+ * BufferNode.
*
* SYNOPSIS
- * bExist = hasChildren();
+ * bExist = hasChildren();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bExist - true if there is, false otherwise.
+ * bExist - true if there is, false otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return (m_vChildren.size() > 0);
@@ -388,36 +388,36 @@ const BufferNode* BufferNode::getFirstChild() const
/****** BufferNode/getFirstChild *********************************************
*
* NAME
- * getFirstChild -- retrieves the first child BufferNode.
+ * getFirstChild -- retrieves the first child BufferNode.
*
* SYNOPSIS
- * child = getFirstChild();
+ * child = getFirstChild();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * child - the first child BufferNode, or NULL if there is no child
- * BufferNode.
+ * child - the first child BufferNode, or NULL if there is no child
+ * BufferNode.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* rc = NULL;
-
+
if (m_vChildren.size() > 0)
{
rc = (BufferNode*)m_vChildren.front();
}
-
+
return (const BufferNode*)rc;
}
@@ -425,31 +425,31 @@ void BufferNode::addChild(const BufferNode* pChild, sal_Int32 nPosition)
/****** BufferNode/addChild(pChild,nPosition) ********************************
*
* NAME
- * addChild -- inserts a child BufferNode at specific position.
+ * addChild -- inserts a child BufferNode at specific position.
*
* SYNOPSIS
- * addChild(pChild, nPosition);
+ * addChild(pChild, nPosition);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pChild - the child BufferNode to be added.
- * nPosition - the position where the new child locates.
+ * pChild - the child BufferNode to be added.
+ * nPosition - the position where the new child locates.
*
* RESULT
- * empty
+ * empty
*
* NOTES
- * If the nPosition is -1, then the new child BufferNode is appended
- * at the end.
+ * If the nPosition is -1, then the new child BufferNode is appended
+ * at the end.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (nPosition == -1)
@@ -468,29 +468,29 @@ void BufferNode::addChild(const BufferNode* pChild)
/****** BufferNode/addChild() ************************************************
*
* NAME
- * addChild -- add a new child BufferNode.
+ * addChild -- add a new child BufferNode.
*
* SYNOPSIS
- * addChild(pChild);
+ * addChild(pChild);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pChild - the child BufferNode to be added.
+ * pChild - the child BufferNode to be added.
*
* RESULT
- * empty
+ * empty
*
* NOTES
- * The new child BufferNode is appended at the end.
+ * The new child BufferNode is appended at the end.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
addChild(pChild, -1);
@@ -500,33 +500,33 @@ void BufferNode::removeChild(const BufferNode* pChild)
/****** BufferNode/removeChild ***********************************************
*
* NAME
- * removeChild -- removes a child BufferNode from the children list.
+ * removeChild -- removes a child BufferNode from the children list.
*
* SYNOPSIS
- * removeChild(pChild);
+ * removeChild(pChild);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pChild - the child BufferNode to be removed
+ * pChild - the child BufferNode to be removed
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< const BufferNode* >::iterator ii = m_vChildren.begin();
- for( ; ii != m_vChildren.end() ; ++ii )
+ for( ; ii != m_vChildren.end() ; ++ii )
{
- if( *ii == pChild )
+ if( *ii == pChild )
{
m_vChildren.erase( ii );
break;
@@ -538,49 +538,49 @@ sal_Int32 BufferNode::indexOfChild(const BufferNode* pChild) const
/****** BufferNode/indexOfChild **********************************************
*
* NAME
- * indexOfChild -- gets the index of a child BufferNode.
+ * indexOfChild -- gets the index of a child BufferNode.
*
* SYNOPSIS
- * index = indexOfChild(pChild);
+ * index = indexOfChild(pChild);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pChild - the child BufferNode whose index to be gotten
+ * pChild - the child BufferNode whose index to be gotten
*
* RESULT
- * index - the index of that child BufferNode. If that child BufferNode
- * is not found, -1 is returned.
+ * index - the index of that child BufferNode. If that child BufferNode
+ * is not found, -1 is returned.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
sal_Int32 nIndex = 0;
bool bFound = false;
-
+
std::vector< const BufferNode * >::const_iterator ii = m_vChildren.begin();
- for( ; ii != m_vChildren.end() ; ++ii )
+ for( ; ii != m_vChildren.end() ; ++ii )
{
- if( *ii == pChild )
+ if( *ii == pChild )
{
bFound = true;
break;
}
nIndex++;
}
-
+
if (!bFound )
{
nIndex = -1;
}
-
+
return nIndex;
}
@@ -588,36 +588,36 @@ const BufferNode* BufferNode::childAt(sal_Int32 nIndex) const
/****** BufferNode/childAt ***************************************************
*
* NAME
- * childAt -- retrieves the child BufferNode at specific possition.
+ * childAt -- retrieves the child BufferNode at specific possition.
*
* SYNOPSIS
- * child = childAt(nIndex);
+ * child = childAt(nIndex);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * nIndex - the index of the child BufferNode to be retrieved
+ * nIndex - the index of the child BufferNode to be retrieved
*
* RESULT
- * child - the child BufferNode at index position, or NULL if the index
- * is out of the range of children.
+ * child - the child BufferNode at index position, or NULL if the index
+ * is out of the range of children.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* rc = NULL;
-
+
if (nIndex < ((sal_Int32)m_vChildren.size()) && nIndex >= 0)
{
rc = (BufferNode*)m_vChildren[nIndex];
}
-
+
return (const BufferNode*)rc;
}
@@ -635,35 +635,35 @@ const BufferNode* BufferNode::getNextSibling() const
/****** BufferNode/getNextSibling ********************************************
*
* NAME
- * getNextSibling -- retrieves the next sibling BufferNode.
+ * getNextSibling -- retrieves the next sibling BufferNode.
*
* SYNOPSIS
- * sibling = getNextSibling();
+ * sibling = getNextSibling();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * sibling - the next sibling BufferNode, or NULL if there is none.
+ * sibling - the next sibling BufferNode, or NULL if there is none.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* rc = NULL;
-
+
if (m_pParent != NULL)
{
rc = (BufferNode*)m_pParent->getNextChild(this);
}
-
+
return (const BufferNode*)rc;
}
@@ -671,46 +671,46 @@ const BufferNode* BufferNode::isAncestor(const BufferNode* pDescendant) const
/****** BufferNode/isAncestor ************************************************
*
* NAME
- * isAncestor -- checks whether this BufferNode is an ancestor of another
- * BufferNode.
+ * isAncestor -- checks whether this BufferNode is an ancestor of another
+ * BufferNode.
*
* SYNOPSIS
- * bIs = isAncestor(pDescendant);
+ * bIs = isAncestor(pDescendant);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pDescendant - the BufferNode to be checked as a descendant
+ * pDescendant - the BufferNode to be checked as a descendant
*
* RESULT
- * bIs - true if this BufferNode is an ancestor of the pDescendant,
- * false otherwise.
+ * bIs - true if this BufferNode is an ancestor of the pDescendant,
+ * false otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* rc = NULL;
-
+
if (pDescendant != NULL)
{
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
-
- for( ; ii != m_vChildren.end() ; ++ii )
+
+ for( ; ii != m_vChildren.end() ; ++ii )
{
BufferNode* pChild = (BufferNode*)*ii;
-
+
if (pChild == pDescendant)
{
rc = pChild;
break;
}
-
+
if (pChild->isAncestor(pDescendant) != NULL)
{
rc = pChild;
@@ -720,38 +720,38 @@ const BufferNode* BufferNode::isAncestor(const BufferNode* pDescendant) const
}
return (const BufferNode*)rc;
-}
+}
bool BufferNode::isPrevious(const BufferNode* pFollowing) const
/****** BufferNode/isPrevious ************************************************
*
* NAME
- * isPrevious -- checks whether this BufferNode is ahead of another
- * BufferNode in the tree order.
+ * isPrevious -- checks whether this BufferNode is ahead of another
+ * BufferNode in the tree order.
*
* SYNOPSIS
- * bIs = isPrevious(pFollowing);
+ * bIs = isPrevious(pFollowing);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pFollowing - the BufferNode to be checked as a following
+ * pFollowing - the BufferNode to be checked as a following
*
* RESULT
- * bIs - true if this BufferNode is ahead in the tree order, false
- * otherwise.
+ * bIs - true if this BufferNode is ahead in the tree order, false
+ * otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = false;
-
+
BufferNode* pNextBufferNode = (BufferNode*)getNextNodeByTreeOrder();
while (pNextBufferNode != NULL)
{
@@ -760,47 +760,47 @@ bool BufferNode::isPrevious(const BufferNode* pFollowing) const
rc = true;
break;
}
-
+
pNextBufferNode = (BufferNode*)(pNextBufferNode->getNextNodeByTreeOrder());
}
-
+
return rc;
-}
+}
const BufferNode* BufferNode::getNextNodeByTreeOrder() const
/****** BufferNode/getNextNodeByTreeOrder ************************************
*
* NAME
- * getNextNodeByTreeOrder -- retrieves the next BufferNode in the tree
- * order.
+ * getNextNodeByTreeOrder -- retrieves the next BufferNode in the tree
+ * order.
*
* SYNOPSIS
- * next = getNextNodeByTreeOrder();
+ * next = getNextNodeByTreeOrder();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * next - the BufferNode following this BufferNode in the tree order,
- * or NULL if there is none.
+ * next - the BufferNode following this BufferNode in the tree order,
+ * or NULL if there is none.
*
* NOTES
- * The "next" node in tree order is defined as:
- * 1. If a node has children, then the first child is;
- * 2. otherwise, if it has a following sibling, then this sibling node is;
- * 3. otherwise, if it has a parent node, the the parent's next sibling
- * node is;
- * 4. otherwise, no "next" node exists.
+ * The "next" node in tree order is defined as:
+ * 1. If a node has children, then the first child is;
+ * 2. otherwise, if it has a following sibling, then this sibling node is;
+ * 3. otherwise, if it has a parent node, the the parent's next sibling
+ * node is;
+ * 4. otherwise, no "next" node exists.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
/*
@@ -813,7 +813,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
}
/*
- * Otherwise, it this buffer node has a following sibling,
+ * Otherwise, it this buffer node has a following sibling,
* then return that sibling.
*/
BufferNode* pNextSibling = (BufferNode*)getNextSibling();
@@ -821,7 +821,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
{
return pNextSibling;
}
-
+
/*
* Otherwise, it this buffer node has parent, then return
* its parent's following sibling.
@@ -829,23 +829,23 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
BufferNode* pNode = (BufferNode*)this;
BufferNode* pParent;
BufferNode* pNextSiblingParent = NULL;
-
+
do
{
if (pNode == NULL)
{
break;
}
-
+
pParent = (BufferNode*)pNode->getParent();
if (pParent != NULL)
{
pNextSiblingParent = (BufferNode*)pParent->getNextSibling();
}
pNode = pParent;
-
+
}while (pNextSiblingParent == NULL);
-
+
return pNextSiblingParent;
}
@@ -857,38 +857,38 @@ cssu::Reference< cssxw::XXMLElementWrapper > BufferNode::getXMLElement() const
void BufferNode::setXMLElement( const cssu::Reference< cssxw::XXMLElementWrapper >& xXMLElement )
{
m_xXMLElement = xXMLElement;
-}
+}
void BufferNode::notifyBranch()
/****** BufferNode/notifyBranch **********************************************
*
* NAME
- * notifyBranch -- notifies each BufferNode in the branch of this
- * BufferNode in the tree order.
+ * notifyBranch -- notifies each BufferNode in the branch of this
+ * BufferNode in the tree order.
*
* SYNOPSIS
- * notifyBranch();
+ * notifyBranch();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
- for( ; ii != m_vChildren.end() ; ++ii )
+ for( ; ii != m_vChildren.end() ; ++ii )
{
BufferNode* pBufferNode = (BufferNode*)*ii;
pBufferNode->elementCollectorNotify();
@@ -900,27 +900,27 @@ void BufferNode::notifyAncestor()
/****** BufferNode/notifyAncestor ********************************************
*
* NAME
- * notifyAncestor -- notifies each ancestor BufferNode through the parent
- * link.
+ * notifyAncestor -- notifies each ancestor BufferNode through the parent
+ * link.
*
* SYNOPSIS
- * notifyAncestor();
+ * notifyAncestor();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* pParent = m_pParent;
@@ -935,39 +935,39 @@ void BufferNode::elementCollectorNotify()
/****** BufferNode/elementCollectorNotify ************************************
*
* NAME
- * elementCollectorNotify -- notifies this BufferNode.
+ * elementCollectorNotify -- notifies this BufferNode.
*
* SYNOPSIS
- * elementCollectorNotify();
+ * elementCollectorNotify();
*
* FUNCTION
- * Notifies this BufferNode if the notification is not suppressed.
+ * Notifies this BufferNode if the notification is not suppressed.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * child - the first child BufferNode, or NULL if there is no child
- * BufferNode.
+ * child - the first child BufferNode, or NULL if there is no child
+ * BufferNode.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (m_vElementCollectors.size()>0)
{
cssxc::sax::ElementMarkPriority nMaxPriority = cssxc::sax::ElementMarkPriority_MINIMUM;
cssxc::sax::ElementMarkPriority nPriority;
-
+
/*
* get the max priority among ElementCollectors on this BufferNode
*/
std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin();
- for( ; ii != m_vElementCollectors.end() ; ++ii )
+ for( ; ii != m_vElementCollectors.end() ; ++ii )
{
ElementCollector* pElementCollector = (ElementCollector*)*ii;
nPriority = pElementCollector->getPriority();
@@ -976,16 +976,16 @@ void BufferNode::elementCollectorNotify()
nMaxPriority = nPriority;
}
}
-
+
std::vector< const ElementCollector* > vElementCollectors( m_vElementCollectors );
ii = vElementCollectors.begin();
-
- for( ; ii != vElementCollectors.end() ; ++ii )
+
+ for( ; ii != vElementCollectors.end() ; ++ii )
{
ElementCollector* pElementCollector = (ElementCollector*)*ii;
nPriority = pElementCollector->getPriority();
bool bToModify = pElementCollector->getModify();
-
+
/*
* Only ElementCollector with the max priority can
* perform notify operation.
@@ -1007,7 +1007,7 @@ void BufferNode::elementCollectorNotify()
* will destroy the bufferred element, in turn, ElementCollectors
* mentioned above can't perform their mission.
*/
- //if (!(nMaxPriority == cssxc::sax::ElementMarkPriority_PRI_MODIFY &&
+ //if (!(nMaxPriority == cssxc::sax::ElementMarkPriority_PRI_MODIFY &&
if (!(bToModify &&
(isECInSubTreeIncluded(pElementCollector->getSecurityId()) ||
isECOfBeforeModifyInAncestorIncluded(pElementCollector->getSecurityId()))
@@ -1024,38 +1024,38 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
/****** BufferNode/isECInSubTreeIncluded *************************************
*
* NAME
- * isECInSubTreeIncluded -- checks whether there is any ElementCollector
- * in the branch of this BufferNode.
+ * isECInSubTreeIncluded -- checks whether there is any ElementCollector
+ * in the branch of this BufferNode.
*
* SYNOPSIS
- * bExist = isECInSubTreeIncluded(nIgnoredSecurityId);
+ * bExist = isECInSubTreeIncluded(nIgnoredSecurityId);
*
* FUNCTION
- * checks each BufferNode in the branch of this BufferNode, if there is
- * an ElementCollector whose signatureId is not ignored, then return
- * true, otherwise, false returned.
+ * checks each BufferNode in the branch of this BufferNode, if there is
+ * an ElementCollector whose signatureId is not ignored, then return
+ * true, otherwise, false returned.
*
* INPUTS
- * nIgnoredSecurityId - the security Id to be ignored. If it equals
- * to UNDEFINEDSECURITYID, then no security Id
- * will be ignored.
+ * nIgnoredSecurityId - the security Id to be ignored. If it equals
+ * to UNDEFINEDSECURITYID, then no security Id
+ * will be ignored.
*
* RESULT
- * bExist - true if a match found, false otherwise.
+ * bExist - true if a match found, false otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = false;
-
+
std::vector< const ElementCollector* >::const_iterator jj = m_vElementCollectors.begin();
-
- for( ; jj != m_vElementCollectors.end() ; ++jj )
+
+ for( ; jj != m_vElementCollectors.end() ; ++jj )
{
ElementCollector* pElementCollector = (ElementCollector*)*jj;
if (nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID ||
@@ -1065,15 +1065,15 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
break;
}
}
-
+
if ( !rc )
{
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
-
- for( ; ii != m_vChildren.end() ; ++ii )
+
+ for( ; ii != m_vChildren.end() ; ++ii )
{
BufferNode* pBufferNode = (BufferNode*)*ii;
-
+
if ( pBufferNode->isECInSubTreeIncluded(nIgnoredSecurityId))
{
rc = true;
@@ -1081,7 +1081,7 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
}
}
}
-
+
return rc;
}
@@ -1089,37 +1089,37 @@ bool BufferNode::isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurity
/****** BufferNode/isECOfBeforeModifyInAncestorIncluded **********************
*
* NAME
- * isECOfBeforeModifyInAncestorIncluded -- checks whether there is some
- * ancestor BufferNode which has ElementCollector with PRI_BEFPREMODIFY
- * priority.
+ * isECOfBeforeModifyInAncestorIncluded -- checks whether there is some
+ * ancestor BufferNode which has ElementCollector with PRI_BEFPREMODIFY
+ * priority.
*
* SYNOPSIS
- * bExist = isECOfBeforeModifyInAncestorIncluded(nIgnoredSecurityId);
+ * bExist = isECOfBeforeModifyInAncestorIncluded(nIgnoredSecurityId);
*
* FUNCTION
- * checks each ancestor BufferNode through the parent link, if there is
- * an ElementCollector with PRI_BEFPREMODIFY priority and its
- * signatureId is not ignored, then return true, otherwise, false
- * returned.
+ * checks each ancestor BufferNode through the parent link, if there is
+ * an ElementCollector with PRI_BEFPREMODIFY priority and its
+ * signatureId is not ignored, then return true, otherwise, false
+ * returned.
*
* INPUTS
- * nIgnoredSecurityId - the security Id to be ignored. If it equals
- * to UNDEFINEDSECURITYID, then no security Id
- * will be ignored.
+ * nIgnoredSecurityId - the security Id to be ignored. If it equals
+ * to UNDEFINEDSECURITYID, then no security Id
+ * will be ignored.
*
* RESULT
- * bExist - true if a match found, false otherwise.
+ * bExist - true if a match found, false otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = false;
-
+
BufferNode* pParentNode = m_pParent;
while (pParentNode != NULL)
{
@@ -1128,10 +1128,10 @@ bool BufferNode::isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurity
rc = true;
break;
}
-
+
pParentNode = (BufferNode*)pParentNode->getParent();
}
-
+
return rc;
}
@@ -1139,57 +1139,57 @@ bool BufferNode::isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
/****** BufferNode/isBlockerInSubTreeIncluded ********************************
*
* NAME
- * isBlockerInSubTreeIncluded -- checks whether there is some BufferNode
- * which has blocker on it
+ * isBlockerInSubTreeIncluded -- checks whether there is some BufferNode
+ * which has blocker on it
*
* SYNOPSIS
- * bExist = isBlockerInSubTreeIncluded(nIgnoredSecurityId);
+ * bExist = isBlockerInSubTreeIncluded(nIgnoredSecurityId);
*
* FUNCTION
- * checks each BufferNode in the branch of this BufferNode, if one has
- * a blocker on it, and the blocker's securityId is not ignored, then
- * returns true; otherwise, false returns.
+ * checks each BufferNode in the branch of this BufferNode, if one has
+ * a blocker on it, and the blocker's securityId is not ignored, then
+ * returns true; otherwise, false returns.
*
* INPUTS
- * nIgnoredSecurityId - the security Id to be ignored. If it equals
- * to UNDEFINEDSECURITYID, then no security Id
- * will be ignored.
+ * nIgnoredSecurityId - the security Id to be ignored. If it equals
+ * to UNDEFINEDSECURITYID, then no security Id
+ * will be ignored.
*
* RESULT
- * bExist - true if a match found, false otherwise.
+ * bExist - true if a match found, false otherwise.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = false;
-
+
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
- for( ; ii != m_vChildren.end() ; ++ii )
+ for( ; ii != m_vChildren.end() ; ++ii )
{
BufferNode* pBufferNode = (BufferNode*)*ii;
ElementMark* pBlocker = pBufferNode->getBlocker();
-
+
if (pBlocker != NULL &&
(nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID ||
- pBlocker->getSecurityId() != nIgnoredSecurityId ))
+ pBlocker->getSecurityId() != nIgnoredSecurityId ))
{
rc = true;
break;
}
-
+
if (rc || pBufferNode->isBlockerInSubTreeIncluded(nIgnoredSecurityId))
{
rc = true;
break;
}
}
-
+
return rc;
}
@@ -1197,47 +1197,47 @@ const BufferNode* BufferNode::getNextChild(const BufferNode* pChild) const
/****** BufferNode/getNextChild **********************************************
*
* NAME
- * getNextChild -- get the next child BufferNode.
+ * getNextChild -- get the next child BufferNode.
*
* SYNOPSIS
- * nextChild = getNextChild();
+ * nextChild = getNextChild();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pChild - the child BufferNode whose next node is retrieved.
+ * pChild - the child BufferNode whose next node is retrieved.
*
* RESULT
- * nextChild - the next child BufferNode after the pChild, or NULL if
- * there is none.
+ * nextChild - the next child BufferNode after the pChild, or NULL if
+ * there is none.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* rc = NULL;
bool bChildFound = false;
-
+
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
- for( ; ii != m_vChildren.end() ; ++ii )
+ for( ; ii != m_vChildren.end() ; ++ii )
{
if (bChildFound)
{
rc = (BufferNode*)*ii;
break;
}
-
- if( *ii == pChild )
+
+ if( *ii == pChild )
{
bChildFound = true;
}
}
-
+
return (const BufferNode*)rc;
}
@@ -1246,36 +1246,36 @@ void BufferNode::freeAllChildren()
/****** BufferNode/freeAllChildren *******************************************
*
* NAME
- * freeAllChildren -- free all his child BufferNode.
+ * freeAllChildren -- free all his child BufferNode.
*
* SYNOPSIS
- * freeAllChildren();
+ * freeAllChildren();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 30.03.2004 - the correct the memory leak bug
+ * 30.03.2004 - the correct the memory leak bug
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
- for( ; ii != m_vChildren.end() ; ++ii )
+ for( ; ii != m_vChildren.end() ; ++ii )
{
BufferNode *pChild = (BufferNode *)(*ii);
pChild->freeAllChildren();
delete pChild;
}
-
+
m_vChildren.clear();
}
diff --git a/xmlsecurity/source/framework/buffernode.hxx b/xmlsecurity/source/framework/buffernode.hxx
index cb6d596edecc..3cb103524a51 100644
--- a/xmlsecurity/source/framework/buffernode.hxx
+++ b/xmlsecurity/source/framework/buffernode.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -44,63 +44,63 @@ class BufferNode
/****** buffernode.hxx/CLASS BufferNode ***************************************
*
* NAME
- * BufferNode -- Class to maintain the tree of bufferred elements
+ * BufferNode -- Class to maintain the tree of bufferred elements
*
* FUNCTION
- * One BufferNode object represents a bufferred element in the document
- * wrapper component.
- * All BufferNode objects construct a tree which has the same structure
- * of all bufferred elements. That is to say, if one bufferred element is
- * an ancestor of another bufferred element, then the corresponding
- * BufferNode objects are also in ancestor/descendant relationship.
- * This class is used to manipulate the tree of bufferred elements.
+ * One BufferNode object represents a bufferred element in the document
+ * wrapper component.
+ * All BufferNode objects construct a tree which has the same structure
+ * of all bufferred elements. That is to say, if one bufferred element is
+ * an ancestor of another bufferred element, then the corresponding
+ * BufferNode objects are also in ancestor/descendant relationship.
+ * This class is used to manipulate the tree of bufferred elements.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
/* the parent BufferNode */
BufferNode* m_pParent;
-
+
/* all child BufferNodes */
- std::vector< const BufferNode* > m_vChildren;
-
+ std::vector< const BufferNode* > m_vChildren;
+
/* all ElementCollector holding this BufferNode */
std::vector< const ElementCollector* > m_vElementCollectors;
-
+
/*
* the blocker holding this BufferNode, one BufferNode can have one
* blocker at most
*/
ElementMark* m_pBlocker;
-
+
/*
* whether the element has completely bufferred by the document wrapper
* component
*/
bool m_bAllReceived;
-
+
/* the XMLElementWrapper of the bufferred element */
com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper > m_xXMLElement;
-private:
+private:
bool isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const;
bool isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurityId) const;
bool isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const;
const BufferNode* getNextChild(const BufferNode* pChild) const;
-
+
public:
explicit BufferNode(
const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& xXMLElement);
virtual ~BufferNode() {};
-
+
bool isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const;
void setReceivedAll();
bool isAllReceived() const;
diff --git a/xmlsecurity/source/framework/decryptorimpl.cxx b/xmlsecurity/source/framework/decryptorimpl.cxx
index a2636f61cdf1..6201920d04c5 100644
--- a/xmlsecurity/source/framework/decryptorimpl.cxx
+++ b/xmlsecurity/source/framework/decryptorimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define SERVICE_NAME "com.sun.star.xml.crypto.sax.Decryptor"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.DecryptorImpl"
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
DecryptorImpl::DecryptorImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF)
@@ -58,28 +58,28 @@ bool DecryptorImpl::checkReady() const
/****** DecryptorImpl/checkReady *********************************************
*
* NAME
- * checkReady -- checks the conditions for the decryption.
+ * checkReady -- checks the conditions for the decryption.
*
* SYNOPSIS
- * bReady = checkReady( );
+ * bReady = checkReady( );
*
* FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the result listener is ready;
- * 2. the EncryptionEngine is ready.
+ * checks whether all following conditions are satisfied:
+ * 1. the result listener is ready;
+ * 2. the EncryptionEngine is ready.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bReady - true if all conditions are satisfied, false otherwise
+ * bReady - true if all conditions are satisfied, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return (m_xResultListener.is() && EncryptionEngine::checkReady());
@@ -90,64 +90,64 @@ void DecryptorImpl::notifyResultListener() const
/****** DecryptorImpl/notifyResultListener ***********************************
*
* NAME
- * notifyResultListener -- notifies the listener about the decryption
- * result.
+ * notifyResultListener -- notifies the listener about the decryption
+ * result.
*
* SYNOPSIS
- * notifyResultListener( );
+ * notifyResultListener( );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::sax::XDecryptionResultListener >
xDecryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
-
+
xDecryptionResultListener->decrypted(m_nSecurityId,m_nStatus);
}
-void DecryptorImpl::startEngine( const cssu::Reference<
+void DecryptorImpl::startEngine( const cssu::Reference<
cssxc::XXMLEncryptionTemplate >&
xEncryptionTemplate)
throw (cssu::Exception, cssu::RuntimeException)
/****** DecryptorImpl/startEngine ********************************************
*
* NAME
- * startEngine -- decrypts the encryption.
+ * startEngine -- decrypts the encryption.
*
* SYNOPSIS
- * startEngine( xEncryptionTemplate );
+ * startEngine( xEncryptionTemplate );
*
* FUNCTION
- * decrypts the encryption element, then if succeeds, updates the link
- * of old template element to the new encryption element in
- * SAXEventKeeper.
+ * decrypts the encryption element, then if succeeds, updates the link
+ * of old template element to the new encryption element in
+ * SAXEventKeeper.
*
* INPUTS
- * xEncryptionTemplate - the encryption template to be decrypted.
+ * xEncryptionTemplate - the encryption template to be decrypted.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::XXMLEncryptionTemplate > xResultTemplate;
@@ -160,7 +160,7 @@ void DecryptorImpl::startEngine( const cssu::Reference<
{
m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED;
}
-
+
if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
{
cssu::Reference< cssxw::XXMLElementWrapper > xDecryptedElement
@@ -168,7 +168,7 @@ void DecryptorImpl::startEngine( const cssu::Reference<
m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xDecryptedElement);
}
}
-
+
/* XDecryptionResultBroadcaster */
void SAL_CALL DecryptorImpl::addDecryptionResultListener( const cssu::Reference< cssxc::sax::XDecryptionResultListener >& listener )
throw (cssu::Exception, cssu::RuntimeException)
@@ -183,13 +183,13 @@ void SAL_CALL DecryptorImpl::removeDecryptionResultListener( const cssu::Referen
}
/* XInitialization */
-void SAL_CALL DecryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
+void SAL_CALL DecryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
throw (cssu::Exception, cssu::RuntimeException)
{
OSL_ASSERT(aArguments.getLength() == 5);
-
+
rtl::OUString ouTempString;
-
+
aArguments[0] >>= ouTempString;
m_nSecurityId = ouTempString.toInt32();
aArguments[1] >>= m_xSAXEventKeeper;
@@ -205,13 +205,13 @@ rtl::OUString DecryptorImpl_getImplementationName ()
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -228,17 +228,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL DecryptorImpl_createInstance( const
}
/* XServiceInfo */
-rtl::OUString SAL_CALL DecryptorImpl::getImplementationName( )
+rtl::OUString SAL_CALL DecryptorImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return DecryptorImpl_getImplementationName();
}
-sal_Bool SAL_CALL DecryptorImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL DecryptorImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return DecryptorImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return DecryptorImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/framework/decryptorimpl.hxx b/xmlsecurity/source/framework/decryptorimpl.hxx
index fa558e97ec9b..cc13ec1b9930 100644
--- a/xmlsecurity/source/framework/decryptorimpl.hxx
+++ b/xmlsecurity/source/framework/decryptorimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@
#include "encryptionengine.hxx"
class DecryptorImpl : public cppu::ImplInheritanceHelper3
-<
+<
EncryptionEngine,
com::sun::star::xml::crypto::sax::XDecryptionResultBroadcaster,
com::sun::star::lang::XInitialization,
@@ -48,19 +48,19 @@ class DecryptorImpl : public cppu::ImplInheritanceHelper3
/****** DecryptorImpl.hxx/CLASS DecryptorImpl *********************************
*
* NAME
- * DecryptorImpl -- decrypts an encryption
+ * DecryptorImpl -- decrypts an encryption
*
* FUNCTION
- * Collects all resources for decrypting an encryption, then decrypts the
- * encryption by invoking a xmlsec-based encryption bridge component.
+ * Collects all resources for decrypting an encryption, then decrypts the
+ * encryption by invoking a xmlsec-based encryption bridge component.
*
* HISTORY
- * 05.01.2004 - Interface supported: XDecryptionResultBroadcaster,
- * XInitialization, XServiceInfo
+ * 05.01.2004 - Interface supported: XDecryptionResultBroadcaster,
+ * XInitialization, XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -68,7 +68,7 @@ private:
* the Id of the encryption, which is used for the result listener to
* identify the encryption.
*/
- sal_Int32 m_nEncryptionId;
+ sal_Int32 m_nEncryptionId;
/*
* the decryption result,
@@ -76,59 +76,59 @@ private:
*/
bool m_bDecryptionSucceed;
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext;
-
+
virtual void notifyResultListener() const
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
virtual bool checkReady() const;
- virtual void startEngine( const com::sun::star::uno::Reference<
+ virtual void startEngine( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLEncryptionTemplate >&
xEncryptionTemplate)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
public:
- explicit DecryptorImpl( const com::sun::star::uno::Reference<
+ explicit DecryptorImpl( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxMSF);
virtual ~DecryptorImpl();
/* XDecryptionResultBroadcaster */
virtual void SAL_CALL addDecryptionResultListener(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
listener )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeDecryptionResultListener(
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
+ virtual void SAL_CALL removeDecryptionResultListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XInitialization */
- virtual void SAL_CALL initialize(
- const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
+ virtual void SAL_CALL initialize(
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString DecryptorImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-SAL_CALL DecryptorImpl_createInstance(
+SAL_CALL DecryptorImpl_createInstance(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&
rSMgr)
throw ( com::sun::star::uno::Exception );
diff --git a/xmlsecurity/source/framework/elementcollector.cxx b/xmlsecurity/source/framework/elementcollector.cxx
index bb001e699aad..a9411d7e5f88 100644
--- a/xmlsecurity/source/framework/elementcollector.cxx
+++ b/xmlsecurity/source/framework/elementcollector.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -54,41 +54,41 @@ ElementCollector::ElementCollector(
/****** ElementCollector/ElementCollector *************************************
*
* NAME
- * ElementCollector -- constructor method
+ * ElementCollector -- constructor method
*
* SYNOPSIS
- * ElementCollector(nSecurityId, nBufferId, nPriority, bToModify
- * xReferenceResolvedListener);
+ * ElementCollector(nSecurityId, nBufferId, nPriority, bToModify
+ * xReferenceResolvedListener);
*
* FUNCTION
- * construct an ElementCollector object.
+ * construct an ElementCollector object.
*
* INPUTS
- * nSecurityId - represents which security entity the buffer node is
- * related with. Either a signature or an encryption is
- * a security entity.
- * nBufferId - the id of the element bufferred in the document
- * wrapper component. The document wrapper component
- * uses this id to search the particular bufferred
- * element.
- * nPriority - the priority value. ElementCollector with lower
- * priority value can't notify until all ElementCollectors
- * with higher priority value have notified.
- * bToModify - A flag representing whether this ElementCollector
- * notification will cause the modification of its working
- * element.
- * xReferenceResolvedListener
- * - the listener that this ElementCollector notifies to.
+ * nSecurityId - represents which security entity the buffer node is
+ * related with. Either a signature or an encryption is
+ * a security entity.
+ * nBufferId - the id of the element bufferred in the document
+ * wrapper component. The document wrapper component
+ * uses this id to search the particular bufferred
+ * element.
+ * nPriority - the priority value. ElementCollector with lower
+ * priority value can't notify until all ElementCollectors
+ * with higher priority value have notified.
+ * bToModify - A flag representing whether this ElementCollector
+ * notification will cause the modification of its working
+ * element.
+ * xReferenceResolvedListener
+ * - the listener that this ElementCollector notifies to.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_type = cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR;
@@ -115,26 +115,26 @@ void ElementCollector::notifyListener()
/****** ElementCollector/notifyListener ***************************************
*
* NAME
- * notifyListener -- enable the ability to notify the listener
+ * notifyListener -- enable the ability to notify the listener
*
* SYNOPSIS
- * notifyListener();
+ * notifyListener();
*
* FUNCTION
- * enable the ability to notify the listener and try to notify then.
+ * enable the ability to notify the listener and try to notify then.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_bAbleToNotify = true;
@@ -151,27 +151,27 @@ void ElementCollector::setReferenceResolvedListener(
/****** ElementCollector/setReferenceResolvedListener *************************
*
* NAME
- * setReferenceResolvedListener -- configures a listener for the buffer
- * node in this object
+ * setReferenceResolvedListener -- configures a listener for the buffer
+ * node in this object
*
* SYNOPSIS
- * setReferenceResolvedListener(xReferenceResolvedListener);
+ * setReferenceResolvedListener(xReferenceResolvedListener);
*
* FUNCTION
- * configures a new listener and try to notify then.
+ * configures a new listener and try to notify then.
*
* INPUTS
- * xReferenceResolvedListener - the new listener
+ * xReferenceResolvedListener - the new listener
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_xReferenceResolvedListener = xReferenceResolvedListener;
@@ -182,26 +182,26 @@ void ElementCollector::setSecurityId(sal_Int32 nSecurityId)
/****** ElementCollector/setSecurityId ****************************************
*
* NAME
- * setSecurityId -- configures the security Id of the buffer node
+ * setSecurityId -- configures the security Id of the buffer node
*
* SYNOPSIS
- * setSecurityId(nSecurityId);
+ * setSecurityId(nSecurityId);
*
* FUNCTION
- * configures the security Id and try to notify then
+ * configures the security Id and try to notify then
*
* INPUTS
- * nSecurityId - the security Id
+ * nSecurityId - the security Id
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_nSecurityId = nSecurityId;
@@ -212,30 +212,30 @@ void ElementCollector::doNotify()
/****** ElementCollector/doNotify *********************************************
*
* NAME
- * doNotify -- tries to notify the listener
+ * doNotify -- tries to notify the listener
*
* SYNOPSIS
- * doNotify();
+ * doNotify();
*
* FUNCTION
- * notifies the listener when all below conditions are satisfied:
- * the listener has not been notified;
- * the notify right is granted;
- * the listener has already been configured;
- * the security id has already been configure
+ * notifies the listener when all below conditions are satisfied:
+ * the listener has not been notified;
+ * the notify right is granted;
+ * the listener has already been configured;
+ * the security id has already been configure
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (!m_bNotified &&
@@ -254,44 +254,44 @@ ElementCollector* ElementCollector::clone(
/****** ElementCollector/clone ************************************************
*
* NAME
- * clone -- duplicates this ElementCollector object
+ * clone -- duplicates this ElementCollector object
*
* SYNOPSIS
- * cloned = clone(nBufferId, nPriority);
+ * cloned = clone(nBufferId, nPriority);
*
* FUNCTION
- * duplicates this ElementCollector object with new buffer Id, priority.
+ * duplicates this ElementCollector object with new buffer Id, priority.
*
* INPUTS
- * nBufferId - the buffer node's Id
- * nPriority - the priority
+ * nBufferId - the buffer node's Id
+ * nPriority - the priority
*
* RESULT
- * clone - a new ElementCollector
+ * clone - a new ElementCollector
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
- ElementCollector* pClonedOne
- = new ElementCollector(m_nSecurityId,
+ ElementCollector* pClonedOne
+ = new ElementCollector(m_nSecurityId,
nBufferId, nPriority, m_bToModify,
m_xReferenceResolvedListener);
-
+
if (m_bAbleToNotify)
{
pClonedOne->notifyListener();
}
-
+
if (m_pBufferNode != NULL)
{
m_pBufferNode->addElementCollector(pClonedOne);
}
-
+
return pClonedOne;
}
diff --git a/xmlsecurity/source/framework/elementcollector.hxx b/xmlsecurity/source/framework/elementcollector.hxx
index 12343bac2675..25e8bcce0c76 100644
--- a/xmlsecurity/source/framework/elementcollector.hxx
+++ b/xmlsecurity/source/framework/elementcollector.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,19 +37,19 @@ class ElementCollector : public ElementMark
/****** elementcollector.hxx/CLASS ElementCollector ***************************
*
* NAME
- * ElementCollector -- Class to manipulate an element collector
+ * ElementCollector -- Class to manipulate an element collector
*
* FUNCTION
- * This class is derived from the ElementMark class. Beyond the function
- * of the ElementMark class, this class also maintains the priority, and
- * manages the notify process
+ * This class is derived from the ElementMark class. Beyond the function
+ * of the ElementMark class, this class also maintains the priority, and
+ * manages the notify process
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -61,23 +61,23 @@ private:
* internal modification happens.
*/
com::sun::star::xml::crypto::sax::ElementMarkPriority m_nPriority;
-
+
/*
* the modify flag, representing whether which elementcollector will
* modify its data.
*/
bool m_bToModify;
-
+
/* the notify enable flag, see notifyListener method */
bool m_bAbleToNotify;
-
+
/* whether the listener has been notified */
bool m_bNotified;
-
+
/* the listener to be notified */
com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XReferenceResolvedListener > m_xReferenceResolvedListener;
-
+
public:
ElementCollector(
sal_Int32 nSecurityId,
@@ -88,7 +88,7 @@ public:
com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
xReferenceResolvedListener);
virtual ~ElementCollector() {};
-
+
//bool isInternalNotificationSuppressed() const;
com::sun::star::xml::crypto::sax::ElementMarkPriority getPriority() const;
bool getModify() const;
diff --git a/xmlsecurity/source/framework/elementmark.cxx b/xmlsecurity/source/framework/elementmark.cxx
index 8393af447d83..44ee850307d0 100644
--- a/xmlsecurity/source/framework/elementmark.cxx
+++ b/xmlsecurity/source/framework/elementmark.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,32 +42,32 @@ ElementMark::ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId)
/****** ElementMark/ElementMark ***********************************************
*
* NAME
- * ElementMark -- constructor method
+ * ElementMark -- constructor method
*
* SYNOPSIS
- * ElementMark(nSecurityId, nBufferId);
+ * ElementMark(nSecurityId, nBufferId);
*
* FUNCTION
- * construct an ElementMark object.
+ * construct an ElementMark object.
*
* INPUTS
- * nSecurityId - represents which security entity the buffer node is
- * related with. Either a signature or an encryption is
- * a security entity.
- * nBufferId - the id of the element bufferred in the document
- * wrapper component. The document wrapper component
- * uses this id to search the particular bufferred
- * element.
+ * nSecurityId - represents which security entity the buffer node is
+ * related with. Either a signature or an encryption is
+ * a security entity.
+ * nBufferId - the id of the element bufferred in the document
+ * wrapper component. The document wrapper component
+ * uses this id to search the particular bufferred
+ * element.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
}
diff --git a/xmlsecurity/source/framework/elementmark.hxx b/xmlsecurity/source/framework/elementmark.hxx
index bc844cf66541..7cb0378448e6 100644
--- a/xmlsecurity/source/framework/elementmark.hxx
+++ b/xmlsecurity/source/framework/elementmark.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,38 +38,38 @@ class ElementMark
/****** elementmark.hxx/CLASS ElementMark *************************************
*
* NAME
- * ElementMark -- Class to manipulate an element mark
+ * ElementMark -- Class to manipulate an element mark
*
* FUNCTION
- * This class maintains the security id, buffer id and its type for a
- * buffer node.
+ * This class maintains the security id, buffer id and its type for a
+ * buffer node.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
protected:
/* the BufferNode maintained by this object */
BufferNode* m_pBufferNode;
-
+
/* the security Id */
sal_Int32 m_nSecurityId;
-
+
/* the buffer Id */
sal_Int32 m_nBufferId;
-
+
/*
* the type value, is one of following values:
- * TYPEOFELEMENTMARK - the default value, represents an blocker if
+ * TYPEOFELEMENTMARK - the default value, represents an blocker if
* not changed
* TYPEOFELEMENTCOLLECTOR - represents an ElementCollector
*/
com::sun::star::xml::crypto::sax::ElementMarkType m_type;
-
+
public:
ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId);
virtual ~ElementMark() {};
diff --git a/xmlsecurity/source/framework/encryptionengine.cxx b/xmlsecurity/source/framework/encryptionengine.cxx
index 43df7f677b48..d05600dabd38 100644
--- a/xmlsecurity/source/framework/encryptionengine.cxx
+++ b/xmlsecurity/source/framework/encryptionengine.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define ENCRYPTION_TEMPLATE "com.sun.star.xml.crypto.XMLEncryptionTemplate"
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
EncryptionEngine::EncryptionEngine( )
@@ -53,31 +53,31 @@ bool EncryptionEngine::checkReady() const
/****** EncryptionEngine/checkReady ******************************************
*
* NAME
- * checkReady -- checks the conditions for the main operation.
+ * checkReady -- checks the conditions for the main operation.
*
* SYNOPSIS
- * bReady = checkReady( );
+ * bReady = checkReady( );
*
* FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the main operation has't begun yet;
- * 2. the key material is known;
- * 3. the id of the template blocker is known;
- * 4. both the key element and the encryption template
- * are bufferred.
+ * checks whether all following conditions are satisfied:
+ * 1. the main operation has't begun yet;
+ * 2. the key material is known;
+ * 3. the id of the template blocker is known;
+ * 4. both the key element and the encryption template
+ * are bufferred.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bReady - true if all conditions are satisfied, false otherwise
+ * bReady - true if all conditions are satisfied, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = true;
@@ -95,65 +95,65 @@ bool EncryptionEngine::checkReady() const
{
rc = false;
}
-
+
return rc;
}
-void EncryptionEngine::tryToPerform( )
+void EncryptionEngine::tryToPerform( )
throw (cssu::Exception, cssu::RuntimeException)
/****** EncryptionEngine/tryToPerform ****************************************
*
* NAME
- * tryToPerform -- tries to perform the encryption/decryption operation.
+ * tryToPerform -- tries to perform the encryption/decryption operation.
*
* SYNOPSIS
- * tryToPerform( );
+ * tryToPerform( );
*
* FUNCTION
- * if the situation is ready, perform following operations.
- * 1. prepares a encryption template;
- * 2. calls the encryption bridge component;
- * 3. clears up all used resources;
- * 4. notifies the result listener;
- * 5. sets the "accomplishment" flag.
+ * if the situation is ready, perform following operations.
+ * 1. prepares a encryption template;
+ * 2. calls the encryption bridge component;
+ * 3. clears up all used resources;
+ * 4. notifies the result listener;
+ * 5. sets the "accomplishment" flag.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (checkReady())
{
- const rtl::OUString sEncryptionTemplate (
- RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_TEMPLATE ) );
+ const rtl::OUString sEncryptionTemplate (
+ RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_TEMPLATE ) );
cssu::Reference < cssxc::XXMLEncryptionTemplate > xEncryptionTemplate(
mxMSF->createInstance( sEncryptionTemplate ), cssu::UNO_QUERY );
-
+
OSL_ASSERT( xEncryptionTemplate.is() );
-
- cssu::Reference< cssxw::XXMLElementWrapper > xXMLElement
+
+ cssu::Reference< cssxw::XXMLElementWrapper > xXMLElement
= m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC );
-
+
xEncryptionTemplate->setTemplate(xXMLElement);
-
+
startEngine( xEncryptionTemplate );
-
+
/*
* done
*/
clearUp( );
-
+
notifyResultListener();
-
+
m_bMissionDone = true;
}
}
@@ -162,45 +162,45 @@ void EncryptionEngine::clearUp( ) const
/****** EncryptionEngine/clearup *********************************************
*
* NAME
- * clearUp -- clear up all resources used by this operation.
+ * clearUp -- clear up all resources used by this operation.
*
* SYNOPSIS
- * clearUp( );
+ * clearUp( );
*
* FUNCTION
- * cleaning resources up includes:
- * 1. releases the ElementCollector for the encryption template element;
- * 2. releases the Blocker for the encryption template element;
- * 3. releases the ElementCollector for the key element, if there is one.
+ * cleaning resources up includes:
+ * 1. releases the ElementCollector for the encryption template element;
+ * 2. releases the Blocker for the encryption template element;
+ * 3. releases the ElementCollector for the key element, if there is one.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
- cssu::Reference < cssxc::sax::XReferenceResolvedBroadcaster >
+ cssu::Reference < cssxc::sax::XReferenceResolvedBroadcaster >
xReferenceResolvedBroadcaster( m_xSAXEventKeeper, cssu::UNO_QUERY );
-
+
xReferenceResolvedBroadcaster->removeReferenceResolvedListener(
- m_nIdOfTemplateEC,
+ m_nIdOfTemplateEC,
(const cssu::Reference < cssxc::sax::XReferenceResolvedListener >)((SecurityEngine *)this));
-
+
m_xSAXEventKeeper->removeElementCollector(m_nIdOfTemplateEC);
-
+
if (m_nIdOfBlocker != -1)
{
m_xSAXEventKeeper->removeBlocker(m_nIdOfBlocker);
}
-
+
if (m_nIdOfKeyEC != 0 && m_nIdOfKeyEC != -1)
{
m_xSAXEventKeeper->removeElementCollector(m_nIdOfKeyEC);
diff --git a/xmlsecurity/source/framework/encryptionengine.hxx b/xmlsecurity/source/framework/encryptionengine.hxx
index ef6f2dc09fb2..094a039e86b2 100644
--- a/xmlsecurity/source/framework/encryptionengine.hxx
+++ b/xmlsecurity/source/framework/encryptionengine.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,24 +42,24 @@
#include "securityengine.hxx"
class EncryptionEngine : public cppu::ImplInheritanceHelper1
-<
- SecurityEngine,
+<
+ SecurityEngine,
com::sun::star::xml::crypto::sax::XBlockerMonitor
>
/****** encryptionEngine.hxx/CLASS encryptionEngine ***************************
*
* NAME
- * EncryptionEngine -- Base class of Encryptor and Decryptor
+ * EncryptionEngine -- Base class of Encryptor and Decryptor
*
* FUNCTION
- * Maintains common members and methods related with encryption.
+ * Maintains common members and methods related with encryption.
*
* HISTORY
- * 05.01.2004 - Interface supported: XBlockerMonitor
+ * 05.01.2004 - Interface supported: XBlockerMonitor
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
protected:
@@ -67,29 +67,29 @@ protected:
* the Encryption bridge component, which performs encrypt and decrypt
* operation based on xmlsec library.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLEncryption > m_xXMLEncryption;
/*
* the Id of template blocker.
*/
sal_Int32 m_nIdOfBlocker;
-
+
protected:
EncryptionEngine( );
virtual ~EncryptionEngine(){};
-
- virtual void tryToPerform( )
+
+ virtual void tryToPerform( )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
- virtual void clearUp( ) const;
+ virtual void clearUp( ) const;
virtual bool checkReady() const;
-
+
/*
* starts the main function. This method will be implemented by any sub-class.
* For a Encryptor, it performs encryption operation;
* for a Decryptor, decryption operation is performed.
*/
- virtual void startEngine( const com::sun::star::uno::Reference<
+ virtual void startEngine( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLEncryptionTemplate >&)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
{};
diff --git a/xmlsecurity/source/framework/encryptorimpl.cxx b/xmlsecurity/source/framework/encryptorimpl.cxx
index b6d86ee8b1f1..2c2328eb5299 100644
--- a/xmlsecurity/source/framework/encryptorimpl.cxx
+++ b/xmlsecurity/source/framework/encryptorimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define SERVICE_NAME "com.sun.star.xml.crypto.sax.Encryptor"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.EncryptorImpl"
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
EncryptorImpl::EncryptorImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF)
@@ -59,28 +59,28 @@ bool EncryptorImpl::checkReady() const
/****** EncryptorImpl/checkReady *********************************************
*
* NAME
- * checkReady -- checks the conditions for the encryption.
+ * checkReady -- checks the conditions for the encryption.
*
* SYNOPSIS
- * bReady = checkReady( );
+ * bReady = checkReady( );
*
* FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the result listener is ready;
- * 2. the EncryptionEngine is ready.
+ * checks whether all following conditions are satisfied:
+ * 1. the result listener is ready;
+ * 2. the EncryptionEngine is ready.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bReady - true if all conditions are satisfied, false otherwise
+ * bReady - true if all conditions are satisfied, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
sal_Int32 nKeyInc = 0;
@@ -88,9 +88,9 @@ bool EncryptorImpl::checkReady() const
{
nKeyInc = 1;
}
-
+
return (m_xResultListener.is() &&
- (m_nReferenceId != -1) &&
+ (m_nReferenceId != -1) &&
(2+nKeyInc == m_nNumOfResolvedReferences) &&
EncryptionEngine::checkReady());
}
@@ -100,73 +100,73 @@ void EncryptorImpl::notifyResultListener() const
/****** DecryptorImpl/notifyResultListener ***********************************
*
* NAME
- * notifyResultListener -- notifies the listener about the encryption
- * result.
+ * notifyResultListener -- notifies the listener about the encryption
+ * result.
*
* SYNOPSIS
- * notifyResultListener( );
+ * notifyResultListener( );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::sax::XEncryptionResultListener >
xEncryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
-
+
xEncryptionResultListener->encrypted( m_nSecurityId, m_nStatus );
}
-void EncryptorImpl::startEngine( const cssu::Reference<
+void EncryptorImpl::startEngine( const cssu::Reference<
cssxc::XXMLEncryptionTemplate >&
xEncryptionTemplate)
throw (cssu::Exception, cssu::RuntimeException)
/****** EncryptorImpl/startEngine ********************************************
*
* NAME
- * startEngine -- generates the encryption.
+ * startEngine -- generates the encryption.
*
* SYNOPSIS
- * startEngine( xEncryptionTemplate );
+ * startEngine( xEncryptionTemplate );
*
* FUNCTION
- * generates the encryption element, then if succeeds, updates the link
- * of old template element to the new encryption element in
- * SAXEventKeeper.
+ * generates the encryption element, then if succeeds, updates the link
+ * of old template element to the new encryption element in
+ * SAXEventKeeper.
*
* INPUTS
- * xEncryptionTemplate - the encryption template to be encrypted.
+ * xEncryptionTemplate - the encryption template to be encrypted.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference < cssxc::XXMLEncryptionTemplate > xResultTemplate;
-
+
cssu::Reference< cssxw::XXMLElementWrapper >
xXMLElement = m_xSAXEventKeeper->getElement( m_nReferenceId );
xEncryptionTemplate->setTarget(xXMLElement);
-
- try
+
+ try
{
xResultTemplate = m_xXMLEncryption->encrypt(
xEncryptionTemplate, m_xSecurityEnvironment);
@@ -176,10 +176,10 @@ void EncryptorImpl::startEngine( const cssu::Reference<
{
m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED;
}
-
+
if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
{
- cssu::Reference < cssxw::XXMLElementWrapper > xResultEncryption
+ cssu::Reference < cssxw::XXMLElementWrapper > xResultEncryption
= xResultTemplate->getTemplate();
m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultEncryption);
m_xSAXEventKeeper->setElement(m_nReferenceId, NULL);
@@ -196,7 +196,7 @@ void SAL_CALL EncryptorImpl::setReferenceCount(sal_Int32)
* so the referenceNumber is always 1
*/
}
-
+
void SAL_CALL EncryptorImpl::setReferenceId( sal_Int32 id )
throw (cssu::Exception, cssu::RuntimeException)
{
@@ -215,15 +215,15 @@ void SAL_CALL EncryptorImpl::removeEncryptionResultListener( const cssu::Referen
throw (cssu::RuntimeException)
{
}
-
+
/* XInitialization */
-void SAL_CALL EncryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
+void SAL_CALL EncryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
throw (cssu::Exception, cssu::RuntimeException)
{
OSL_ASSERT(aArguments.getLength() == 5);
rtl::OUString ouTempString;
-
+
aArguments[0] >>= ouTempString;
m_nSecurityId = ouTempString.toInt32();
aArguments[1] >>= m_xSAXEventKeeper;
@@ -232,7 +232,7 @@ void SAL_CALL EncryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArg
aArguments[3] >>= m_xSecurityEnvironment;
aArguments[4] >>= m_xXMLEncryption;
}
-
+
rtl::OUString EncryptorImpl_getImplementationName ()
throw (cssu::RuntimeException)
@@ -240,13 +240,13 @@ rtl::OUString EncryptorImpl_getImplementationName ()
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL EncryptorImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL EncryptorImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -256,7 +256,7 @@ cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames(
}
#undef SERVICE_NAME
-cssu::Reference< cssu::XInterface > SAL_CALL EncryptorImpl_createInstance(
+cssu::Reference< cssu::XInterface > SAL_CALL EncryptorImpl_createInstance(
const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr)
throw( cssu::Exception )
{
@@ -264,17 +264,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL EncryptorImpl_createInstance(
}
/* XServiceInfo */
-rtl::OUString SAL_CALL EncryptorImpl::getImplementationName( )
+rtl::OUString SAL_CALL EncryptorImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return EncryptorImpl_getImplementationName();
}
-sal_Bool SAL_CALL EncryptorImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL EncryptorImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return EncryptorImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return EncryptorImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/framework/encryptorimpl.hxx b/xmlsecurity/source/framework/encryptorimpl.hxx
index 2d5e2e8aa444..51b579dad51c 100644
--- a/xmlsecurity/source/framework/encryptorimpl.hxx
+++ b/xmlsecurity/source/framework/encryptorimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,18 +50,18 @@ class EncryptorImpl : public cppu::ImplInheritanceHelper4
/****** EncryptorImpl.hxx/CLASS EncryptorImpl *********************************
*
* NAME
- * EncryptorImpl -- generates an encryption
+ * EncryptorImpl -- generates an encryption
*
* FUNCTION
- * Collects all resources for an encryption generation, then generates the
- * encryption by invoking a xmlsec-based encryption bridge component.
+ * Collects all resources for an encryption generation, then generates the
+ * encryption by invoking a xmlsec-based encryption bridge component.
*
* HISTORY
- * 05.01.2004 - Interface supported: XInitialization, XServiceInfo
+ * 05.01.2004 - Interface supported: XInitialization, XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -69,79 +69,79 @@ private:
* the Id of the encryption, which is used for the result listener to
* identify the encryption.
*/
- sal_Int32 m_nEncryptionId;
-
+ sal_Int32 m_nEncryptionId;
+
/*
* the Id of the element to be encrypted.
*/
sal_Int32 m_nReferenceId;
-
+
/*
* the decryption result,
* remembers whether the encryption succeeds.
*/
bool m_bEncryptionSucceed;
-
- com::sun::star::uno::Reference<
+
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment;
-
+
virtual void notifyResultListener() const
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
virtual bool checkReady() const;
- virtual void startEngine( const com::sun::star::uno::Reference<
+ virtual void startEngine( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLEncryptionTemplate >&
xEncryptionTemplate)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
public:
- explicit EncryptorImpl( const com::sun::star::uno::Reference<
+ explicit EncryptorImpl( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxMSF);
virtual ~EncryptorImpl();
/* XEncryptionResultBroadcaster */
virtual void SAL_CALL addEncryptionResultListener(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XEncryptionResultListener >&
listener )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeEncryptionResultListener(
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XEncryptionResultListener >&
+ virtual void SAL_CALL removeEncryptionResultListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XEncryptionResultListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
/* XReferenceCollector */
virtual void SAL_CALL setReferenceCount( sal_Int32 count )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setReferenceId( sal_Int32 id )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
/* XInitialization */
- virtual void SAL_CALL initialize(
- const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
+ virtual void SAL_CALL initialize(
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString EncryptorImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL EncryptorImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL EncryptorImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-SAL_CALL EncryptorImpl_createInstance(
+SAL_CALL EncryptorImpl_createInstance(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr)
throw ( com::sun::star::uno::Exception );
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
index 5f19a305a748..f3519f46206b 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -70,17 +70,17 @@ SAXEventKeeperImpl::~SAXEventKeeperImpl()
m_pRootBufferNode->freeAllChildren();
delete m_pRootBufferNode;
}
-
+
m_pRootBufferNode = m_pCurrentBufferNode = m_pCurrentBlockingBufferNode = NULL;
-
+
/*
* delete all unfreed ElementMarks
*/
m_vNewElementCollectors.clear();
m_pNewBlocker = NULL;
-
+
std::vector< const ElementMark* >::const_iterator ii = m_vElementMarkBuffers.begin();
- for( ; ii != m_vElementMarkBuffers.end(); ++ii )
+ for( ; ii != m_vElementMarkBuffers.end(); ++ii )
{
delete (*ii);
}
@@ -91,32 +91,32 @@ void SAXEventKeeperImpl::setCurrentBufferNode(BufferNode* pBufferNode)
/****** SAXEventKeeperImpl/setCurrentBufferNode ******************************
*
* NAME
- * setCurrentBufferNode -- set a new active BufferNode.
+ * setCurrentBufferNode -- set a new active BufferNode.
*
* SYNOPSIS
- * setCurrentBufferNode( pBufferNode );
+ * setCurrentBufferNode( pBufferNode );
*
* FUNCTION
- * connects this BufferNode into the BufferNode tree as a child of the
- * current active BufferNode. Then makes this BufferNode as the current
- * active BufferNode.
- * If the previous active BufferNode points to the root
- * BufferNode, which means that no buffering operation was proceeding,
- * then notifies the status change listener that buffering operation
- * will begin at once.
+ * connects this BufferNode into the BufferNode tree as a child of the
+ * current active BufferNode. Then makes this BufferNode as the current
+ * active BufferNode.
+ * If the previous active BufferNode points to the root
+ * BufferNode, which means that no buffering operation was proceeding,
+ * then notifies the status change listener that buffering operation
+ * will begin at once.
*
* INPUTS
- * pBufferNode - a BufferNode which will be the new active BufferNode
+ * pBufferNode - a BufferNode which will be the new active BufferNode
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (pBufferNode != m_pCurrentBufferNode)
@@ -126,13 +126,13 @@ void SAXEventKeeperImpl::setCurrentBufferNode(BufferNode* pBufferNode)
{
m_xSAXEventKeeperStatusChangeListener->collectionStatusChanged(sal_True);
}
-
+
if (pBufferNode->getParent() == NULL)
{
m_pCurrentBufferNode->addChild(pBufferNode);
pBufferNode->setParent(m_pCurrentBufferNode);
}
-
+
m_pCurrentBufferNode = pBufferNode;
}
}
@@ -141,30 +141,30 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers()
/****** SAXEventKeeperImpl/addNewElementMarkBuffers **************************
*
* NAME
- * addNewElementMarkBuffers -- add new ElementCollectors and new Blocker.
+ * addNewElementMarkBuffers -- add new ElementCollectors and new Blocker.
*
* SYNOPSIS
- * pBufferNode = addNewElementMarkBuffers( );
+ * pBufferNode = addNewElementMarkBuffers( );
*
* FUNCTION
- * if there are new ElementCollector or new Blocker to be added, then
- * connect all of them with the current BufferNode. In case of the
- * current BufferNode doesn't exist, creates one.
- * Clears up the new ElementCollector list and the new Blocker pointer.
+ * if there are new ElementCollector or new Blocker to be added, then
+ * connect all of them with the current BufferNode. In case of the
+ * current BufferNode doesn't exist, creates one.
+ * Clears up the new ElementCollector list and the new Blocker pointer.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * pBufferNode - the BufferNode that has been connected with both new
- * ElementCollectors and new Blocker.
+ * pBufferNode - the BufferNode that has been connected with both new
+ * ElementCollectors and new Blocker.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* pBufferNode = NULL;
@@ -178,7 +178,7 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers()
* no new BufferNode is needed to create.
* This situation can only happen in the "Forwarding" mode.
*/
- if ( (m_pCurrentBufferNode != NULL) &&
+ if ( (m_pCurrentBufferNode != NULL) &&
(m_xXMLDocument->isCurrent(m_pCurrentBufferNode->getXMLElement())))
{
pBufferNode = m_pCurrentBufferNode;
@@ -187,11 +187,11 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers()
{
pBufferNode = new BufferNode(m_xXMLDocument->getCurrentElement());
}
-
+
if (m_pNewBlocker != NULL)
{
pBufferNode->setBlocker(m_pNewBlocker);
-
+
/*
* If no blocking before, then notify the status change listener that
* the SAXEventKeeper has entered "blocking" status, during which, no
@@ -200,29 +200,29 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers()
if (m_pCurrentBlockingBufferNode == NULL)
{
m_pCurrentBlockingBufferNode = pBufferNode;
-
+
if (m_xSAXEventKeeperStatusChangeListener.is())
{
m_xSAXEventKeeperStatusChangeListener->blockingStatusChanged(sal_True);
}
}
-
+
m_pNewBlocker = NULL;
}
-
+
if (m_vNewElementCollectors.size()>0)
{
std::vector< const ElementCollector* >::const_iterator ii = m_vNewElementCollectors.begin();
-
- for( ; ii != m_vNewElementCollectors.end(); ++ii )
+
+ for( ; ii != m_vNewElementCollectors.end(); ++ii )
{
pBufferNode->addElementCollector(*ii);
}
-
+
m_vNewElementCollectors.clear();
}
}
-
+
return pBufferNode;
}
@@ -230,35 +230,35 @@ ElementMark* SAXEventKeeperImpl::findElementMarkBuffer(sal_Int32 nId) const
/****** SAXEventKeeperImpl/findElementMarkBuffer *****************************
*
* NAME
- * findElementMarkBuffer -- finds an ElementMark.
+ * findElementMarkBuffer -- finds an ElementMark.
*
* SYNOPSIS
- * pElementMark = findElementMarkBuffer( nId );
+ * pElementMark = findElementMarkBuffer( nId );
*
* FUNCTION
- * searches an ElementMark with the particular Id in the ElementMark
- * list.
+ * searches an ElementMark with the particular Id in the ElementMark
+ * list.
*
* INPUTS
- * nId - the Id of the ElementMark to be searched.
+ * nId - the Id of the ElementMark to be searched.
*
* RESULT
- * pElementMark - the ElementMark with the particular Id, or NULL when
- * no such Id exists.
+ * pElementMark - the ElementMark with the particular Id, or NULL when
+ * no such Id exists.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
ElementMark* pElementMark = NULL;
-
+
std::vector< const ElementMark* >::const_iterator ii = m_vElementMarkBuffers.begin();
-
- for( ; ii != m_vElementMarkBuffers.end(); ++ii )
+
+ for( ; ii != m_vElementMarkBuffers.end(); ++ii )
{
if ( nId == (*ii)->getBufferId())
{
@@ -266,7 +266,7 @@ ElementMark* SAXEventKeeperImpl::findElementMarkBuffer(sal_Int32 nId) const
break;
}
}
-
+
return pElementMark;
}
@@ -274,31 +274,31 @@ void SAXEventKeeperImpl::removeElementMarkBuffer(sal_Int32 nId)
/****** SAXEventKeeperImpl/removeElementMarkBuffer ***************************
*
* NAME
- * removeElementMarkBuffer -- removes an ElementMark
+ * removeElementMarkBuffer -- removes an ElementMark
*
* SYNOPSIS
- * removeElementMarkBuffer( nId );
+ * removeElementMarkBuffer( nId );
*
* FUNCTION
- * removes an ElementMark with the particular Id in the ElementMark list.
+ * removes an ElementMark with the particular Id in the ElementMark list.
*
* INPUTS
- * nId - the Id of the ElementMark to be removed.
+ * nId - the Id of the ElementMark to be removed.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< const ElementMark* >::iterator ii = m_vElementMarkBuffers.begin();
-
- for( ; ii != m_vElementMarkBuffers.end(); ++ii )
+
+ for( ; ii != m_vElementMarkBuffers.end(); ++ii )
{
if ( nId == (*ii)->getBufferId())
{
@@ -306,7 +306,7 @@ void SAXEventKeeperImpl::removeElementMarkBuffer(sal_Int32 nId)
* checks whether this ElementMark still in the new ElementCollect array
*/
std::vector< const ElementCollector* >::iterator jj = m_vNewElementCollectors.begin();
- for( ; jj != m_vNewElementCollectors.end(); ++jj )
+ for( ; jj != m_vNewElementCollectors.end(); ++jj )
{
if ((*ii) == (*jj))
{
@@ -314,7 +314,7 @@ void SAXEventKeeperImpl::removeElementMarkBuffer(sal_Int32 nId)
break;
}
}
-
+
/*
* checks whether this ElementMark is the new Blocker
*/
@@ -322,12 +322,12 @@ void SAXEventKeeperImpl::removeElementMarkBuffer(sal_Int32 nId)
{
m_pNewBlocker = NULL;
}
-
+
/*
* destory the ElementMark
*/
delete (*ii);
-
+
m_vElementMarkBuffers.erase( ii );
break;
}
@@ -339,36 +339,36 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode(
/****** SAXEventKeeperImpl/printBufferNode ***********************************
*
* NAME
- * printBufferNode -- retrieves the information of a BufferNode and its
- * branch.
+ * printBufferNode -- retrieves the information of a BufferNode and its
+ * branch.
*
* SYNOPSIS
- * info = printBufferNode( pBufferNode, nIndent );
+ * info = printBufferNode( pBufferNode, nIndent );
*
* FUNCTION
- * all retrieved information includes:
- * 1. whether it is the current BufferNode;
- * 2. whether it is the current blocking BufferNode;
- * 3. the name of the parent element;
- * 4. the name of this element;
- * 5. all ElementCollectors working on this BufferNode;
- * 6. the Blocker working on this BufferNode;
- * 7. all child BufferNodes' information.
+ * all retrieved information includes:
+ * 1. whether it is the current BufferNode;
+ * 2. whether it is the current blocking BufferNode;
+ * 3. the name of the parent element;
+ * 4. the name of this element;
+ * 5. all ElementCollectors working on this BufferNode;
+ * 6. the Blocker working on this BufferNode;
+ * 7. all child BufferNodes' information.
*
* INPUTS
- * pBufferNode - the BufferNode from where information will be retrieved.
- * nIndent - how many space characters prefixed before the output
- * message.
+ * pBufferNode - the BufferNode from where information will be retrieved.
+ * nIndent - how many space characters prefixed before the output
+ * message.
*
* RESULT
- * info - the information string
+ * info - the information string
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
rtl::OUString rc;
@@ -382,7 +382,7 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode(
{
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[%]" ));
}
-
+
if (pBufferNode == m_pCurrentBlockingBufferNode)
{
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[B]" ));
@@ -390,7 +390,7 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode(
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ));
rc += m_xXMLDocument->getNodeName(pBufferNode->getXMLElement());
-
+
BufferNode* pParent = (BufferNode*)pBufferNode->getParent();
if (pParent != NULL)
{
@@ -398,11 +398,11 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode(
rc += m_xXMLDocument->getNodeName(pParent->getXMLElement());
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "]" ));
}
-
+
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":EC=" ));
rc += pBufferNode->printChildren();
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " BR=" ));
-
+
ElementMark * pBlocker = pBufferNode->getBlocker();
if (pBlocker != NULL)
{
@@ -413,63 +413,63 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode(
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ));
}
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
-
+
std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren();
std::vector< const BufferNode* >::const_iterator jj = vChildren->begin();
- for( ; jj != vChildren->end(); ++jj )
+ for( ; jj != vChildren->end(); ++jj )
{
rc += printBufferNode((BufferNode *)*jj, nIndent+4);
}
-
+
delete vChildren;
-
+
return rc;
}
-cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
+cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
SAXEventKeeperImpl::collectChildWorkingElement(BufferNode* pBufferNode) const
/****** SAXEventKeeperImpl/collectChildWorkingElement ************************
*
* NAME
- * collectChildWorkingElement -- collects a BufferNode's all child
- * Elements.
+ * collectChildWorkingElement -- collects a BufferNode's all child
+ * Elements.
*
* SYNOPSIS
- * list = collectChildWorkingElement( pBufferNode );
+ * list = collectChildWorkingElement( pBufferNode );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * pBufferNode - the BufferNode whose child Elements will be collected.
+ * pBufferNode - the BufferNode whose child Elements will be collected.
*
* RESULT
- * list - the child Elements list.
+ * list - the child Elements list.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren();
-
- cssu::Sequence < cssu::Reference<
+
+ cssu::Sequence < cssu::Reference<
cssxw::XXMLElementWrapper > > aChildrenCollection ( vChildren->size());
-
+
std::vector< const BufferNode* >::const_iterator ii = vChildren->begin();
-
+
sal_Int32 nIndex = 0;
- for( ; ii != vChildren->end(); ++ii )
+ for( ; ii != vChildren->end(); ++ii )
{
aChildrenCollection[nIndex] = (*ii)->getXMLElement();
nIndex++;
}
-
+
delete vChildren;
-
+
return aChildrenCollection;
}
@@ -478,47 +478,47 @@ void SAXEventKeeperImpl::smashBufferNode(
/****** SAXEventKeeperImpl/smashBufferNode ***********************************
*
* NAME
- * smashBufferNode -- removes a BufferNode along with its working
- * element.
+ * smashBufferNode -- removes a BufferNode along with its working
+ * element.
*
* SYNOPSIS
- * smashBufferNode( pBufferNode, bClearRoot );
+ * smashBufferNode( pBufferNode, bClearRoot );
*
* FUNCTION
- * removes the BufferNode's working element from the DOM document, while
- * reserves all ancestor paths for its child BufferNodes.
- * when any of the BufferNode's ancestor element is useless, removes it
- * too.
- * removes the BufferNode from the BufferNode tree.
+ * removes the BufferNode's working element from the DOM document, while
+ * reserves all ancestor paths for its child BufferNodes.
+ * when any of the BufferNode's ancestor element is useless, removes it
+ * too.
+ * removes the BufferNode from the BufferNode tree.
*
* INPUTS
- * pBufferNode - the BufferNode to be removed
- * bClearRoot - whether the root element also needs to be cleared up.
+ * pBufferNode - the BufferNode to be removed
+ * bClearRoot - whether the root element also needs to be cleared up.
*
* RESULT
- * empty
+ * empty
*
* NOTES
- * when removeing a Blocker's BufferNode, the bClearRoot flag should be
- * true. Because a Blocker can buffer many SAX events which are not used
- * by any other ElementCollector or Blocker.
- * When the bClearRoot is set to true, the root BufferNode will be first
- * cleared, with a stop flag seting at the next Blocking BufferNode. This
- * operation can delete all useless bufferred SAX events which are only
- * needed by the Blocker to be deleted.
+ * when removeing a Blocker's BufferNode, the bClearRoot flag should be
+ * true. Because a Blocker can buffer many SAX events which are not used
+ * by any other ElementCollector or Blocker.
+ * When the bClearRoot is set to true, the root BufferNode will be first
+ * cleared, with a stop flag seting at the next Blocking BufferNode. This
+ * operation can delete all useless bufferred SAX events which are only
+ * needed by the Blocker to be deleted.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (!pBufferNode->hasAnything())
{
BufferNode* pParent = (BufferNode*)pBufferNode->getParent();
-
+
/*
* delete the XML data
*/
@@ -527,7 +527,7 @@ void SAXEventKeeperImpl::smashBufferNode(
bool bIsNotBlocking = (m_pCurrentBlockingBufferNode == NULL);
bool bIsBlockInside = false;
bool bIsBlockingAfterward = false;
-
+
/*
* If this is a blocker, then remove any out-element data
* which caused by blocking. The removal process will stop
@@ -535,18 +535,18 @@ void SAXEventKeeperImpl::smashBufferNode(
*/
if (bClearRoot)
{
- cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
+ cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
aChildElements = collectChildWorkingElement(m_pRootBufferNode);
-
+
/*
- * the clearUselessData only clearup the content in the
+ * the clearUselessData only clearup the content in the
* node, not the node itself.
*/
m_xXMLDocument->clearUselessData(m_pRootBufferNode->getXMLElement(),
aChildElements,
bIsNotBlocking?(NULL):
(m_pCurrentBlockingBufferNode->getXMLElement()));
-
+
/*
* remove the node if it is empty, then if its parent is also
* empty, remove it, then if the next parent is also empty,
@@ -554,9 +554,9 @@ void SAXEventKeeperImpl::smashBufferNode(
*/
m_xXMLDocument->collapse( m_pRootBufferNode->getXMLElement() );
}
-
+
/*
- * if blocking, check the relationship between this BufferNode and
+ * if blocking, check the relationship between this BufferNode and
* the current blocking BufferNode.
*/
if ( !bIsNotBlocking )
@@ -565,18 +565,18 @@ void SAXEventKeeperImpl::smashBufferNode(
* the current blocking BufferNode is a descendant of this BufferNode.
*/
bIsBlockInside = (NULL != pBufferNode->isAncestor(m_pCurrentBlockingBufferNode));
-
+
/*
* the current blocking BufferNode locates behind this BufferNode in tree
* order.
*/
bIsBlockingAfterward = pBufferNode->isPrevious(m_pCurrentBlockingBufferNode);
}
-
+
/*
* this BufferNode's working element needs to be deleted only when
* 1. there is no blocking, or
- * 2. the current blocking BufferNode is a descendant of this BufferNode,
+ * 2. the current blocking BufferNode is a descendant of this BufferNode,
* (then in the BufferNode's working element, the useless data before the blocking
* element should be deleted.) or
* 3. the current blocking BufferNode is locates behind this BufferNode in tree,
@@ -586,18 +586,18 @@ void SAXEventKeeperImpl::smashBufferNode(
*/
if ( bIsNotBlocking || bIsBlockInside || bIsBlockingAfterward )
{
- cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
+ cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
aChildElements = collectChildWorkingElement(pBufferNode);
-
+
/*
- * the clearUselessData only clearup the content in the
+ * the clearUselessData only clearup the content in the
* node, not the node itself.
*/
m_xXMLDocument->clearUselessData(pBufferNode->getXMLElement(),
aChildElements,
bIsBlockInside?(m_pCurrentBlockingBufferNode->getXMLElement()):
(NULL));
-
+
/*
* remove the node if it is empty, then if its parent is also
* empty, remove it, then if the next parent is also empty,
@@ -612,17 +612,17 @@ void SAXEventKeeperImpl::smashBufferNode(
std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren();
pParent->removeChild(pBufferNode);
pBufferNode->setParent(NULL);
-
+
std::vector< const BufferNode * >::const_iterator ii = vChildren->begin();
- for( ; ii != vChildren->end(); ++ii )
+ for( ; ii != vChildren->end(); ++ii )
{
((BufferNode *)(*ii))->setParent(pParent);
pParent->addChild(*ii, nIndex);
nIndex++;
}
-
+
delete vChildren;
-
+
/*
* delete the BufferNode
*/
@@ -635,37 +635,37 @@ BufferNode* SAXEventKeeperImpl::findNextBlockingBufferNode(
/****** SAXEventKeeperImpl/findNextBlockingBufferNode ************************
*
* NAME
- * findNextBlockingBufferNode -- finds the next blocking BufferNode
- * behind the particular BufferNode.
+ * findNextBlockingBufferNode -- finds the next blocking BufferNode
+ * behind the particular BufferNode.
*
* SYNOPSIS
- * pBufferNode = findNextBlockingBufferNode( pStartBufferNode );
+ * pBufferNode = findNextBlockingBufferNode( pStartBufferNode );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * pStartBufferNode - the BufferNode from where to search the next
- * blocking BufferNode.
+ * pStartBufferNode - the BufferNode from where to search the next
+ * blocking BufferNode.
*
* RESULT
- * pBufferNode - the next blocking BufferNode, or NULL if no such
- * BufferNode exists.
+ * pBufferNode - the next blocking BufferNode, or NULL if no such
+ * BufferNode exists.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* pNext = NULL;
-
+
if (pStartBufferNode != NULL)
{
pNext = pStartBufferNode;
-
+
while (NULL != (pNext = (BufferNode*)pNext->getNextNodeByTreeOrder()))
{
if (pNext->getBlocker() != NULL)
@@ -674,7 +674,7 @@ BufferNode* SAXEventKeeperImpl::findNextBlockingBufferNode(
}
}
}
-
+
return pNext;
}
@@ -682,33 +682,33 @@ void SAXEventKeeperImpl::diffuse(BufferNode* pBufferNode) const
/****** SAXEventKeeperImpl/diffuse *******************************************
*
* NAME
- * diffuse -- diffuse the notification.
+ * diffuse -- diffuse the notification.
*
* SYNOPSIS
- * diffuse( pBufferNode );
+ * diffuse( pBufferNode );
*
* FUNCTION
- * diffuse the collecting completion notification from the specific
- * BufferNode along its parent link, until an ancestor which is not
- * completely received is met.
+ * diffuse the collecting completion notification from the specific
+ * BufferNode along its parent link, until an ancestor which is not
+ * completely received is met.
*
* INPUTS
- * pBufferNode - the BufferNode from which the notification will be
- * diffused.
+ * pBufferNode - the BufferNode from which the notification will be
+ * diffused.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
BufferNode* pParent = pBufferNode;
-
+
while(pParent->isAllReceived())
{
pParent->elementCollectorNotify();
@@ -720,28 +720,28 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
/****** SAXEventKeeperImpl/releaseElementMarkBuffer **************************
*
* NAME
- * releaseElementMarkBuffer -- releases useless ElementMarks
+ * releaseElementMarkBuffer -- releases useless ElementMarks
*
* SYNOPSIS
- * releaseElementMarkBuffer( );
+ * releaseElementMarkBuffer( );
*
* FUNCTION
- * releases each ElementMark in the releasing list
- * m_vReleasedElementMarkBuffers.
- * The operation differs between an ElementCollector and a Blocker.
+ * releases each ElementMark in the releasing list
+ * m_vReleasedElementMarkBuffers.
+ * The operation differs between an ElementCollector and a Blocker.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_bIsReleasing = true;
@@ -750,22 +750,22 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
std::vector< sal_Int32 >::iterator pId = m_vReleasedElementMarkBuffers.begin();
sal_Int32 nId = *pId;
m_vReleasedElementMarkBuffers.erase( pId );
-
+
ElementMark* pElementMark = findElementMarkBuffer(nId);
if (pElementMark != NULL)
{
- if (cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR
- == pElementMark->getType())
+ if (cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR
+ == pElementMark->getType())
/*
* it is a EC
*/
{
ElementCollector* pElementCollector = (ElementCollector*)pElementMark;
-
+
cssxc::sax::ElementMarkPriority nPriority = pElementCollector->getPriority();
bool bToModify = pElementCollector->getModify();
-
+
/*
* Delete the EC from the buffer node.
*/
@@ -776,26 +776,26 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
{
pBufferNode->notifyBranch();
}
-
+
if (bToModify)
{
pBufferNode->notifyAncestor();
}
-
+
/*
* delete the ElementMark
- */
+ */
pElementCollector = NULL;
pElementMark = NULL;
- removeElementMarkBuffer(nId);
-
+ removeElementMarkBuffer(nId);
+
/*
* delete the BufferNode
*/
diffuse(pBufferNode);
smashBufferNode(pBufferNode, false);
}
- else
+ else
/*
* it is a Blocker
*/
@@ -805,7 +805,7 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
*/
BufferNode *pBufferNode = pElementMark->getBufferNode();
pBufferNode->setBlocker(NULL);
-
+
/*
* If there is a following handler and no blocking now, then
* forward this event
@@ -813,11 +813,11 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
if (m_pCurrentBlockingBufferNode == pBufferNode)
{
/*
- * Before forwarding, the next blocking point needs to be
+ * Before forwarding, the next blocking point needs to be
* found.
*/
m_pCurrentBlockingBufferNode = findNextBlockingBufferNode(pBufferNode);
-
+
/*
* Forward the blocked events between these two STHs.
*/
@@ -825,10 +825,10 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
{
BufferNode* pTempCurrentBufferNode = m_pCurrentBufferNode;
BufferNode* pTempCurrentBlockingBufferNode = m_pCurrentBlockingBufferNode;
-
+
m_pCurrentBufferNode = pBufferNode;
m_pCurrentBlockingBufferNode = NULL;
-
+
m_bIsForwarding = true;
m_xXMLDocument->generateSAXEvents(
@@ -838,15 +838,15 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
(pTempCurrentBlockingBufferNode == NULL)?NULL:(pTempCurrentBlockingBufferNode->getXMLElement()));
m_bIsForwarding = false;
-
+
m_pCurrentBufferNode = pTempCurrentBufferNode;
if (m_pCurrentBlockingBufferNode == NULL)
{
m_pCurrentBlockingBufferNode = pTempCurrentBlockingBufferNode;
}
}
-
- if (m_pCurrentBlockingBufferNode == NULL &&
+
+ if (m_pCurrentBlockingBufferNode == NULL &&
m_xSAXEventKeeperStatusChangeListener.is())
{
m_xSAXEventKeeperStatusChangeListener->blockingStatusChanged(sal_False);
@@ -855,10 +855,10 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
/*
* delete the ElementMark
- */
+ */
pElementMark = NULL;
removeElementMarkBuffer(nId);
-
+
/*
* delete the BufferNode
*/
@@ -867,11 +867,11 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
}
}
}
-
+
m_bIsReleasing = false;
-
- if (!m_pRootBufferNode->hasAnything() &&
- !m_pRootBufferNode->hasChildren() &&
+
+ if (!m_pRootBufferNode->hasAnything() &&
+ !m_pRootBufferNode->hasChildren() &&
m_xSAXEventKeeperStatusChangeListener.is())
{
m_xSAXEventKeeperStatusChangeListener->bufferStatusChanged(sal_True);
@@ -882,28 +882,28 @@ void SAXEventKeeperImpl::markElementMarkBuffer(sal_Int32 nId)
/****** SAXEventKeeperImpl/markElementMarkBuffer *****************************
*
* NAME
- * markElementMarkBuffer -- marks an ElementMark to be released
+ * markElementMarkBuffer -- marks an ElementMark to be released
*
* SYNOPSIS
- * markElementMarkBuffer( nId );
+ * markElementMarkBuffer( nId );
*
* FUNCTION
- * puts the ElementMark with the particular Id into the releasing list,
- * checks whether the releasing process is runing, if not then launch
- * this process.
+ * puts the ElementMark with the particular Id into the releasing list,
+ * checks whether the releasing process is runing, if not then launch
+ * this process.
*
* INPUTS
- * nId - the Id of the ElementMark which will be released
+ * nId - the Id of the ElementMark which will be released
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_vReleasedElementMarkBuffers.push_back( nId );
@@ -921,82 +921,82 @@ sal_Int32 SAXEventKeeperImpl::createElementCollector(
/****** SAXEventKeeperImpl/createElementCollector ****************************
*
* NAME
- * createElementCollector -- creates a new ElementCollector on the
- * incoming element.
+ * createElementCollector -- creates a new ElementCollector on the
+ * incoming element.
*
* SYNOPSIS
- * nId = createElementCollector( nSecurityId, nPriority,
- * bModifyElement,
- * xReferenceResolvedListener );
+ * nId = createElementCollector( nSecurityId, nPriority,
+ * bModifyElement,
+ * xReferenceResolvedListener );
*
* FUNCTION
- * allocs a new Id, then create an ElementCollector with this Id value.
- * Add the new created ElementCollector to the new ElementCollecotor list.
+ * allocs a new Id, then create an ElementCollector with this Id value.
+ * Add the new created ElementCollector to the new ElementCollecotor list.
*
* INPUTS
- * nSecurityId - the security Id of the new ElementCollector
- * nPriority - the prirority of the new ElementCollector
- * bModifyElement -whether this BufferNode will modify the content of
- * the corresponding element it works on
- * xReferenceResolvedListener - the listener for the new ElementCollector.
+ * nSecurityId - the security Id of the new ElementCollector
+ * nPriority - the prirority of the new ElementCollector
+ * bModifyElement -whether this BufferNode will modify the content of
+ * the corresponding element it works on
+ * xReferenceResolvedListener - the listener for the new ElementCollector.
*
* RESULT
- * nId - the Id of the new ElementCollector
+ * nId - the Id of the new ElementCollector
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
sal_Int32 nId = m_nNextElementMarkId;
m_nNextElementMarkId ++;
-
- ElementCollector* pElementCollector
+
+ ElementCollector* pElementCollector
= new ElementCollector(
nSecurityId,
nId,
nPriority,
bModifyElement,
xReferenceResolvedListener);
-
+
m_vElementMarkBuffers.push_back( pElementCollector );
-
+
/*
* All the new EC to initial EC array.
*/
m_vNewElementCollectors.push_back( pElementCollector );
-
+
return nId;
}
-
+
sal_Int32 SAXEventKeeperImpl::createBlocker(sal_Int32 nSecurityId)
/****** SAXEventKeeperImpl/createBlocker *************************************
*
* NAME
- * createBlocker -- creates a new Blocker on the incoming element.
+ * createBlocker -- creates a new Blocker on the incoming element.
*
* SYNOPSIS
- * nId = createBlocker( nSecurityId );
+ * nId = createBlocker( nSecurityId );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * nSecurityId - the security Id of the new Blocker
+ * nSecurityId - the security Id of the new Blocker
*
* RESULT
- * nId - the Id of the new Blocker
+ * nId - the Id of the new Blocker
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
sal_Int32 nId = m_nNextElementMarkId;
@@ -1006,7 +1006,7 @@ sal_Int32 SAXEventKeeperImpl::createBlocker(sal_Int32 nSecurityId)
m_pNewBlocker = new ElementMark(nSecurityId, nId);
m_vElementMarkBuffers.push_back( m_pNewBlocker );
-
+
return nId;
}
@@ -1026,51 +1026,51 @@ void SAL_CALL SAXEventKeeperImpl::removeElementCollector( sal_Int32 id )
{
markElementMarkBuffer(id);
}
-
+
sal_Int32 SAL_CALL SAXEventKeeperImpl::addBlocker( )
throw (cssu::RuntimeException)
{
return createBlocker(cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID);
}
-
+
void SAL_CALL SAXEventKeeperImpl::removeBlocker( sal_Int32 id )
throw (cssu::RuntimeException)
{
markElementMarkBuffer(id);
}
-
+
sal_Bool SAL_CALL SAXEventKeeperImpl::isBlocking( )
throw (cssu::RuntimeException)
{
return (m_pCurrentBlockingBufferNode != NULL);
}
-
-cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL
+
+cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL
SAXEventKeeperImpl::getElement( sal_Int32 id )
throw (cssu::RuntimeException)
{
cssu::Reference< cssxw::XXMLElementWrapper > rc;
-
+
ElementMark* pElementMark = findElementMarkBuffer(id);
if (pElementMark != NULL)
{
rc = pElementMark->getBufferNode()->getXMLElement();
}
-
+
return rc;
}
-void SAL_CALL SAXEventKeeperImpl::setElement(
- sal_Int32 id,
+void SAL_CALL SAXEventKeeperImpl::setElement(
+ sal_Int32 id,
const cssu::Reference< cssxw::XXMLElementWrapper >& aElement )
throw (cssu::RuntimeException)
{
if (aElement.is())
{
m_xXMLDocument->rebuildIDLink(aElement);
-
+
ElementMark* pElementMark = findElementMarkBuffer(id);
-
+
if (pElementMark != NULL)
{
BufferNode* pBufferNode = pElementMark->getBufferNode();
@@ -1078,7 +1078,7 @@ void SAL_CALL SAXEventKeeperImpl::setElement(
{
bool bIsCurrent = m_xXMLDocument->isCurrent(pBufferNode->getXMLElement());
pBufferNode->setXMLElement(aElement);
-
+
if (bIsCurrent)
{
m_xXMLDocument->setCurrentElement(aElement);
@@ -1091,47 +1091,47 @@ void SAL_CALL SAXEventKeeperImpl::setElement(
removeElementCollector( id );
}
}
-
+
cssu::Reference< cssxs::XDocumentHandler > SAL_CALL SAXEventKeeperImpl::setNextHandler(
const cssu::Reference< cssxs::XDocumentHandler >& xNewHandler )
throw (cssu::RuntimeException)
{
cssu::Reference< cssxs::XDocumentHandler > xOldHandler = m_xNextHandler;
-
+
m_xNextHandler = xNewHandler;
return xOldHandler;
}
-
+
rtl::OUString SAL_CALL SAXEventKeeperImpl::printBufferNodeTree()
throw (cssu::RuntimeException)
{
rtl::OUString rc;
-
+
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ElementMarkBuffers: size = " ));
rc += rtl::OUString::valueOf((sal_Int32)m_vElementMarkBuffers.size());
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\nCurrentBufferNode: " ));
rc += m_xXMLDocument->getNodeName(m_pCurrentBufferNode->getXMLElement());
rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
rc += printBufferNode(m_pRootBufferNode, 0);
-
+
return rc;
}
-
+
cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL SAXEventKeeperImpl::getCurrentBlockingNode()
throw (cssu::RuntimeException)
{
cssu::Reference< cssxw::XXMLElementWrapper > rc;
-
+
if (m_pCurrentBlockingBufferNode != NULL)
{
rc = m_pCurrentBlockingBufferNode->getXMLElement();
}
-
+
return rc;
}
/* XSecuritySAXEventKeeper */
-sal_Int32 SAL_CALL SAXEventKeeperImpl::addSecurityElementCollector(
+sal_Int32 SAL_CALL SAXEventKeeperImpl::addSecurityElementCollector(
cssxc::sax::ElementMarkPriority priority,
sal_Bool modifyElement )
throw (cssu::RuntimeException)
@@ -1142,23 +1142,23 @@ sal_Int32 SAL_CALL SAXEventKeeperImpl::addSecurityElementCollector(
modifyElement,
NULL);
}
-
+
sal_Int32 SAL_CALL SAXEventKeeperImpl::cloneElementCollector(
sal_Int32 referenceId,
cssxc::sax::ElementMarkPriority priority )
throw (cssu::RuntimeException)
{
sal_Int32 nId = -1;
-
+
ElementCollector* pElementCollector = (ElementCollector*)findElementMarkBuffer(referenceId);
if (pElementCollector != NULL)
{
nId = m_nNextElementMarkId;
m_nNextElementMarkId ++;
-
- ElementCollector* pClonedOne
+
+ ElementCollector* pClonedOne
= pElementCollector->clone(nId, priority);
-
+
/*
* add this EC into the security data buffer array.
*/
@@ -1173,10 +1173,10 @@ sal_Int32 SAL_CALL SAXEventKeeperImpl::cloneElementCollector(
m_vNewElementCollectors.push_back(pClonedOne);
}
}
-
+
return nId;
}
-
+
void SAL_CALL SAXEventKeeperImpl::setSecurityId( sal_Int32 id, sal_Int32 securityId )
throw (cssu::RuntimeException)
{
@@ -1187,7 +1187,7 @@ void SAL_CALL SAXEventKeeperImpl::setSecurityId( sal_Int32 id, sal_Int32 securit
}
}
-
+
/* XReferenceResolvedBroadcaster */
void SAL_CALL SAXEventKeeperImpl::addReferenceResolvedListener(
sal_Int32 referenceId,
@@ -1200,14 +1200,14 @@ void SAL_CALL SAXEventKeeperImpl::addReferenceResolvedListener(
pElementCollector->setReferenceResolvedListener(listener);
}
}
-
-void SAL_CALL SAXEventKeeperImpl::removeReferenceResolvedListener(
- sal_Int32 /*referenceId*/,
+
+void SAL_CALL SAXEventKeeperImpl::removeReferenceResolvedListener(
+ sal_Int32 /*referenceId*/,
const cssu::Reference< cssxc::sax::XReferenceResolvedListener >&)
throw (cssu::RuntimeException)
{
}
-
+
/* XSAXEventKeeperStatusChangeBroadcaster */
void SAL_CALL SAXEventKeeperImpl::addSAXEventKeeperStatusChangeListener(
const cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >& listener )
@@ -1215,13 +1215,13 @@ void SAL_CALL SAXEventKeeperImpl::addSAXEventKeeperStatusChangeListener(
{
m_xSAXEventKeeperStatusChangeListener = listener;
}
-
+
void SAL_CALL SAXEventKeeperImpl::removeSAXEventKeeperStatusChangeListener(
const cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >&)
throw (cssu::RuntimeException)
{
}
-
+
/* XDocumentHandler */
void SAL_CALL SAXEventKeeperImpl::startDocument( )
throw (cssxs::SAXException, cssu::RuntimeException)
@@ -1231,7 +1231,7 @@ void SAL_CALL SAXEventKeeperImpl::startDocument( )
m_xNextHandler->startDocument();
}
}
-
+
void SAL_CALL SAXEventKeeperImpl::endDocument( )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -1240,7 +1240,7 @@ void SAL_CALL SAXEventKeeperImpl::endDocument( )
m_xNextHandler->endDocument();
}
}
-
+
void SAL_CALL SAXEventKeeperImpl::startElement(
const rtl::OUString& aName,
const cssu::Reference< cssxs::XAttributeList >& xAttribs )
@@ -1251,8 +1251,8 @@ void SAL_CALL SAXEventKeeperImpl::startElement(
* forward this event
*/
if ((m_pCurrentBlockingBufferNode == NULL) &&
- (m_xNextHandler.is()) &&
- (!m_bIsForwarding) &&
+ (m_xNextHandler.is()) &&
+ (!m_bIsForwarding) &&
(m_pNewBlocker == NULL))
{
m_xNextHandler->startElement(aName, xAttribs);
@@ -1268,43 +1268,43 @@ void SAL_CALL SAXEventKeeperImpl::startElement(
#else
sal_Int32 nLength = xAttribs->getLength();
cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength);
-
- for ( int i = 0; i<nLength; ++i )
+
+ for ( int i = 0; i<nLength; ++i )
{
aAttributes[i].sName = xAttribs->getNameByIndex((short)i);
aAttributes[i].sValue =xAttribs->getValueByIndex((short)i);
}
-
+
m_xCompressedDocumentHandler->_startElement(aName, aAttributes);
- #endif
-
+ #endif
+
}
-
+
BufferNode* pBufferNode = addNewElementMarkBuffers();
if (pBufferNode != NULL)
{
setCurrentBufferNode(pBufferNode);
}
}
-
-void SAL_CALL SAXEventKeeperImpl::endElement( const rtl::OUString& aName )
+
+void SAL_CALL SAXEventKeeperImpl::endElement( const rtl::OUString& aName )
throw (cssxs::SAXException, cssu::RuntimeException)
{
sal_Bool bIsCurrent = m_xXMLDocument->isCurrent(m_pCurrentBufferNode->getXMLElement());
-
+
/*
* If there is a following handler and no blocking now, then
* forward this event
*/
- if ((m_pCurrentBlockingBufferNode == NULL) &&
- (m_xNextHandler.is()) &&
+ if ((m_pCurrentBlockingBufferNode == NULL) &&
+ (m_xNextHandler.is()) &&
(!m_bIsForwarding))
{
m_xNextHandler->endElement(aName);
}
-
- if ((m_pCurrentBlockingBufferNode != NULL) ||
- (m_pCurrentBufferNode != m_pRootBufferNode) ||
+
+ if ((m_pCurrentBlockingBufferNode != NULL) ||
+ (m_pCurrentBufferNode != m_pRootBufferNode) ||
(!m_xXMLDocument->isCurrentElementEmpty()))
{
if (!m_bIsForwarding)
@@ -1313,11 +1313,11 @@ void SAL_CALL SAXEventKeeperImpl::endElement( const rtl::OUString& aName )
m_xDocumentHandler->endElement(aName);
#else
m_xCompressedDocumentHandler->_endElement(aName);
- #endif
+ #endif
}
-
+
/*
- * If the current buffer node has not notified yet, and
+ * If the current buffer node has not notified yet, and
* the current buffer node is waiting for the current element,
* then let it notify.
*/
@@ -1325,10 +1325,10 @@ void SAL_CALL SAXEventKeeperImpl::endElement( const rtl::OUString& aName )
{
BufferNode* pOldCurrentBufferNode = m_pCurrentBufferNode;
m_pCurrentBufferNode = (BufferNode*)m_pCurrentBufferNode->getParent();
-
+
pOldCurrentBufferNode->setReceivedAll();
-
- if ((m_pCurrentBufferNode == m_pRootBufferNode) &&
+
+ if ((m_pCurrentBufferNode == m_pRootBufferNode) &&
m_xSAXEventKeeperStatusChangeListener.is())
{
m_xSAXEventKeeperStatusChangeListener->collectionStatusChanged(sal_False);
@@ -1343,7 +1343,7 @@ void SAL_CALL SAXEventKeeperImpl::endElement( const rtl::OUString& aName )
}
}
}
-
+
void SAL_CALL SAXEventKeeperImpl::characters( const rtl::OUString& aChars )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -1353,26 +1353,26 @@ void SAL_CALL SAXEventKeeperImpl::characters( const rtl::OUString& aChars )
{
m_xNextHandler->characters(aChars);
}
-
- if ((m_pCurrentBlockingBufferNode != NULL) ||
+
+ if ((m_pCurrentBlockingBufferNode != NULL) ||
(m_pCurrentBufferNode != m_pRootBufferNode))
{
#ifndef _USECOMPRESSEDDOCUMENTHANDLER
m_xDocumentHandler->characters(aChars);
#else
m_xCompressedDocumentHandler->_characters(aChars);
- #endif
+ #endif
}
}
}
-
+
void SAL_CALL SAXEventKeeperImpl::ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (cssxs::SAXException, cssu::RuntimeException)
{
characters( aWhitespaces );
}
-
-void SAL_CALL SAXEventKeeperImpl::processingInstruction(
+
+void SAL_CALL SAXEventKeeperImpl::processingInstruction(
const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -1382,53 +1382,53 @@ void SAL_CALL SAXEventKeeperImpl::processingInstruction(
{
m_xNextHandler->processingInstruction(aTarget, aData);
}
-
- if ((m_pCurrentBlockingBufferNode != NULL) ||
+
+ if ((m_pCurrentBlockingBufferNode != NULL) ||
(m_pCurrentBufferNode != m_pRootBufferNode))
{
#ifndef _USECOMPRESSEDDOCUMENTHANDLER
m_xDocumentHandler->processingInstruction(aTarget, aData);
#else
m_xCompressedDocumentHandler->_processingInstruction(aTarget, aData);
- #endif
+ #endif
}
}
}
-
+
void SAL_CALL SAXEventKeeperImpl::setDocumentLocator( const cssu::Reference< cssxs::XLocator >&)
throw (cssxs::SAXException, cssu::RuntimeException)
{
}
-
+
/* XInitialization */
-void SAL_CALL SAXEventKeeperImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
+void SAL_CALL SAXEventKeeperImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
throw (cssu::Exception, cssu::RuntimeException)
{
OSL_ASSERT(aArguments.getLength() == 1);
-
+
aArguments[0] >>= m_xXMLDocument;
- m_xDocumentHandler = cssu::Reference< cssxs::XDocumentHandler >(
+ m_xDocumentHandler = cssu::Reference< cssxs::XDocumentHandler >(
m_xXMLDocument, cssu::UNO_QUERY );
- m_xCompressedDocumentHandler = cssu::Reference< cssxcsax::XCompressedDocumentHandler >(
+ m_xCompressedDocumentHandler = cssu::Reference< cssxcsax::XCompressedDocumentHandler >(
m_xXMLDocument, cssu::UNO_QUERY );
-
+
m_pRootBufferNode = new BufferNode(m_xXMLDocument->getCurrentElement());
m_pCurrentBufferNode = m_pRootBufferNode;
}
-
+
rtl::OUString SAXEventKeeperImpl_getImplementationName ()
throw (cssu::RuntimeException)
{
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL SAXEventKeeperImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SAXEventKeeperImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -1438,7 +1438,7 @@ cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceN
}
#undef SERVICE_NAME
-cssu::Reference< cssu::XInterface > SAL_CALL SAXEventKeeperImpl_createInstance(
+cssu::Reference< cssu::XInterface > SAL_CALL SAXEventKeeperImpl_createInstance(
const cssu::Reference< cssl::XMultiServiceFactory > &)
throw( cssu::Exception )
{
@@ -1446,17 +1446,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL SAXEventKeeperImpl_createInstance(
}
/* XServiceInfo */
-rtl::OUString SAL_CALL SAXEventKeeperImpl::getImplementationName( )
+rtl::OUString SAL_CALL SAXEventKeeperImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return SAXEventKeeperImpl_getImplementationName();
}
-sal_Bool SAL_CALL SAXEventKeeperImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL SAXEventKeeperImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return SAXEventKeeperImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return SAXEventKeeperImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx b/xmlsecurity/source/framework/saxeventkeeperimpl.hxx
index c78d58808586..175a3ae247be 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,8 +49,8 @@
#define INCLUDED_VECTOR
#endif
-class SAXEventKeeperImpl : public cppu::WeakImplHelper6
-<
+class SAXEventKeeperImpl : public cppu::WeakImplHelper6
+<
com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper,
com::sun::star::xml::crypto::sax::XReferenceResolvedBroadcaster,
com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeBroadcaster,
@@ -61,21 +61,21 @@ class SAXEventKeeperImpl : public cppu::WeakImplHelper6
/****** SAXEventKeeperImpl.hxx/CLASS SAXEventKeeperImpl ***********************
*
* NAME
- * SAXEventKeeperImpl -- SAX events buffer controller
+ * SAXEventKeeperImpl -- SAX events buffer controller
*
* FUNCTION
- * Controls SAX events to be bufferred, and controls bufferred SAX events
- * to be released.
+ * Controls SAX events to be bufferred, and controls bufferred SAX events
+ * to be released.
*
* HISTORY
- * 05.01.2004 - Interface supported: XSecuritySAXEventKeeper,
- * XReferenceResolvedBroadcaster,
- * XSAXEventKeeperStatusChangeBroadcaster,
- * XDocumentHandler, XInitialization, XServiceInfo
+ * 05.01.2004 - Interface supported: XSecuritySAXEventKeeper,
+ * XReferenceResolvedBroadcaster,
+ * XSAXEventKeeperStatusChangeBroadcaster,
+ * XDocumentHandler, XInitialization, XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -83,63 +83,63 @@ private:
* the XMLDocumentWrapper component which maintains all bufferred SAX
* in DOM format.
*/
- com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLDocumentWrapper >
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::wrapper::XXMLDocumentWrapper >
m_xXMLDocument;
-
+
/*
* the document handler provided by the XMLDocumentWrapper component.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler > m_xDocumentHandler;
-
+
/*
* the compressed document handler provided by the XMLDocumentWrapper
- * component, the handler has more effient method definition that the
+ * component, the handler has more effient method definition that the
* normal document handler.
*/
- com::sun::star::uno::Reference<
- com::sun::star::xml::csax::XCompressedDocumentHandler >
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::csax::XCompressedDocumentHandler >
m_xCompressedDocumentHandler;
-
+
/*
* a listener which receives this SAXEventKeeper's status change
* notification.
- * Based on the status changes, the listener can decide whether the
+ * Based on the status changes, the listener can decide whether the
* SAXEventKeeper should chain on/chain off the SAX chain, or whether
* the SAXEventKeeper is useless any long.
*/
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >
m_xSAXEventKeeperStatusChangeListener;
-
+
/*
* the root node of the BufferNode tree.
* the BufferNode tree is used to keep track of all bufferred elements,
- * it has the same structure with the document which maintains those
+ * it has the same structure with the document which maintains those
* elements physically.
*/
BufferNode* m_pRootBufferNode;
-
+
/*
* the current active BufferNode.
* this is used to keep track the current location in the BufferNode tree,
* the next generated BufferNode will become a child BufferNode of it.
*/
BufferNode* m_pCurrentBufferNode;
-
+
/*
* the next Id for a coming ElementMark.
* the variable is increased by 1 when an new ElementMark is generated,
* in this way, we can promise the Id of any ElementMark is unique.
*/
sal_Int32 m_nNextElementMarkId;
-
+
/*
* maintains a collection of all ElementMarks.
*/
std::vector< const ElementMark* > m_vElementMarkBuffers;
-
+
/*
* maintains a list of new ElementCollectors that will be created
* on the element represented by the next incoming startElement SAX
@@ -151,27 +151,27 @@ private:
* SAX event comes.
*/
std::vector< const ElementCollector* > m_vNewElementCollectors;
-
+
/*
* maintains the new Blocker that will be created
* on the element represented by the next incoming startElement SAX
* event.
*/
ElementMark* m_pNewBlocker;
-
+
/*
* the document handler to which all received SAX events will be
* forwarded.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler;
-
+
/*
* the current BufferNode which prevents the SAX events to be
* forwarded to the m_xNextHandler.
*/
BufferNode* m_pCurrentBlockingBufferNode;
-
+
/*
* maintains a list of ElementMark that has been asked to release.
* Because during processing a request of releasing an ElementMark,
@@ -181,7 +181,7 @@ private:
* order.
*/
std::vector< sal_Int32 > m_vReleasedElementMarkBuffers;
-
+
/*
* a flag to indicate whether the ElementMark releasing process is runing.
* When a releasing request comes, the assigned ElementMark is added to
@@ -190,59 +190,59 @@ private:
* method.
*/
bool m_bIsReleasing;
-
+
/*
* a flag to indicate whether it is the "Forwarding" mode now.
* A "Forwarding" mode means that all received SAX events are from the
- * XMLDocumentWrapper component, instead of up-stream component in the
+ * XMLDocumentWrapper component, instead of up-stream component in the
* SAX chain.
* The difference between "Forwarding" mode and normal mode is that:
* no SAX events need to be transferred to the XMLDocumentWrapper component
* again even if a buffer request happens.
*/
bool m_bIsForwarding;
-
+
void setCurrentBufferNode(BufferNode* pBufferNode);
-
+
BufferNode* addNewElementMarkBuffers();
-
+
ElementMark* findElementMarkBuffer(sal_Int32 nId) const;
-
+
void removeElementMarkBuffer(sal_Int32 nId);
-
+
rtl::OUString printBufferNode(
BufferNode* pBufferNode, sal_Int32 nIndent) const;
-
- com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper > >
+
+ com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
+ com::sun::star::xml::wrapper::XXMLElementWrapper > >
collectChildWorkingElement(BufferNode* pBufferNode) const;
-
+
void smashBufferNode(
BufferNode* pBufferNode, bool bClearRoot) const;
-
+
BufferNode* findNextBlockingBufferNode(
BufferNode* pStartBufferNode) const;
-
+
void diffuse(BufferNode* pBufferNode) const;
-
+
void releaseElementMarkBuffer();
-
+
void markElementMarkBuffer(sal_Int32 nId);
-
+
sal_Int32 createElementCollector(
sal_Int32 nSecurityId,
com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority,
bool bModifyElement,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XReferenceResolvedListener>&
xReferenceResolvedListener);
-
+
sal_Int32 createBlocker(sal_Int32 nSecurityId);
-
+
public:
SAXEventKeeperImpl();
virtual ~SAXEventKeeperImpl();
-
+
/* XSAXEventKeeper */
virtual sal_Int32 SAL_CALL addElementCollector( )
throw (com::sun::star::uno::RuntimeException);
@@ -254,110 +254,110 @@ public:
throw (com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isBlocking( )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL
getElement( sal_Int32 id )
throw (com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setElement(
- sal_Int32 id,
- const com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper >&
+ virtual void SAL_CALL setElement(
+ sal_Int32 id,
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::wrapper::XXMLElementWrapper >&
aElement )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Reference<
- com::sun::star::xml::sax::XDocumentHandler > SAL_CALL
- setNextHandler( const com::sun::star::uno::Reference<
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::xml::sax::XDocumentHandler > SAL_CALL
+ setNextHandler( const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xNewHandler )
throw (com::sun::star::uno::RuntimeException);
virtual rtl::OUString SAL_CALL printBufferNodeTree()
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL
getCurrentBlockingNode()
throw (com::sun::star::uno::RuntimeException);
/* XSecuritySAXEventKeeper */
- virtual sal_Int32 SAL_CALL addSecurityElementCollector(
- com::sun::star::xml::crypto::sax::ElementMarkPriority priority,
+ virtual sal_Int32 SAL_CALL addSecurityElementCollector(
+ com::sun::star::xml::crypto::sax::ElementMarkPriority priority,
sal_Bool modifyElement )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL cloneElementCollector(
- sal_Int32 referenceId,
+ virtual sal_Int32 SAL_CALL cloneElementCollector(
+ sal_Int32 referenceId,
com::sun::star::xml::crypto::sax::ElementMarkPriority priority )
throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setSecurityId( sal_Int32 id, sal_Int32 securityId )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XReferenceResolvedBroadcaster */
- virtual void SAL_CALL addReferenceResolvedListener(
- sal_Int32 referenceId,
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
+ virtual void SAL_CALL addReferenceResolvedListener(
+ sal_Int32 referenceId,
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeReferenceResolvedListener(
- sal_Int32 referenceId,
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
+ virtual void SAL_CALL removeReferenceResolvedListener(
+ sal_Int32 referenceId,
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
/* XSAXEventKeeperStatusChangeBroadcaster */
- virtual void SAL_CALL addSAXEventKeeperStatusChangeListener(
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >&
+ virtual void SAL_CALL addSAXEventKeeperStatusChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeSAXEventKeeperStatusChangeListener(
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >&
+ virtual void SAL_CALL removeSAXEventKeeperStatusChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XDocumentHandler */
virtual void SAL_CALL startDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
virtual void SAL_CALL endDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >&
+ virtual void SAL_CALL startElement(
+ const rtl::OUString& aName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >&
xAttribs )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endElement( const rtl::OUString& aName )
+ virtual void SAL_CALL endElement( const rtl::OUString& aName )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
virtual void SAL_CALL characters( const rtl::OUString& aChars )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL processingInstruction(
+ virtual void SAL_CALL processingInstruction(
const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDocumentLocator(
+ virtual void SAL_CALL setDocumentLocator(
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
/* XInitialization */
- virtual void SAL_CALL initialize(
- const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
+ virtual void SAL_CALL initialize(
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString SAXEventKeeperImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL SAXEventKeeperImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SAXEventKeeperImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
diff --git a/xmlsecurity/source/framework/securityengine.cxx b/xmlsecurity/source/framework/securityengine.cxx
index b6554e343354..a7cf002c0d7d 100644
--- a/xmlsecurity/source/framework/securityengine.cxx
+++ b/xmlsecurity/source/framework/securityengine.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@ namespace cssl = com::sun::star::lang;
namespace cssxc = com::sun::star::xml::crypto;
namespace cssxw = com::sun::star::xml::wrapper;
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
SecurityEngine::SecurityEngine( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF )
@@ -72,18 +72,18 @@ sal_Bool SAL_CALL SecurityEngine::endMission( )
throw (com::sun::star::uno::RuntimeException)
{
sal_Bool rc = m_bMissionDone;
-
+
if (!rc)
{
clearUp( );
-
+
notifyResultListener();
m_bMissionDone = true;
}
-
+
m_xResultListener = NULL;
m_xSAXEventKeeper = NULL;
-
+
return rc;
}
diff --git a/xmlsecurity/source/framework/securityengine.hxx b/xmlsecurity/source/framework/securityengine.hxx
index 925b45b2a26e..75594f7dbeb8 100644
--- a/xmlsecurity/source/framework/securityengine.hxx
+++ b/xmlsecurity/source/framework/securityengine.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,11 +35,11 @@
#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp>
#include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp>
#include <com/sun/star/xml/crypto/XXMLSignature.hpp>
-
+
#include <cppuhelper/implbase3.hxx>
class SecurityEngine : public cppu::WeakImplHelper3
-<
+<
com::sun::star::xml::crypto::sax::XReferenceResolvedListener,
com::sun::star::xml::crypto::sax::XKeyCollector,
com::sun::star::xml::crypto::sax::XMissionTaker
@@ -47,54 +47,54 @@ class SecurityEngine : public cppu::WeakImplHelper3
/****** securityengine.hxx/CLASS SecurityEngine *******************************
*
* NAME
- * SecurityEngine -- Base class of SignatureEngine and EncryptionEngine
+ * SecurityEngine -- Base class of SignatureEngine and EncryptionEngine
*
* FUNCTION
- * Maintains common members and methods related with security engine
- * operation.
+ * Maintains common members and methods related with security engine
+ * operation.
*
* HISTORY
- * 05.01.2004 - Interface supported: XReferenceResolvedListener,
- * XKeyCollector, and XMissionTaker
+ * 05.01.2004 - Interface supported: XReferenceResolvedListener,
+ * XKeyCollector, and XMissionTaker
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
protected:
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory > mxMSF;
/*
* A SAXEventKeeper internally maintians all resources that a security
- * operation needs. The m_xSAXEventKeeper member is used to release
+ * operation needs. The m_xSAXEventKeeper member is used to release
* those resources when the security operation finishes.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSAXEventKeeper > m_xSAXEventKeeper;
-
+
/*
* the id of ElementCollector of the template element.
* For a signature, the template element is the Signature element,
* for a encryption, the EncryptedData/EncryptedKey element is.
- */
+ */
sal_Int32 m_nIdOfTemplateEC;
-
+
/*
* remembers how many referenced elements have been bufferred completely,
* including the key element, template element, and referenced element of
* signature.
*/
sal_Int32 m_nNumOfResolvedReferences;
-
+
/*
* the id of ElementCollector of the key element.
* If a Signature element or EncryptedData/EncryptedKey element has
* an internal key sub-element, then this member should be -1
*/
sal_Int32 m_nIdOfKeyEC;
-
+
/*
* remembers whether the current opertion has finished.
*/
@@ -105,13 +105,13 @@ protected:
* the result listener to identify the entity.
*/
sal_Int32 m_nSecurityId;
-
+
/*
* the status of the operation
*/
//bool m_bOperationSucceed;
com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
-
+
/*
* the result listener, which will receives the security operation result.
*/
@@ -120,25 +120,25 @@ protected:
m_xResultListener;
protected:
- explicit SecurityEngine( const com::sun::star::uno::Reference<
+ explicit SecurityEngine( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxMSF = NULL );
virtual ~SecurityEngine() {};
-
- /*
+
+ /*
* perform the security operation.
* Any derived class will implement this method respectively.
*/
virtual void tryToPerform( )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException){};
-
+
/*
* clear up all resources used by this operation.
* This method is called after the operation finishes, or a End-Your-Mission
* message is received.
* Any derived class will implement this method respectively.
*/
- virtual void clearUp( ) const {};
-
+ virtual void clearUp( ) const {};
+
/*
* notifies any possible result listener.
* When verify a signature or conduct a decryption, the operation result will
@@ -154,7 +154,7 @@ protected:
* Any derived class will implement this method respectively.
*/
virtual bool checkReady() const { return true; };
-
+
public:
/* XReferenceResolvedListener */
virtual void SAL_CALL referenceResolved( sal_Int32 referenceId )
@@ -163,7 +163,7 @@ public:
/* XKeyCollector */
virtual void SAL_CALL setKeyId( sal_Int32 id )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
/* XMissionTaker */
virtual sal_Bool SAL_CALL endMission( )
throw (com::sun::star::uno::RuntimeException);
diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.cxx b/xmlsecurity/source/framework/signaturecreatorimpl.cxx
index a0d0199957c7..3129af3f82a8 100644
--- a/xmlsecurity/source/framework/signaturecreatorimpl.cxx
+++ b/xmlsecurity/source/framework/signaturecreatorimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SignatureCreator"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureCreatorImpl"
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
SignatureCreatorImpl::SignatureCreatorImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF )
@@ -59,33 +59,33 @@ bool SignatureCreatorImpl::checkReady() const
/****** SignatureCreatorImpl/checkReady **************************************
*
* NAME
- * checkReady -- checks the conditions for the signature generation.
+ * checkReady -- checks the conditions for the signature generation.
*
* SYNOPSIS
- * bReady = checkReady( );
+ * bReady = checkReady( );
*
* FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the result listener is ready;
- * 2. the id of the template blocker is known;
- * 3. the SignatureEngine is ready.
+ * checks whether all following conditions are satisfied:
+ * 1. the result listener is ready;
+ * 2. the id of the template blocker is known;
+ * 3. the SignatureEngine is ready.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bReady - true if all conditions are satisfied, false otherwise
+ * bReady - true if all conditions are satisfied, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return (m_xResultListener.is() &&
- (m_nIdOfBlocker != -1) &&
+ (m_nIdOfBlocker != -1) &&
SignatureEngine::checkReady());
}
@@ -94,69 +94,69 @@ void SignatureCreatorImpl::notifyResultListener() const
/****** SignatureCreatorImpl/notifyResultListener *****************************
*
* NAME
- * notifyResultListener -- notifies the listener about the signature
- * creation result.
+ * notifyResultListener -- notifies the listener about the signature
+ * creation result.
*
* SYNOPSIS
- * notifyResultListener( );
+ * notifyResultListener( );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::sax::XSignatureCreationResultListener >
xSignatureCreationResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
-
+
xSignatureCreationResultListener->signatureCreated( m_nSecurityId, m_nStatus );
}
-void SignatureCreatorImpl::startEngine( const cssu::Reference<
+void SignatureCreatorImpl::startEngine( const cssu::Reference<
cssxc::XXMLSignatureTemplate >&
xSignatureTemplate)
throw (cssu::Exception, cssu::RuntimeException)
/****** SignatureCreatorImpl/startEngine *************************************
*
* NAME
- * startEngine -- generates the signature.
+ * startEngine -- generates the signature.
*
* SYNOPSIS
- * startEngine( xSignatureTemplate );
+ * startEngine( xSignatureTemplate );
*
* FUNCTION
- * generates the signature element, then if succeeds, updates the link
- * of old template element to the new signature element in
- * SAXEventKeeper.
+ * generates the signature element, then if succeeds, updates the link
+ * of old template element to the new signature element in
+ * SAXEventKeeper.
*
* INPUTS
- * xSignatureTemplate - the signature template (along with all referenced
- * elements) to be signed.
+ * xSignatureTemplate - the signature template (along with all referenced
+ * elements) to be signed.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate;
- try
+ try
{
xResultTemplate = m_xXMLSignature->generate(xSignatureTemplate, m_xSecurityEnvironment);
m_nStatus = xResultTemplate->getStatus();
@@ -165,11 +165,11 @@ void SignatureCreatorImpl::startEngine( const cssu::Reference<
{
m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED;
}
-
+
if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
{
cssu::Reference < cssxw::XXMLElementWrapper > xResultSignature = xResultTemplate->getTemplate();
- m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultSignature);
+ m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultSignature);
}
}
@@ -177,32 +177,32 @@ void SignatureCreatorImpl::clearUp() const
/****** SignatureCreatorImpl/clearUp *****************************************
*
* NAME
- * clearUp -- clear up all resources used by the signature generation.
+ * clearUp -- clear up all resources used by the signature generation.
*
* SYNOPSIS
- * clearUp( );
+ * clearUp( );
*
* FUNCTION
- * cleaning resources up includes:
- * 1. SignatureEngine's clearing up;
- * 2. releases the Blocker for the signature template element.
+ * cleaning resources up includes:
+ * 1. SignatureEngine's clearing up;
+ * 2. releases the Blocker for the signature template element.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
SignatureEngine::clearUp();
-
+
if (m_nIdOfBlocker != -1)
{
m_xSAXEventKeeper->removeBlocker(m_nIdOfBlocker);
@@ -218,7 +218,7 @@ void SAL_CALL SignatureCreatorImpl::setBlockerId( sal_Int32 id )
}
/* XSignatureCreationResultBroadcaster */
-void SAL_CALL SignatureCreatorImpl::addSignatureCreationResultListener(
+void SAL_CALL SignatureCreatorImpl::addSignatureCreationResultListener(
const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >& listener )
throw (cssu::Exception, cssu::RuntimeException)
{
@@ -226,20 +226,20 @@ void SAL_CALL SignatureCreatorImpl::addSignatureCreationResultListener(
tryToPerform();
}
-void SAL_CALL SignatureCreatorImpl::removeSignatureCreationResultListener(
+void SAL_CALL SignatureCreatorImpl::removeSignatureCreationResultListener(
const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >&)
throw (cssu::RuntimeException)
{
}
/* XInitialization */
-void SAL_CALL SignatureCreatorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
+void SAL_CALL SignatureCreatorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments )
throw (cssu::Exception, cssu::RuntimeException)
{
OSL_ASSERT(aArguments.getLength() == 5);
-
+
rtl::OUString ouTempString;
-
+
aArguments[0] >>= ouTempString;
m_nSecurityId = ouTempString.toInt32();
aArguments[1] >>= m_xSAXEventKeeper;
@@ -248,7 +248,7 @@ void SAL_CALL SignatureCreatorImpl::initialize( const cssu::Sequence< cssu::Any
aArguments[3] >>= m_xSecurityEnvironment;
aArguments[4] >>= m_xXMLSignature;
}
-
+
rtl::OUString SignatureCreatorImpl_getImplementationName ()
throw (cssu::RuntimeException)
@@ -256,13 +256,13 @@ rtl::OUString SignatureCreatorImpl_getImplementationName ()
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -272,7 +272,7 @@ cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServic
}
#undef SERVICE_NAME
-cssu::Reference< cssu::XInterface > SAL_CALL SignatureCreatorImpl_createInstance(
+cssu::Reference< cssu::XInterface > SAL_CALL SignatureCreatorImpl_createInstance(
const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr)
throw( cssu::Exception )
{
@@ -280,17 +280,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL SignatureCreatorImpl_createInstance
}
/* XServiceInfo */
-rtl::OUString SAL_CALL SignatureCreatorImpl::getImplementationName( )
+rtl::OUString SAL_CALL SignatureCreatorImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return SignatureCreatorImpl_getImplementationName();
}
-sal_Bool SAL_CALL SignatureCreatorImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL SignatureCreatorImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return SignatureCreatorImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return SignatureCreatorImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.hxx b/xmlsecurity/source/framework/signaturecreatorimpl.hxx
index 52d04352a2d9..10641fdce96f 100644
--- a/xmlsecurity/source/framework/signaturecreatorimpl.hxx
+++ b/xmlsecurity/source/framework/signaturecreatorimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@
class SignatureCreatorImpl : public cppu::ImplInheritanceHelper4
<
- SignatureEngine,
+ SignatureEngine,
com::sun::star::xml::crypto::sax::XBlockerMonitor,
com::sun::star::xml::crypto::sax::XSignatureCreationResultBroadcaster,
com::sun::star::lang::XInitialization,
@@ -50,19 +50,19 @@ class SignatureCreatorImpl : public cppu::ImplInheritanceHelper4
/****** SignatureCreatorImpl.hxx/CLASS SignatureCreatorImpl *******************
*
* NAME
- * SignatureCreatorImpl -- generates a signature
+ * SignatureCreatorImpl -- generates a signature
*
* FUNCTION
- * Collects all resources for a signature generation, then generates the
- * signature by invoking a xmlsec-based signature bridge component.
+ * Collects all resources for a signature generation, then generates the
+ * signature by invoking a xmlsec-based signature bridge component.
*
* HISTORY
- * 05.01.2004 - Interface supported: XBlockerMonitor,
- * XInitialization, XServiceInfo
+ * 05.01.2004 - Interface supported: XBlockerMonitor,
+ * XInitialization, XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -71,7 +71,7 @@ private:
* identify the signature.
*/
sal_Int32 m_nSignatureId;
-
+
/*
* the Id of template blocker.
*/
@@ -81,64 +81,64 @@ private:
* the signature creation result
*/
bool m_bCreationSucceed;
-
- com::sun::star::uno::Reference<
+
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment;
-
+
virtual void notifyResultListener() const
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
- virtual void clearUp( ) const;
+ virtual void clearUp( ) const;
virtual bool checkReady() const;
- virtual void startEngine( const com::sun::star::uno::Reference<
+ virtual void startEngine( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSignatureTemplate >&
xSignatureTemplate)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
public:
- explicit SignatureCreatorImpl( const com::sun::star::uno::Reference<
+ explicit SignatureCreatorImpl( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxMSF);
virtual ~SignatureCreatorImpl();
/* XBlockerMonitor */
virtual void SAL_CALL setBlockerId( sal_Int32 id )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
/* XSignatureCreationResultBroadcaster */
- void SAL_CALL addSignatureCreationResultListener(
- const com::sun::star::uno::Reference<
+ void SAL_CALL addSignatureCreationResultListener(
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& listener )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
- void SAL_CALL removeSignatureCreationResultListener(
- const com::sun::star::uno::Reference<
+
+ void SAL_CALL removeSignatureCreationResultListener(
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& listener )
throw (com::sun::star::uno::RuntimeException);
/* XInitialization */
- virtual void SAL_CALL initialize(
- const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
+ virtual void SAL_CALL initialize(
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString SignatureCreatorImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-SAL_CALL SignatureCreatorImpl_createInstance(
+SAL_CALL SignatureCreatorImpl_createInstance(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr)
throw ( com::sun::star::uno::Exception );
diff --git a/xmlsecurity/source/framework/signatureengine.cxx b/xmlsecurity/source/framework/signatureengine.cxx
index 3eea00e41434..bd5a52075099 100644
--- a/xmlsecurity/source/framework/signatureengine.cxx
+++ b/xmlsecurity/source/framework/signatureengine.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define SIGNATURE_TEMPLATE "com.sun.star.xml.crypto.XMLSignatureTemplate"
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
SignatureEngine::SignatureEngine( )
@@ -53,33 +53,33 @@ bool SignatureEngine::checkReady() const
/****** SignatureEngine/checkReady *******************************************
*
* NAME
- * checkReady -- checks the conditions for the main operation.
+ * checkReady -- checks the conditions for the main operation.
*
* SYNOPSIS
- * bReady = checkReady( );
+ * bReady = checkReady( );
*
* FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the main operation has't begun yet;
- * 2. the key material is known;
- * 3. the amount of reference is known;
- * 4. all of referenced elements, the key element and the signature
- * template are bufferred.
+ * checks whether all following conditions are satisfied:
+ * 1. the main operation has't begun yet;
+ * 2. the key material is known;
+ * 3. the amount of reference is known;
+ * 4. all of referenced elements, the key element and the signature
+ * template are bufferred.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bReady - true if all conditions are satisfied, false otherwise
+ * bReady - true if all conditions are satisfied, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
-{
+{
bool rc = true;
sal_Int32 nKeyInc = 0;
@@ -87,7 +87,7 @@ bool SignatureEngine::checkReady() const
{
nKeyInc = 1;
}
-
+
if (m_bMissionDone ||
m_nIdOfKeyEC == -1 ||
m_nTotalReferenceNumber == -1 ||
@@ -95,78 +95,78 @@ bool SignatureEngine::checkReady() const
{
rc = false;
}
-
+
return rc;
}
-void SignatureEngine::tryToPerform( )
+void SignatureEngine::tryToPerform( )
throw (cssu::Exception, cssu::RuntimeException)
/****** SignatureEngine/tryToPerform *****************************************
*
* NAME
- * tryToPerform -- tries to perform the signature operation.
+ * tryToPerform -- tries to perform the signature operation.
*
* SYNOPSIS
- * tryToPerform( );
+ * tryToPerform( );
*
* FUNCTION
- * if the situation is ready, perform following operations.
- * 1. prepares a signature template;
- * 2. calls the signature bridge component;
- * 3. clears up all used resources;
- * 4. notifies the result listener;
- * 5. sets the "accomplishment" flag.
+ * if the situation is ready, perform following operations.
+ * 1. prepares a signature template;
+ * 2. calls the signature bridge component;
+ * 3. clears up all used resources;
+ * 4. notifies the result listener;
+ * 5. sets the "accomplishment" flag.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (checkReady())
{
const rtl::OUString ouSignatureTemplate (
- RTL_CONSTASCII_USTRINGPARAM( SIGNATURE_TEMPLATE ) );
+ RTL_CONSTASCII_USTRINGPARAM( SIGNATURE_TEMPLATE ) );
cssu::Reference < cssxc::XXMLSignatureTemplate >
xSignatureTemplate( mxMSF->createInstance( ouSignatureTemplate ), cssu::UNO_QUERY );
-
+
OSL_ASSERT( xSignatureTemplate.is() );
-
+
cssu::Reference< cssxw::XXMLElementWrapper >
xXMLElement = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC );
-
+
xSignatureTemplate->setTemplate(xXMLElement);
-
+
std::vector< sal_Int32 >::const_iterator ii = m_vReferenceIds.begin();
-
- for( ; ii != m_vReferenceIds.end() ; ++ii )
+
+ for( ; ii != m_vReferenceIds.end() ; ++ii )
{
xXMLElement = m_xSAXEventKeeper->getElement( *ii );
xSignatureTemplate->setTarget(xXMLElement);
}
-
+
/*
* set the Uri binding
*/
xSignatureTemplate->setBinding( this );
-
+
startEngine( xSignatureTemplate );
-
+
/*
* done
*/
clearUp( );
-
+
notifyResultListener();
-
+
m_bMissionDone = true;
}
}
@@ -175,49 +175,49 @@ void SignatureEngine::clearUp( ) const
/****** SignatureEngine/clearUp **********************************************
*
* NAME
- * clearUp -- clear up all resources used by this operation.
+ * clearUp -- clear up all resources used by this operation.
*
* SYNOPSIS
- * clearUp( );
+ * clearUp( );
*
* FUNCTION
- * cleaning resources up includes:
- * 1. releases the ElementCollector for the signature template element;
- * 2. releases ElementCollectors for referenced elements;
- * 3. releases the ElementCollector for the key element, if there is one.
+ * cleaning resources up includes:
+ * 1. releases the ElementCollector for the signature template element;
+ * 2. releases ElementCollectors for referenced elements;
+ * 3. releases the ElementCollector for the key element, if there is one.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference < cssxc::sax::XReferenceResolvedBroadcaster >
xReferenceResolvedBroadcaster( m_xSAXEventKeeper, cssu::UNO_QUERY );
xReferenceResolvedBroadcaster->removeReferenceResolvedListener(
- m_nIdOfTemplateEC,
+ m_nIdOfTemplateEC,
(const cssu::Reference < cssxc::sax::XReferenceResolvedListener >)((SecurityEngine *)this));
-
+
m_xSAXEventKeeper->removeElementCollector(m_nIdOfTemplateEC);
-
+
std::vector< sal_Int32 >::const_iterator ii = m_vReferenceIds.begin();
-
- for( ; ii != m_vReferenceIds.end() ; ++ii )
+
+ for( ; ii != m_vReferenceIds.end() ; ++ii )
{
xReferenceResolvedBroadcaster->removeReferenceResolvedListener(
- *ii,
+ *ii,
(const cssu::Reference < cssxc::sax::XReferenceResolvedListener >)((SecurityEngine *)this));
m_xSAXEventKeeper->removeElementCollector(*ii);
}
-
+
if (m_nIdOfKeyEC != 0 && m_nIdOfKeyEC != -1)
{
m_xSAXEventKeeper->removeElementCollector(m_nIdOfKeyEC);
@@ -231,7 +231,7 @@ void SAL_CALL SignatureEngine::setReferenceCount( sal_Int32 count )
m_nTotalReferenceNumber = count;
tryToPerform();
}
-
+
void SAL_CALL SignatureEngine::setReferenceId( sal_Int32 id )
throw (cssu::Exception, cssu::RuntimeException)
{
@@ -247,14 +247,14 @@ void SAL_CALL SignatureEngine::setUriBinding(
m_vUris.push_back(uri);
m_vXInputStreams.push_back(aInputStream);
}
-
+
cssu::Reference< com::sun::star::io::XInputStream > SAL_CALL SignatureEngine::getUriBinding( const rtl::OUString& uri )
throw (cssu::Exception, cssu::RuntimeException)
{
cssu::Reference< com::sun::star::io::XInputStream > xInputStream;
-
+
int size = m_vUris.size();
-
+
for( int i=0; i<size; ++i)
{
if (m_vUris[i] == uri)
@@ -263,9 +263,9 @@ cssu::Reference< com::sun::star::io::XInputStream > SAL_CALL SignatureEngine::ge
break;
}
}
-
+
return xInputStream;
}
-
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/signatureengine.hxx b/xmlsecurity/source/framework/signatureengine.hxx
index 138ee6f883f5..7733785321e7 100644
--- a/xmlsecurity/source/framework/signatureengine.hxx
+++ b/xmlsecurity/source/framework/signatureengine.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@
#include <com/sun/star/xml/crypto/XXMLSignature.hpp>
#include <com/sun/star/xml/crypto/XUriBinding.hpp>
#include <com/sun/star/io/XInputStream.hpp>
-
+
#include <cppuhelper/implbase2.hxx>
#include "securityengine.hxx"
@@ -51,35 +51,35 @@
class SignatureEngine : public cppu::ImplInheritanceHelper2
<
- SecurityEngine,
+ SecurityEngine,
com::sun::star::xml::crypto::sax::XReferenceCollector,
com::sun::star::xml::crypto::XUriBinding
>
/****** signatureengine.hxx/CLASS SignatureEngine *****************************
*
* NAME
- * SignatureEngine -- Base class of SignatureCreator and SignatureVerifier
+ * SignatureEngine -- Base class of SignatureCreator and SignatureVerifier
*
* FUNCTION
- * Maintains common members and methods related with signature operation.
+ * Maintains common members and methods related with signature operation.
*
* HISTORY
- * 05.01.2004 - Interface supported: XReferenceCollector
+ * 05.01.2004 - Interface supported: XReferenceCollector
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
protected:
-
+
/*
* the Signature bridge component, which performs signature generation
* and verification based on xmlsec library.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSignature > m_xXMLSignature;
-
+
/*
* a collection of ElementCollector's ids. Each ElementCollector
* represents one element signed by this signature.
@@ -104,27 +104,27 @@ protected:
protected:
SignatureEngine( );
virtual ~SignatureEngine() {};
-
- virtual void tryToPerform( )
+
+ virtual void tryToPerform( )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
- virtual void clearUp( ) const;
+ virtual void clearUp( ) const;
virtual bool checkReady() const;
-
+
/*
* starts the main function. This method will be implemented by any sub-class.
* For a SignatureCreator, it performs signing operation;
* for a SignatureVerifier, verification operation is performed.
*/
- virtual void startEngine( const com::sun::star::uno::Reference<
+ virtual void startEngine( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSignatureTemplate >&)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
{};
-
+
public:
/* XReferenceCollector */
virtual void SAL_CALL setReferenceCount( sal_Int32 count )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setReferenceId( sal_Int32 id )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx
index d516e8761f6c..408e8f7b91a3 100644
--- a/xmlsecurity/source/framework/signatureverifierimpl.cxx
+++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SignatureVerifier"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureVerifierImpl"
-#define DECLARE_ASCII( SASCIIVALUE ) \
+#define DECLARE_ASCII( SASCIIVALUE ) \
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
SignatureVerifierImpl::SignatureVerifierImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF)
@@ -58,28 +58,28 @@ bool SignatureVerifierImpl::checkReady() const
/****** SignatureVerifierImpl/checkReady *************************************
*
* NAME
- * checkReady -- checks the conditions for the signature verification.
+ * checkReady -- checks the conditions for the signature verification.
*
* SYNOPSIS
- * bReady = checkReady( );
+ * bReady = checkReady( );
*
* FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the result listener is ready;
- * 2. the SignatureEngine is ready.
+ * checks whether all following conditions are satisfied:
+ * 1. the result listener is ready;
+ * 2. the SignatureEngine is ready.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * bReady - true if all conditions are satisfied, false otherwise
+ * bReady - true if all conditions are satisfied, false otherwise
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return (m_xResultListener.is() && SignatureEngine::checkReady());
@@ -90,66 +90,66 @@ void SignatureVerifierImpl::notifyResultListener() const
/****** SignatureVerifierImpl/notifyResultListener ***************************
*
* NAME
- * notifyResultListener -- notifies the listener about the verify result.
+ * notifyResultListener -- notifies the listener about the verify result.
*
* SYNOPSIS
- * notifyResultListener( );
+ * notifyResultListener( );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >
xSignatureVerifyResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
-
+
xSignatureVerifyResultListener->signatureVerified( m_nSecurityId, m_nStatus );
}
-void SignatureVerifierImpl::startEngine( const cssu::Reference<
+void SignatureVerifierImpl::startEngine( const cssu::Reference<
cssxc::XXMLSignatureTemplate >&
xSignatureTemplate)
throw (cssu::Exception, cssu::RuntimeException)
/****** SignatureVerifierImpl/startEngine ************************************
*
* NAME
- * startEngine -- verifies the signature.
+ * startEngine -- verifies the signature.
*
* SYNOPSIS
- * startEngine( xSignatureTemplate );
+ * startEngine( xSignatureTemplate );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * xSignatureTemplate - the signature template (along with all referenced
- * elements) to be verified.
+ * xSignatureTemplate - the signature template (along with all referenced
+ * elements) to be verified.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate;
- try
+ try
{
xResultTemplate = m_xXMLSignature->validate(xSignatureTemplate, m_xXMLSecurityContext);
m_nStatus = xResultTemplate->getStatus();
@@ -161,7 +161,7 @@ void SignatureVerifierImpl::startEngine( const cssu::Reference<
}
/* XSignatureVerifyResultBroadcaster */
-void SAL_CALL SignatureVerifierImpl::addSignatureVerifyResultListener(
+void SAL_CALL SignatureVerifierImpl::addSignatureVerifyResultListener(
const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >& listener )
throw (cssu::Exception, cssu::RuntimeException)
{
@@ -169,21 +169,21 @@ void SAL_CALL SignatureVerifierImpl::addSignatureVerifyResultListener(
tryToPerform();
}
-void SAL_CALL SignatureVerifierImpl::removeSignatureVerifyResultListener(
+void SAL_CALL SignatureVerifierImpl::removeSignatureVerifyResultListener(
const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >&)
throw (cssu::RuntimeException)
{
}
/* XInitialization */
-void SAL_CALL SignatureVerifierImpl::initialize(
- const cssu::Sequence< cssu::Any >& aArguments )
+void SAL_CALL SignatureVerifierImpl::initialize(
+ const cssu::Sequence< cssu::Any >& aArguments )
throw (cssu::Exception, cssu::RuntimeException)
{
OSL_ASSERT(aArguments.getLength() == 5);
-
+
rtl::OUString ouTempString;
-
+
aArguments[0] >>= ouTempString;
m_nSecurityId = ouTempString.toInt32();
aArguments[1] >>= m_xSAXEventKeeper;
@@ -192,22 +192,22 @@ void SAL_CALL SignatureVerifierImpl::initialize(
aArguments[3] >>= m_xXMLSecurityContext;
aArguments[4] >>= m_xXMLSignature;
}
-
+
rtl::OUString SignatureVerifierImpl_getImplementationName ()
throw (cssu::RuntimeException)
{
- return rtl::OUString(
+ return rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -217,7 +217,7 @@ cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServi
}
#undef SERVICE_NAME
-cssu::Reference< cssu::XInterface > SAL_CALL SignatureVerifierImpl_createInstance(
+cssu::Reference< cssu::XInterface > SAL_CALL SignatureVerifierImpl_createInstance(
const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr)
throw( cssu::Exception )
{
@@ -225,17 +225,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL SignatureVerifierImpl_createInstanc
}
/* XServiceInfo */
-rtl::OUString SAL_CALL SignatureVerifierImpl::getImplementationName( )
+rtl::OUString SAL_CALL SignatureVerifierImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return SignatureVerifierImpl_getImplementationName();
}
-sal_Bool SAL_CALL SignatureVerifierImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL SignatureVerifierImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return SignatureVerifierImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return SignatureVerifierImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/framework/signatureverifierimpl.hxx b/xmlsecurity/source/framework/signatureverifierimpl.hxx
index 77dede5b9272..f4db3fc0a5d5 100644
--- a/xmlsecurity/source/framework/signatureverifierimpl.hxx
+++ b/xmlsecurity/source/framework/signatureverifierimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,8 +39,8 @@
#include "signatureengine.hxx"
class SignatureVerifierImpl : public cppu::ImplInheritanceHelper3
-<
- SignatureEngine,
+<
+ SignatureEngine,
com::sun::star::xml::crypto::sax::XSignatureVerifyResultBroadcaster,
com::sun::star::lang::XInitialization,
com::sun::star::lang::XServiceInfo
@@ -48,19 +48,19 @@ class SignatureVerifierImpl : public cppu::ImplInheritanceHelper3
/****** SignatureVerifier.hxx/CLASS SignatureVerifierImpl *********************
*
* NAME
- * SignatureVerifierImpl -- verifies a signature
+ * SignatureVerifierImpl -- verifies a signature
*
* FUNCTION
- * Collects all resources for a signature verification, then verifies the
- * signature by invoking a xmlsec-based signature bridge component.
+ * Collects all resources for a signature verification, then verifies the
+ * signature by invoking a xmlsec-based signature bridge component.
*
* HISTORY
- * 05.01.2004 - Interface supported: XSignatureVerifyResultBroadcaster,
- * XInitialization, XServiceInfo
+ * 05.01.2004 - Interface supported: XSignatureVerifyResultBroadcaster,
+ * XInitialization, XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -69,65 +69,65 @@ private:
* identify the signature.
*/
sal_Int32 m_nSignatureId;
-
+
/*
* the verify result
*/
bool m_bVerifySucceed;
-
- com::sun::star::uno::Reference<
+
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext;
-
+
virtual void notifyResultListener() const
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
virtual bool checkReady() const;
- virtual void startEngine( const com::sun::star::uno::Reference<
+ virtual void startEngine( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSignatureTemplate >&
xSignatureTemplate)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
public:
- explicit SignatureVerifierImpl( const com::sun::star::uno::Reference<
+ explicit SignatureVerifierImpl( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxMSF);
virtual ~SignatureVerifierImpl();
/* XSignatureVerifyResultBroadcaster */
- virtual void SAL_CALL addSignatureVerifyResultListener(
- const com::sun::star::uno::Reference<
+ virtual void SAL_CALL addSignatureVerifyResultListener(
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
listener )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeSignatureVerifyResultListener(
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
+ virtual void SAL_CALL removeSignatureVerifyResultListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
listener )
throw (com::sun::star::uno::RuntimeException);
/* XInitialization */
- virtual void SAL_CALL initialize(
- const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
+ virtual void SAL_CALL initialize(
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString SignatureVerifierImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-SAL_CALL SignatureVerifierImpl_createInstance(
+SAL_CALL SignatureVerifierImpl_createInstance(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr)
throw ( com::sun::star::uno::Exception );
diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx
index 86e19756b9d6..e2c213e5565a 100644
--- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx
+++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,7 +40,7 @@ using ::rtl::OUString ;
using ::com::sun::star::xml::wrapper::XXMLElementWrapper ;
using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ;
-XMLEncryptionTemplateImpl :: XMLEncryptionTemplateImpl( const Reference< XMultiServiceFactory >& aFactory )
+XMLEncryptionTemplateImpl :: XMLEncryptionTemplateImpl( const Reference< XMultiServiceFactory >& aFactory )
: m_xTemplate( NULL ),
m_xTarget( NULL ),
m_xServiceManager( aFactory ),
@@ -51,27 +51,27 @@ XMLEncryptionTemplateImpl :: ~XMLEncryptionTemplateImpl() {
}
/* XXMLEncryptionTemplate */
-void SAL_CALL XMLEncryptionTemplateImpl :: setTemplate( const Reference< XXMLElementWrapper >& aTemplate )
+void SAL_CALL XMLEncryptionTemplateImpl :: setTemplate( const Reference< XXMLElementWrapper >& aTemplate )
throw (com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException)
{
m_xTemplate = aTemplate ;
}
/* XXMLEncryptionTemplate */
-Reference< XXMLElementWrapper > SAL_CALL XMLEncryptionTemplateImpl :: getTemplate()
+Reference< XXMLElementWrapper > SAL_CALL XMLEncryptionTemplateImpl :: getTemplate()
throw (com::sun::star::uno::RuntimeException)
{
return m_xTemplate ;
}
/* XXMLEncryptionTemplate */
-void SAL_CALL XMLEncryptionTemplateImpl :: setTarget( const Reference< XXMLElementWrapper >& aTarget )
+void SAL_CALL XMLEncryptionTemplateImpl :: setTarget( const Reference< XXMLElementWrapper >& aTarget )
throw( com::sun::star::lang::IllegalArgumentException ) {
m_xTarget = aTarget ;
}
/* XXMLEncryptionTemplate */
-Reference< XXMLElementWrapper > SAL_CALL XMLEncryptionTemplateImpl :: getTarget()
+Reference< XXMLElementWrapper > SAL_CALL XMLEncryptionTemplateImpl :: getTarget()
throw (com::sun::star::uno::RuntimeException)
{
return m_xTarget ;
diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
index 87aad120ff53..10b33c8a5154 100644
--- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
+++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,7 +62,7 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3<
//Methods from XXMLEncryptionTemplate
virtual void SAL_CALL setTemplate(
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement
- )
+ )
throw (com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTemplate(
@@ -74,7 +74,7 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3<
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTarget(
) throw (com::sun::star::uno::RuntimeException) ;
-
+
virtual void SAL_CALL setStatus(
::com::sun::star::xml::crypto::SecurityOperationStatus status )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
@@ -107,6 +107,6 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
} ;
-#endif // _XMLENCRYPTIONTEMPLATE_XMLSECIMPL_HXX_
+#endif // _XMLENCRYPTIONTEMPLATE_XMLSECIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx
index c03ef50243e0..9dc76e96c542 100644
--- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx
+++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ using ::rtl::OUString ;
using ::com::sun::star::xml::wrapper::XXMLElementWrapper ;
using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ;
-XMLSignatureTemplateImpl :: XMLSignatureTemplateImpl( const Reference< XMultiServiceFactory >& aFactory )
+XMLSignatureTemplateImpl :: XMLSignatureTemplateImpl( const Reference< XMultiServiceFactory >& aFactory )
:m_xTemplate( NULL ),
m_xServiceManager( aFactory ),
m_nStatus ( ::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN )
@@ -52,40 +52,40 @@ XMLSignatureTemplateImpl :: ~XMLSignatureTemplateImpl() {
}
/* XXMLSignatureTemplate */
-void SAL_CALL XMLSignatureTemplateImpl :: setTemplate( const Reference< XXMLElementWrapper >& aTemplate )
+void SAL_CALL XMLSignatureTemplateImpl :: setTemplate( const Reference< XXMLElementWrapper >& aTemplate )
throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException)
{
m_xTemplate = aTemplate ;
}
/* XXMLSignatureTemplate */
-Reference< XXMLElementWrapper > SAL_CALL XMLSignatureTemplateImpl :: getTemplate()
+Reference< XXMLElementWrapper > SAL_CALL XMLSignatureTemplateImpl :: getTemplate()
throw (com::sun::star::uno::RuntimeException)
{
return m_xTemplate ;
}
-void SAL_CALL XMLSignatureTemplateImpl :: setTarget( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement )
+void SAL_CALL XMLSignatureTemplateImpl :: setTarget( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement )
throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException)
{
targets.push_back( aXmlElement );
}
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL XMLSignatureTemplateImpl :: getTargets()
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL XMLSignatureTemplateImpl :: getTargets()
throw (com::sun::star::uno::RuntimeException)
{
sal_Int32 length = targets.size();
::com::sun::star::uno::Sequence<
::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >
> aTargets (length);
-
+
sal_Int32 i;
-
+
for (i=0; i<length; i++)
{
aTargets[i] = targets[i];
}
-
+
return aTargets;
}
diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
index a38c73b44821..b8cc82480122 100644
--- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
+++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -77,7 +77,7 @@ class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3<
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL getTargets(
) throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setBinding(
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::crypto::XUriBinding >& aUriBinding )
@@ -86,7 +86,7 @@ class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3<
::com::sun::star::xml::crypto::XUriBinding >
SAL_CALL getBinding( )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setStatus(
::com::sun::star::xml::crypto::SecurityOperationStatus status )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
@@ -119,6 +119,6 @@ class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
} ;
-#endif // _XMLSIGNATURETEMPLATE_XMLSECIMPL_HXX_
+#endif // _XMLSIGNATURETEMPLATE_XMLSECIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/xsec_framework.cxx b/xmlsecurity/source/framework/xsec_framework.cxx
index 3a03e3738d53..1597e32422ea 100644
--- a/xmlsecurity/source/framework/xsec_framework.cxx
+++ b/xmlsecurity/source/framework/xsec_framework.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -70,16 +70,16 @@ sal_Bool SAL_CALL component_writeInfo(
//Decryptor
sal_Int32 nPos = 0;
Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( DecryptorImpl_getImplementationName() ) );
+ reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( DecryptorImpl_getImplementationName() ) );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
-
+
const Sequence< OUString > & rSNL = DecryptorImpl_getSupportedServiceNames();
const OUString * pArray = rSNL.getConstArray();
for ( nPos = rSNL.getLength(); nPos--; )
xNewKey->createKey( pArray[nPos] );
-
+
//Encryptor
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( EncryptorImpl_getImplementationName() );
+ xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( EncryptorImpl_getImplementationName() );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
const Sequence< OUString > & rSNL2 = EncryptorImpl_getSupportedServiceNames();
pArray = rSNL2.getConstArray();
@@ -87,7 +87,7 @@ sal_Bool SAL_CALL component_writeInfo(
xNewKey->createKey( pArray[nPos] );
//SignatureCreator
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SignatureCreatorImpl_getImplementationName() );
+ xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SignatureCreatorImpl_getImplementationName() );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
const Sequence< OUString > & rSNL3 = SignatureCreatorImpl_getSupportedServiceNames();
pArray = rSNL3.getConstArray();
@@ -95,7 +95,7 @@ sal_Bool SAL_CALL component_writeInfo(
xNewKey->createKey( pArray[nPos] );
//SignatureVerifier
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SignatureVerifierImpl_getImplementationName() );
+ xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SignatureVerifierImpl_getImplementationName() );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
const Sequence< OUString > & rSNL4 = SignatureVerifierImpl_getSupportedServiceNames();
pArray = rSNL4.getConstArray();
@@ -103,7 +103,7 @@ sal_Bool SAL_CALL component_writeInfo(
xNewKey->createKey( pArray[nPos] );
//SAXEventKeeper
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SAXEventKeeperImpl_getImplementationName() );
+ xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SAXEventKeeperImpl_getImplementationName() );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
const Sequence< OUString > & rSNL5 = SAXEventKeeperImpl_getSupportedServiceNames();
pArray = rSNL5.getConstArray();
@@ -111,7 +111,7 @@ sal_Bool SAL_CALL component_writeInfo(
xNewKey->createKey( pArray[nPos] );
//XMLSignatureTemplateImpl
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XMLSignatureTemplateImpl::impl_getImplementationName() );
+ xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XMLSignatureTemplateImpl::impl_getImplementationName() );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
const Sequence< OUString > & rSNL6 = XMLSignatureTemplateImpl::impl_getSupportedServiceNames();
pArray = rSNL6.getConstArray();
@@ -119,13 +119,13 @@ sal_Bool SAL_CALL component_writeInfo(
xNewKey->createKey( pArray[nPos] );
// XMLEncryptionTemplateImpl
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XMLEncryptionTemplateImpl::impl_getImplementationName() );
+ xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XMLEncryptionTemplateImpl::impl_getImplementationName() );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
const Sequence< OUString > & rSNL7 = XMLEncryptionTemplateImpl::impl_getSupportedServiceNames();
pArray = rSNL7.getConstArray();
for ( nPos = rSNL7.getLength(); nPos--; )
xNewKey->createKey( pArray[nPos] );
-
+
return sal_True;
}
catch (InvalidRegistryException &)
@@ -141,7 +141,7 @@ void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
void * pRet = 0;
-
+
//Decryptor
OUString implName = OUString::createFromAscii( pImplName );
if ( pServiceManager && implName.equals(DecryptorImpl_getImplementationName()) )
@@ -150,7 +150,7 @@ void * SAL_CALL component_getFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
DecryptorImpl_createInstance, DecryptorImpl_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
@@ -165,7 +165,7 @@ void * SAL_CALL component_getFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
EncryptorImpl_createInstance, EncryptorImpl_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
@@ -180,14 +180,14 @@ void * SAL_CALL component_getFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
SignatureCreatorImpl_createInstance, SignatureCreatorImpl_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
pRet = xFactory.get();
}
}
-
+
//SignatureVerifier
if ( pServiceManager && implName.equals(SignatureVerifierImpl_getImplementationName()) )
{
@@ -195,7 +195,7 @@ void * SAL_CALL component_getFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
SignatureVerifierImpl_createInstance, SignatureVerifierImpl_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
@@ -210,7 +210,7 @@ void * SAL_CALL component_getFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
SAXEventKeeperImpl_createInstance, SAXEventKeeperImpl_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
@@ -243,7 +243,7 @@ void * SAL_CALL component_getFactory(
pRet = xFactory.get();
}
}
-
+
return pRet;
}
}
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index 9b5fd047eac6..d5058788b447 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,7 +48,7 @@ namespace css = ::com::sun::star;
using rtl::OUString;
-namespace
+namespace
{
::rtl::OUString getElement(::rtl::OUString const & version, ::sal_Int32 * index)
{
@@ -70,7 +70,7 @@ int compareVersions(
::rtl::OUString e2(getElement(version2, &i2));
if (e1.getLength() < e2.getLength()) {
return -1;
- } else if (e1.getLength() > e2.getLength()) {
+ } else if (e1.getLength() > e2.getLength()) {
return 1;
} else if (e1 < e2) {
return -1;
@@ -84,14 +84,14 @@ int compareVersions(
//If the OOo 3.0 mode is used then we exclude
//'mimetype' and all content of 'META-INF'.
//If the argument 'bSigning' is true then the element list is created for a signing
-//operation in which case we use the latest signing algorithm. That is all elements
+//operation in which case we use the latest signing algorithm. That is all elements
//we find in the zip storage are added to the list. We do not support the old signatures
//which did not contain all files.
//If 'bSigning' is false, then we validate. If the user enabled validating according to OOo 3.0
//then mimetype and all content of META-INF must be excluded.
-void ImplFillElementList(
- std::vector< rtl::OUString >& rList, const Reference < css::embed::XStorage >& rxStore,
- const ::rtl::OUString rRootStorageName, const bool bRecursive,
+void ImplFillElementList(
+ std::vector< rtl::OUString >& rList, const Reference < css::embed::XStorage >& rxStore,
+ const ::rtl::OUString rRootStorageName, const bool bRecursive,
const DocumentSignatureAlgorithm mode)
{
::rtl::OUString aMetaInfName( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) );
@@ -105,7 +105,7 @@ void ImplFillElementList(
for ( sal_Int32 n = 0; n < nElements; n++ )
{
- if (mode != OOo3_2Document
+ if (mode != OOo3_2Document
&& (pNames[n] == aMetaInfName
|| pNames[n] == sMimeTypeName))
{
@@ -155,7 +155,7 @@ bool DocumentSignatureHelper::isOOo3_2_Signature(const SignatureInformation & si
::rtl::OUString sManifestURI(RTL_CONSTASCII_USTRINGPARAM("META-INF/manifest.xml"));
bool bOOo3_2 = false;
typedef ::std::vector< SignatureReferenceInformation >::const_iterator CIT;
- for (CIT i = sigInfo.vSignatureReferenceInfors.begin();
+ for (CIT i = sigInfo.vSignatureReferenceInfors.begin();
i < sigInfo.vSignatureReferenceInfors.end(); i++)
{
if (i->ouURI.equals(sManifestURI))
@@ -167,7 +167,7 @@ bool DocumentSignatureHelper::isOOo3_2_Signature(const SignatureInformation & si
return bOOo3_2;
}
-DocumentSignatureAlgorithm
+DocumentSignatureAlgorithm
DocumentSignatureHelper::getDocumentAlgorithm(
const ::rtl::OUString & sODFVersion, const SignatureInformation & sigInfo)
{
@@ -184,24 +184,24 @@ DocumentSignatureHelper::getDocumentAlgorithm(
}
//The function creates a list of files which are to be signed or for which
-//the signature is to be validated. The strings are UTF8 encoded URIs which
+//the signature is to be validated. The strings are UTF8 encoded URIs which
//contain '/' as path separators.
//
-//The algorithm how document signatures are created and validated has
+//The algorithm how document signatures are created and validated has
//changed over time. The change affects only which files within the document
//are changed. Document signatures created by OOo 2.x only used particular files. Since
-//OOo 3.0 everything except "mimetype" and "META-INF" are signed. As of OOo 3.2 everything
+//OOo 3.0 everything except "mimetype" and "META-INF" are signed. As of OOo 3.2 everything
//except META-INF/documentsignatures.xml is signed.
//Signatures are validated according to the algorithm which was then used for validation.
-//That is, when validating a signature which was created by OOo 3.0, then mimetype and
+//That is, when validating a signature which was created by OOo 3.0, then mimetype and
//META-INF are not used.
//
//When a signature is created then we always use the latest algorithm. That is, we use
//that of OOo 3.2
-std::vector< rtl::OUString >
-DocumentSignatureHelper::CreateElementList(
- const Reference < css::embed::XStorage >& rxStore,
- const ::rtl::OUString /*rRootStorageName*/, DocumentSignatureMode eMode,
+std::vector< rtl::OUString >
+DocumentSignatureHelper::CreateElementList(
+ const Reference < css::embed::XStorage >& rxStore,
+ const ::rtl::OUString /*rRootStorageName*/, DocumentSignatureMode eMode,
const DocumentSignatureAlgorithm mode)
{
std::vector< rtl::OUString > aElements;
@@ -311,7 +311,7 @@ DocumentSignatureHelper::CreateElementList(
return aElements;
}
-SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
+SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
const Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode, DocumentSignatureMode eDocSigMode )
{
sal_Int32 nSubStorageOpenMode = css::embed::ElementModes::READ;
@@ -320,7 +320,7 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
SignatureStreamHelper aHelper;
- try
+ try
{
::rtl::OUString aSIGStoreName( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) );
aHelper.xSignatureStorage = rxStore->openStorageElement( aSIGStoreName, nSubStorageOpenMode );
@@ -348,11 +348,11 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
//sElementList contains all files which are expected to be signed. Only those files must me signed,
//no more, no less.
-//The DocumentSignatureAlgorithm indicates if the document was created with OOo 2.x. Then
+//The DocumentSignatureAlgorithm indicates if the document was created with OOo 2.x. Then
//the uri s in the Reference elements in the signature, were not properly encoded.
// For example: <Reference URI="ObjectReplacements/Object 1">
-bool DocumentSignatureHelper::checkIfAllFilesAreSigned(
- const ::std::vector< ::rtl::OUString > & sElementList,
+bool DocumentSignatureHelper::checkIfAllFilesAreSigned(
+ const ::std::vector< ::rtl::OUString > & sElementList,
const SignatureInformation & sigInfo,
const DocumentSignatureAlgorithm alg)
{
@@ -382,7 +382,7 @@ bool DocumentSignatureHelper::checkIfAllFilesAreSigned(
::rtl::OUString sElementListURI = *aIter;
if (alg == OOo2Document)
{
- sElementListURI =
+ sElementListURI =
::rtl::Uri::encode(
sElementListURI, rtl_UriCharClassPchar,
rtl_UriEncodeCheckEscapes, RTL_TEXTENCODING_UTF8);
@@ -430,7 +430,7 @@ bool DocumentSignatureHelper::equalsReferenceUriManifestPath(
{
retVal = true;
typedef std::vector<OUString>::const_iterator CIT;
- for (CIT i = vUriSegments.begin(), j = vPathSegments.begin();
+ for (CIT i = vUriSegments.begin(), j = vPathSegments.begin();
i != vUriSegments.end(); i++, j++)
{
//Decode the uri segment, so that %20 becomes ' ', etc.
@@ -443,10 +443,10 @@ bool DocumentSignatureHelper::equalsReferenceUriManifestPath(
}
}
}
-
+
return retVal;
}
-
+
::rtl::OUString DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName()
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "documentsignatures.xml" ) );
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 18fb74c6c399..b46d8ba194cb 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,8 +53,8 @@
/* SEInitializer component */
#define SEINITIALIZER_COMPONENT "com.sun.star.xml.crypto.SEInitializer"
-#define TAG_DOCUMENTSIGNATURES "document-signatures"
-#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures"
+#define TAG_DOCUMENTSIGNATURES "document-signatures"
+#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures"
#define NS_DOCUMENTSIGNATURES_ODF_1_2 "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0"
using namespace ::com::sun::star;
@@ -80,7 +80,7 @@ bool XMLSignatureHelper::Init( const rtl::OUString& rTokenPath )
DBG_ASSERT( !mxSecurityContext.is(), "XMLSignatureHelper::Init - mxSecurityContext already set!" );
ImplCreateSEInitializer();
-
+
if ( mxSEInitializer.is() )
mxSecurityContext = mxSEInitializer->createSecurityContext( rTokenPath );
@@ -88,7 +88,7 @@ bool XMLSignatureHelper::Init( const rtl::OUString& rTokenPath )
}
void XMLSignatureHelper::ImplCreateSEInitializer()
-{
+{
rtl::OUString sSEInitializer(rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT ));
uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > (
@@ -105,7 +105,7 @@ com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > XMLSi
return mxUriBinding;
}
-void XMLSignatureHelper::SetStorage(
+void XMLSignatureHelper::SetStorage(
const Reference < css::embed::XStorage >& rxStorage,
::rtl::OUString sODFVersion)
{
@@ -140,7 +140,7 @@ sal_Int32 XMLSignatureHelper::GetNewSecurityId()
return mpXSecController->getNewSecurityId();
}
-void XMLSignatureHelper::SetX509Certificate(
+void XMLSignatureHelper::SetX509Certificate(
sal_Int32 nSecurityId,
const rtl::OUString& ouX509IssuerName,
const rtl::OUString& ouX509SerialNumber,
@@ -153,7 +153,7 @@ void XMLSignatureHelper::SetX509Certificate(
ouX509Cert);
}
-void XMLSignatureHelper::SetX509Certificate(
+void XMLSignatureHelper::SetX509Certificate(
sal_Int32 nSecurityId,
sal_Int32 nSecurityEnvironmentIndex,
const rtl::OUString& ouX509IssuerName,
@@ -196,31 +196,31 @@ uno::Reference<xml::sax::XDocumentHandler> XMLSignatureHelper::CreateDocumentHan
const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream )
{
/*
- * get SAX writer component
+ * get SAX writer component
*/
uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
uno::Reference< io::XActiveDataSource > xSaxWriter(
- xMCF->createInstanceWithContext(rtl::OUString::createFromAscii(
+ xMCF->createInstanceWithContext(rtl::OUString::createFromAscii(
"com.sun.star.xml.sax.Writer"), mxCtx ), uno::UNO_QUERY );
-
+
DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" );
-
+
/*
- * connect XML writer to output stream
+ * connect XML writer to output stream
*/
xSaxWriter->setOutputStream( xOutputStream );
/*
* prepare document handler
*/
- uno::Reference<xml::sax::XDocumentHandler>
+ uno::Reference<xml::sax::XDocumentHandler>
xDocHandler( xSaxWriter,uno::UNO_QUERY);
-
+
/*
* write the xml context for signatures
*/
rtl::OUString tag_AllSignatures(RTL_CONSTASCII_USTRINGPARAM(TAG_DOCUMENTSIGNATURES));
-
+
SvXMLAttributeList *pAttributeList = new SvXMLAttributeList();
rtl::OUString sNamespace;
if (mbODFPre1_2)
@@ -231,12 +231,12 @@ uno::Reference<xml::sax::XDocumentHandler> XMLSignatureHelper::CreateDocumentHan
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)),
sNamespace);
-
+
xDocHandler->startDocument();
- xDocHandler->startElement(
+ xDocHandler->startElement(
tag_AllSignatures,
uno::Reference< com::sun::star::xml::sax::XAttributeList > (pAttributeList));
-
+
return xDocHandler;
}
@@ -247,7 +247,7 @@ void XMLSignatureHelper::CloseDocumentHandler( const uno::Reference<xml::sax::XD
xDocumentHandler->endDocument();
}
-void XMLSignatureHelper::ExportSignature(
+void XMLSignatureHelper::ExportSignature(
const uno::Reference< xml::sax::XDocumentHandler >& xDocumentHandler,
const SignatureInformation& signatureInfo )
{
@@ -262,7 +262,7 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax
* create a signature listener
*/
/*
- ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener(
+ ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener(
LINK( this, XMLSignatureHelper, SignatureCreationResultListener ),
LINK( this, XMLSignatureHelper, SignatureVerifyResultListener ),
LINK( this, XMLSignatureHelper, StartVerifySignatureElement ) );
@@ -284,30 +284,30 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax
* clear up the signature creation listener
*/
//mpXSecController->setSignatureCreationResultListener( NULL );
-
+
return !mbError;
}
bool XMLSignatureHelper::CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream )
{
- uno::Reference<xml::sax::XDocumentHandler> xDocHandler
+ uno::Reference<xml::sax::XDocumentHandler> xDocHandler
= CreateDocumentHandlerWithHeader(xOutputStream);
-
+
bool rc = CreateAndWriteSignature( xDocHandler );
-
+
CloseDocumentHandler(xDocHandler);
-
+
return rc;
}
bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream )
{
mbError = false;
-
+
DBG_ASSERT(xInputStream.is(), "input stream missing");
-
+
/*
- * prepare ParserInputSrouce
+ * prepare ParserInputSrouce
*/
xml::sax::InputSource aParserInput;
// aParserInput.sSystemId = ouName;
@@ -327,31 +327,31 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
/*
* create a signature reader
*/
- uno::Reference< xml::sax::XDocumentHandler > xHandler
+ uno::Reference< xml::sax::XDocumentHandler > xHandler
= mpXSecController->createSignatureReader( );
-
+
/*
* create a signature listener
*/
- ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener(
+ ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener(
LINK( this, XMLSignatureHelper, SignatureCreationResultListener ),
LINK( this, XMLSignatureHelper, SignatureVerifyResultListener ),
LINK( this, XMLSignatureHelper, StartVerifySignatureElement ) );
-
+
/*
* configure the signature verify listener
*/
//mpXSecController->setSignatureVerifyResultListener( pSignatureListener );
-
+
/*
* setup the connection:
* Parser -> SignatureListener -> SignatureReader
*/
- pSignatureListener->setNextHandler(xHandler);
+ pSignatureListener->setNextHandler(xHandler);
xParser->setDocumentHandler( pSignatureListener );
-
+
/*
- * parser the stream
+ * parser the stream
*/
try
{
@@ -373,11 +373,11 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
{
mbError = true;
}
-
+
/*
* clear up the connection
*/
- pSignatureListener->setNextHandler( NULL );
+ pSignatureListener->setNextHandler( NULL );
/*
* clear up the signature verify listener
@@ -388,7 +388,7 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
* release the signature reader
*/
mpXSecController->releaseSignatureReader( );
-
+
return !mbError;
}
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx
index 0e75c51cf6c7..3ed893e6d2d5 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -74,7 +74,7 @@ void SAL_CALL ImplXMLSignatureListener::signatureVerified( sal_Int32 securityId,
}
// ---------------------------------------------------------------------------------
-// XDocumentHandler
+// XDocumentHandler
// ---------------------------------------------------------------------------------
void SAL_CALL ImplXMLSignatureListener::startDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
@@ -84,7 +84,7 @@ void SAL_CALL ImplXMLSignatureListener::startDocument( )
m_xNextHandler->startDocument();
}
}
-
+
void SAL_CALL ImplXMLSignatureListener::endDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
{
@@ -107,8 +107,8 @@ void SAL_CALL ImplXMLSignatureListener::startElement( const rtl::OUString& aName
m_xNextHandler->startElement( aName, xAttribs );
}
}
-
-void SAL_CALL ImplXMLSignatureListener::endElement( const rtl::OUString& aName )
+
+void SAL_CALL ImplXMLSignatureListener::endElement( const rtl::OUString& aName )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
{
if (m_xNextHandler.is())
@@ -116,7 +116,7 @@ void SAL_CALL ImplXMLSignatureListener::endElement( const rtl::OUString& aName )
m_xNextHandler->endElement( aName );
}
}
-
+
void SAL_CALL ImplXMLSignatureListener::characters( const rtl::OUString& aChars )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
{
@@ -125,7 +125,7 @@ void SAL_CALL ImplXMLSignatureListener::characters( const rtl::OUString& aChars
m_xNextHandler->characters( aChars );
}
}
-
+
void SAL_CALL ImplXMLSignatureListener::ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
{
@@ -134,7 +134,7 @@ void SAL_CALL ImplXMLSignatureListener::ignorableWhitespace( const rtl::OUString
m_xNextHandler->ignorableWhitespace( aWhitespaces );
}
}
-
+
void SAL_CALL ImplXMLSignatureListener::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
{
@@ -143,7 +143,7 @@ void SAL_CALL ImplXMLSignatureListener::processingInstruction( const rtl::OUStri
m_xNextHandler->processingInstruction( aTarget, aData );
}
}
-
+
void SAL_CALL ImplXMLSignatureListener::setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException)
{
@@ -154,7 +154,7 @@ void SAL_CALL ImplXMLSignatureListener::setDocumentLocator( const com::sun::star
}
// ---------------------------------------------------------------------------------
-// XUriBinding
+// XUriBinding
// ---------------------------------------------------------------------------------
UriBindingHelper::UriBindingHelper()
@@ -167,11 +167,11 @@ UriBindingHelper::UriBindingHelper( const com::sun::star::uno::Reference < com::
}
-void SAL_CALL UriBindingHelper::setUriBinding( const rtl::OUString& /*uri*/, const uno::Reference< io::XInputStream >&)
+void SAL_CALL UriBindingHelper::setUriBinding( const rtl::OUString& /*uri*/, const uno::Reference< io::XInputStream >&)
throw (uno::Exception, uno::RuntimeException)
{
}
-
+
uno::Reference< io::XInputStream > SAL_CALL UriBindingHelper::getUriBinding( const rtl::OUString& uri )
throw (uno::Exception, uno::RuntimeException)
{
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx
index e5dd47978b94..db9319753daa 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -29,8 +29,8 @@
#include <tools/link.hxx>
#include <rtl/ustring.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase3.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
@@ -51,7 +51,7 @@ namespace embed {
// MT: Not needed any more, remove later...
class ImplXMLSignatureListener : public cppu::WeakImplHelper3
-<
+<
com::sun::star::xml::crypto::sax::XSignatureCreationResultListener,
com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener,
com::sun::star::xml::sax::XDocumentHandler
@@ -62,56 +62,56 @@ private:
Link maVerifyResultListenerListener;
Link maStartVerifySignatureElementListener;
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler;
public:
ImplXMLSignatureListener( const Link& rCreationResultListenerListener, const Link rVerifyResultListenerListener, const Link rStartVerifySignatureElement );
~ImplXMLSignatureListener();
-
- void setNextHandler(com::sun::star::uno::Reference<
+
+ void setNextHandler(com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler > xNextHandler);
// com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
virtual void SAL_CALL signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus creationResult )
throw (com::sun::star::uno::RuntimeException);
-
+
// com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
virtual void SAL_CALL signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus verifyResult )
throw (com::sun::star::uno::RuntimeException);
-
+
// com::sun::star::xml::sax::XDocumentHandler
virtual void SAL_CALL startElement( const rtl::OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL startDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL endDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL endElement( const rtl::OUString& aName )
+
+ virtual void SAL_CALL endElement( const rtl::OUString& aName )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL characters( const rtl::OUString& aChars )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
};
// ---------------------------------------------------------------------------------
-// XUriBinding
+// XUriBinding
// ---------------------------------------------------------------------------------
-class UriBindingHelper : public cppu::WeakImplHelper1
+class UriBindingHelper : public cppu::WeakImplHelper1
<
com::sun::star::xml::crypto::XUriBinding
>
@@ -120,7 +120,7 @@ private:
com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxStorage;
-public:
+public:
UriBindingHelper();
UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage );
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index d2af8a56c760..864d6de8df14 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -179,7 +179,7 @@ sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateT
aTimeStr = rString.copy( nPos + 1, nPos2 - nPos - 1 );
//Get the fraction of a second with the accuracy of one hundreds second.
- //The fraction part of the date could have different accuracies. To calculate
+ //The fraction part of the date could have different accuracies. To calculate
//the count of a hundredth units one could form a fractional number by appending
//the value of the time string to 0. Then multiply it by 100 and use only the whole number.
//For example: 5:27:46,1 -> 0,1 * 100 = 10
@@ -276,38 +276,38 @@ sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateT
}
return bSuccess;
}
-
+
int XSecController::findSignatureInfor( sal_Int32 nSecurityId) const
/****** XSecController/findSignatureInfor *************************************
*
* NAME
- * findSignatureInfor -- find SignatureInformation struct for a particular
- * signature
+ * findSignatureInfor -- find SignatureInformation struct for a particular
+ * signature
*
* SYNOPSIS
- * index = findSignatureInfor( nSecurityId );
+ * index = findSignatureInfor( nSecurityId );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * nSecurityId - the signature's id
+ * nSecurityId - the signature's id
*
* RESULT
- * index - the index of the signature, or -1 when no such signature
- * existing
+ * index - the index of the signature, or -1 when no such signature
+ * existing
*
* HISTORY
- * 08.05.2004 - implemented
+ * 08.05.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
int i;
int size = m_vInternalSignatureInformations.size();
-
+
for (i=0; i<size; ++i)
{
if (m_vInternalSignatureInformations[i].signatureInfor.nSecurityId == nSecurityId)
@@ -315,7 +315,7 @@ int XSecController::findSignatureInfor( sal_Int32 nSecurityId) const
return i;
}
}
-
+
return -1;
}
@@ -323,35 +323,35 @@ void XSecController::createXSecComponent( )
/****** XSecController/createXSecComponent ************************************
*
* NAME
- * bResult = createXSecComponent -- creates xml security components
+ * bResult = createXSecComponent -- creates xml security components
*
* SYNOPSIS
- * createXSecComponent( );
+ * createXSecComponent( );
*
* FUNCTION
- * Creates xml security components, including:
- * 1. an xml signature bridge component ( Java based or C based)
- * 2. an XMLDocumentWrapper component ( Java based or C based)
- * 3. a SAXEventKeeper component
+ * Creates xml security components, including:
+ * 1. an xml signature bridge component ( Java based or C based)
+ * 2. an XMLDocumentWrapper component ( Java based or C based)
+ * 3. a SAXEventKeeper component
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
rtl::OUString sSAXEventKeeper(rtl::OUString::createFromAscii( SAXEVENTKEEPER_COMPONENT ));
rtl::OUString sXMLSignature(rtl::OUString::createFromAscii( XMLSIGNATURE_COMPONENT ));
rtl::OUString sXMLDocument(rtl::OUString::createFromAscii( XMLDOCUMENTWRAPPER_COMPONENT ));
-
+
/*
* marks all security components are not available.
*/
@@ -361,11 +361,11 @@ void XSecController::createXSecComponent( )
m_xSAXEventKeeper = NULL;
cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
-
+
m_xXMLSignature = cssu::Reference< cssxc::XXMLSignature >(
xMCF->createInstanceWithContext( sXMLSignature, mxCtx ),
cssu::UNO_QUERY );
-
+
bool bSuccess = (0!=m_xXMLSignature.is());
if ( bSuccess )
/*
@@ -376,7 +376,7 @@ void XSecController::createXSecComponent( )
xMCF->createInstanceWithContext( sXMLDocument, mxCtx ),
cssu::UNO_QUERY );
}
-
+
bSuccess &= (0!=m_xXMLDocumentWrapper.is());
if ( bSuccess )
/*
@@ -389,26 +389,26 @@ void XSecController::createXSecComponent( )
}
bSuccess &= (0!=m_xSAXEventKeeper.is());
-
+
if (bSuccess)
/*
* SAXEventKeeper created successfully.
*/
{
cssu::Reference< cssl::XInitialization > xInitialization(m_xSAXEventKeeper, cssu::UNO_QUERY);
-
+
cssu::Sequence <cssu::Any> arg(1);
arg[0] = cssu::makeAny(m_xXMLDocumentWrapper);
xInitialization->initialize(arg);
-
- cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster>
- xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
+
+ cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster>
+ xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >
xStatusChangeListener = this;
-
+
xSAXEventKeeperStatusChangeBroadcaster
->addSAXEventKeeperStatusChangeListener( xStatusChangeListener );
-
+
m_nStatusOfSecurityComponents = INITIALIZED;
}
}
@@ -417,55 +417,55 @@ bool XSecController::chainOn( bool bRetrievingLastEvent )
/****** XSecController/chainOn ************************************************
*
* NAME
- * chainOn -- tyies to connect the SAXEventKeeper with the SAX chain.
+ * chainOn -- tyies to connect the SAXEventKeeper with the SAX chain.
*
* SYNOPSIS
- * bJustChainingOn = chainOn( bRetrievingLastEvent );
+ * bJustChainingOn = chainOn( bRetrievingLastEvent );
*
* FUNCTION
- * First, checks whether the SAXEventKeeper is on the SAX chain. If not,
- * creates xml security components, and chains the SAXEventKeeper into
- * the SAX chain.
- * Before being chained in, the SAXEventKeeper needs to receive all
- * missed key SAX events, which can promise the DOM tree bufferred by the
- * SAXEventKeeper has the same structure with the original document.
+ * First, checks whether the SAXEventKeeper is on the SAX chain. If not,
+ * creates xml security components, and chains the SAXEventKeeper into
+ * the SAX chain.
+ * Before being chained in, the SAXEventKeeper needs to receive all
+ * missed key SAX events, which can promise the DOM tree bufferred by the
+ * SAXEventKeeper has the same structure with the original document.
*
* INPUTS
- * bRetrievingLastEvent - whether to retrieve the last key SAX event from
- * the ElementStackKeeper.
- *
+ * bRetrievingLastEvent - whether to retrieve the last key SAX event from
+ * the ElementStackKeeper.
+ *
* RESULT
- * bJustChainingOn - whether the SAXEventKeeper is just chained into the
- * SAX chain.
+ * bJustChainingOn - whether the SAXEventKeeper is just chained into the
+ * SAX chain.
*
* NOTES
- * Sometimes, the last key SAX event can't be transferred to the
- * SAXEventKeeper together.
- * For instance, at the time an referenced element is detected, the
- * startElement event has already been reserved by the ElementStackKeeper.
- * Meanwhile, an ElementCollector needs to be created before the
- * SAXEventKeeper receives that startElement event.
- * So for the SAXEventKeeper, it needs to receive all missed key SAX
- * events except that startElement event, then adds a new
- * ElementCollector, then receives that startElement event.
+ * Sometimes, the last key SAX event can't be transferred to the
+ * SAXEventKeeper together.
+ * For instance, at the time an referenced element is detected, the
+ * startElement event has already been reserved by the ElementStackKeeper.
+ * Meanwhile, an ElementCollector needs to be created before the
+ * SAXEventKeeper receives that startElement event.
+ * So for the SAXEventKeeper, it needs to receive all missed key SAX
+ * events except that startElement event, then adds a new
+ * ElementCollector, then receives that startElement event.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
bool rc = false;
-
+
if (!m_bIsSAXEventKeeperSticky && !m_bIsSAXEventKeeperConnected)
{
if ( m_nStatusOfSecurityComponents == UNINITIALIZED )
{
createXSecComponent();
}
-
+
if ( m_nStatusOfSecurityComponents == INITIALIZED )
/*
* if all security components are ready, chains on the SAXEventKeeper
@@ -477,9 +477,9 @@ bool XSecController::chainOn( bool bRetrievingLastEvent )
* phase.
*/
m_xSAXEventKeeper->setNextHandler( NULL );
-
+
cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(m_xSAXEventKeeper, cssu::UNO_QUERY);
-
+
/*
* connects the previous document handler on the SAX chain
*/
@@ -489,7 +489,7 @@ bool XSecController::chainOn( bool bRetrievingLastEvent )
{
cssu::Reference< cssl::XInitialization > xInitialization
(m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
-
+
cssu::Sequence<cssu::Any> aArgs( 1 );
aArgs[0] <<= xSEKHandler;
xInitialization->initialize(aArgs);
@@ -501,33 +501,33 @@ bool XSecController::chainOn( bool bRetrievingLastEvent )
xParser->setDocumentHandler( xSEKHandler );
}
}
-
+
/*
* get missed key SAX events
*/
if (m_xElementStackKeeper.is())
{
m_xElementStackKeeper->retrieve(xSEKHandler, bRetrievingLastEvent);
-
+
/*
- * now the ElementStackKeeper can stop its work, because the
+ * now the ElementStackKeeper can stop its work, because the
* SAXEventKeeper is on the SAX chain, no SAX events will be
* missed.
*/
m_xElementStackKeeper->stop();
}
-
+
/*
* connects the next document handler on the SAX chain
*/
m_xSAXEventKeeper->setNextHandler( m_xNextNodeOnSAXChain );
-
+
m_bIsSAXEventKeeperConnected = true;
-
+
rc = true;
}
}
-
+
return rc;
}
@@ -535,26 +535,26 @@ void XSecController::chainOff()
/****** XSecController/chainOff ***********************************************
*
* NAME
- * chainOff -- disconnects the SAXEventKeeper from the SAX chain.
+ * chainOff -- disconnects the SAXEventKeeper from the SAX chain.
*
* SYNOPSIS
- * chainOff( );
+ * chainOff( );
*
* FUNCTION
- * See NAME.
+ * See NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (!m_bIsSAXEventKeeperSticky )
@@ -562,14 +562,14 @@ void XSecController::chainOff()
if (m_bIsSAXEventKeeperConnected)
{
m_xSAXEventKeeper->setNextHandler( NULL );
-
+
if ( m_xPreviousNodeOnSAXChain.is() )
{
if ( m_bIsPreviousNodeInitializable )
{
cssu::Reference< cssl::XInitialization > xInitialization
(m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
-
+
cssu::Sequence<cssu::Any> aArgs( 1 );
aArgs[0] <<= m_xNextNodeOnSAXChain;
xInitialization->initialize(aArgs);
@@ -580,7 +580,7 @@ void XSecController::chainOff()
xParser->setDocumentHandler( m_xNextNodeOnSAXChain );
}
}
-
+
if (m_xElementStackKeeper.is())
{
/*
@@ -589,7 +589,7 @@ void XSecController::chainOff()
*/
m_xElementStackKeeper->start();
}
-
+
m_bIsSAXEventKeeperConnected = false;
}
}
@@ -599,30 +599,30 @@ void XSecController::checkChainingStatus()
/****** XSecController/checkChainingStatus ************************************
*
* NAME
- * checkChainingStatus -- connects or disconnects the SAXEventKeeper
- * according to the current situation.
+ * checkChainingStatus -- connects or disconnects the SAXEventKeeper
+ * according to the current situation.
*
* SYNOPSIS
- * checkChainingStatus( );
+ * checkChainingStatus( );
*
* FUNCTION
- * The SAXEventKeeper is chained into the SAX chain, when:
- * 1. some element is being collected, or
- * 2. the SAX event stream is blocking.
- * Otherwise, chain off the SAXEventKeeper.
+ * The SAXEventKeeper is chained into the SAX chain, when:
+ * 1. some element is being collected, or
+ * 2. the SAX event stream is blocking.
+ * Otherwise, chain off the SAXEventKeeper.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if ( m_bIsCollectingElement || m_bIsBlocking )
@@ -639,35 +639,35 @@ void XSecController::initializeSAXChain()
/****** XSecController/initializeSAXChain *************************************
*
* NAME
- * initializeSAXChain -- initializes the SAX chain according to the
- * current setting.
+ * initializeSAXChain -- initializes the SAX chain according to the
+ * current setting.
*
* SYNOPSIS
- * initializeSAXChain( );
+ * initializeSAXChain( );
*
* FUNCTION
- * Initializes the SAX chain, if the SAXEventKeeper is asked to be always
- * on the SAX chain, chains it on. Otherwise, starts the
- * ElementStackKeeper to reserve key SAX events.
+ * Initializes the SAX chain, if the SAXEventKeeper is asked to be always
+ * on the SAX chain, chains it on. Otherwise, starts the
+ * ElementStackKeeper to reserve key SAX events.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_bIsSAXEventKeeperConnected = false;
m_bIsCollectingElement = false;
m_bIsBlocking = false;
-
+
if (m_xElementStackKeeper.is())
{
/*
@@ -675,80 +675,80 @@ void XSecController::initializeSAXChain()
*/
m_xElementStackKeeper->start();
}
-
+
chainOff();
}
-cssu::Reference< com::sun::star::io::XInputStream >
+cssu::Reference< com::sun::star::io::XInputStream >
XSecController::getObjectInputStream( const rtl::OUString& objectURL )
/****** XSecController/getObjectInputStream ************************************
*
* NAME
- * getObjectInputStream -- get a XInputStream interface from a SvStorage
+ * getObjectInputStream -- get a XInputStream interface from a SvStorage
*
* SYNOPSIS
- * xInputStream = getObjectInputStream( objectURL );
+ * xInputStream = getObjectInputStream( objectURL );
*
* FUNCTION
- * See NAME.
+ * See NAME.
*
* INPUTS
- * objectURL - the object uri
+ * objectURL - the object uri
*
* RESULT
- * xInputStream - the XInputStream interface
+ * xInputStream - the XInputStream interface
*
* HISTORY
- * 15.04.2004 - implemented
+ * 15.04.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
cssu::Reference< com::sun::star::io::XInputStream > xObjectInputStream;
DBG_ASSERT( m_xUriBinding.is(), "Need XUriBinding!" );
-
+
xObjectInputStream = m_xUriBinding->getUriBinding(objectURL);
-
+
return xObjectInputStream;
-}
+}
#if 0
sal_Int32 XSecController::getFastPropertyIndex(sal_Int32 nHandle) const
/****** XSecController/getFastPropertyIndex ***********************************
*
* NAME
- * getFastPropertyIndex -- gets the index of a particular fast property
+ * getFastPropertyIndex -- gets the index of a particular fast property
*
* SYNOPSIS
- * nIndex = getFastPropertyIndex( nHandle );
+ * nIndex = getFastPropertyIndex( nHandle );
*
* FUNCTION
- * See NAME.
+ * See NAME.
*
* INPUTS
- * nHandle - the key for the fast property
+ * nHandle - the key for the fast property
*
* RESULT
- * nIndex - the index of the fast property, or -1
- * if the key is not found.
+ * nIndex - the index of the fast property, or -1
+ * if the key is not found.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
std::vector< sal_Int32 >::const_iterator ii = m_vFastPropertyIndexs.begin();
sal_Int32 nIndex = 0;
-
+
bool bFound = false;
-
- for( ; ii != m_vFastPropertyIndexs.end(); ++ii,++nIndex )
+
+ for( ; ii != m_vFastPropertyIndexs.end(); ++ii,++nIndex )
{
if ( nHandle == (*ii))
{
@@ -756,18 +756,18 @@ sal_Int32 XSecController::getFastPropertyIndex(sal_Int32 nHandle) const
break;
}
}
-
+
if (!bFound)
{
nIndex = -1;
}
-
+
return nIndex;
}
#endif
/*
- * public methods
+ * public methods
*/
sal_Int32 XSecController::getNewSecurityId( )
@@ -783,39 +783,39 @@ void XSecController::startMission(
/****** XSecController/startMission *******************************************
*
* NAME
- * startMission -- starts a new security mission.
+ * startMission -- starts a new security mission.
*
* SYNOPSIS
- * startMission( xUriBinding, xSecurityContect );
+ * startMission( xUriBinding, xSecurityContect );
*
* FUNCTION
- * get ready for a new mission.
+ * get ready for a new mission.
*
* INPUTS
- * xUriBinding - the Uri binding that provide maps between uris and
+ * xUriBinding - the Uri binding that provide maps between uris and
* XInputStreams
- * xSecurityContext - the security context component which can provide
- * cryptoken
+ * xSecurityContext - the security context component which can provide
+ * cryptoken
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_xUriBinding = xUriBinding;
-
+
m_nStatusOfSecurityComponents = UNINITIALIZED;
m_xSecurityContext = xSecurityContext;
m_pErrorMessage = NULL;
m_vInternalSignatureInformations.clear();
-
+
m_bVerifyCurrentSignature = false;
}
@@ -826,32 +826,32 @@ void XSecController::setSAXChainConnector(
/****** XSecController/setSAXChainConnector ***********************************
*
* NAME
- * setSAXChainConnector -- configures the components which will
- * collaborate with the SAXEventKeeper on the SAX chain.
+ * setSAXChainConnector -- configures the components which will
+ * collaborate with the SAXEventKeeper on the SAX chain.
*
* SYNOPSIS
- * setSAXChainConnector( xInitialization,
- * xDocumentHandler,
- * xElementStackKeeper );
+ * setSAXChainConnector( xInitialization,
+ * xDocumentHandler,
+ * xElementStackKeeper );
*
* FUNCTION
- * See NAME.
+ * See NAME.
*
* INPUTS
- * xInitialization - the previous node on the SAX chain
- * xDocumentHandler - the next node on the SAX chain
- * xElementStackKeeper - the ElementStackKeeper component which reserves
- * missed key SAX events for the SAXEventKeeper
+ * xInitialization - the previous node on the SAX chain
+ * xDocumentHandler - the next node on the SAX chain
+ * xElementStackKeeper - the ElementStackKeeper component which reserves
+ * missed key SAX events for the SAXEventKeeper
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_bIsPreviousNodeInitializable = true;
@@ -869,37 +869,37 @@ void XSecController::setSAXChainConnector(
/****** XSecController/setSAXChainConnector ***********************************
*
* NAME
- * setSAXChainConnector -- configures the components which will
- * collaborate with the SAXEventKeeper on the SAX chain.
+ * setSAXChainConnector -- configures the components which will
+ * collaborate with the SAXEventKeeper on the SAX chain.
*
* SYNOPSIS
- * setSAXChainConnector( xParser, xDocumentHandler, xElementStackKeeper );
+ * setSAXChainConnector( xParser, xDocumentHandler, xElementStackKeeper );
*
* FUNCTION
- * See NAME.
+ * See NAME.
*
* INPUTS
- * xParser - the previous node on the SAX chain
- * xDocumentHandler - the next node on the SAX chain
- * xElementStackKeeper -the ElementStackKeeper component which reserves
- * missed key SAX events for the SAXEventKeeper
+ * xParser - the previous node on the SAX chain
+ * xDocumentHandler - the next node on the SAX chain
+ * xElementStackKeeper -the ElementStackKeeper component which reserves
+ * missed key SAX events for the SAXEventKeeper
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_bIsPreviousNodeInitializable = false;
m_xPreviousNodeOnSAXChain = xParser;
m_xNextNodeOnSAXChain = xDocumentHandler;
m_xElementStackKeeper = xElementStackKeeper;
-
+
initializeSAXChain( );
}
@@ -907,26 +907,26 @@ void XSecController::clearSAXChainConnector()
/****** XSecController/clearSAXChainConnector *********************************
*
* NAME
- * clearSAXChainConnector -- resets the collaborating components.
+ * clearSAXChainConnector -- resets the collaborating components.
*
* SYNOPSIS
- * clearSAXChainConnector( );
+ * clearSAXChainConnector( );
*
* FUNCTION
- * See NAME.
+ * See NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
/*
@@ -940,7 +940,7 @@ void XSecController::clearSAXChainConnector()
cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(m_xSAXEventKeeper, cssu::UNO_QUERY);
m_xElementStackKeeper->retrieve(xSEKHandler, sal_True);
}
-
+
chainOff();
m_xPreviousNodeOnSAXChain = NULL;
@@ -952,30 +952,30 @@ void XSecController::endMission()
/****** XSecController/endMission *********************************************
*
* NAME
- * endMission -- forces to end all missions
+ * endMission -- forces to end all missions
*
* SYNOPSIS
- * endMission( );
+ * endMission( );
*
* FUNCTION
- * Deletes all signature information and forces all missions to an end.
+ * Deletes all signature information and forces all missions to an end.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
sal_Int32 size = m_vInternalSignatureInformations.size();
-
+
for (int i=0; i<size; ++i)
{
if ( m_nStatusOfSecurityComponents == INITIALIZED )
@@ -985,25 +985,25 @@ void XSecController::endMission()
{
cssu::Reference< cssxc::sax::XMissionTaker > xMissionTaker
( m_vInternalSignatureInformations[i].xReferenceResolvedListener, cssu::UNO_QUERY );
-
+
/*
* askes the SignatureCreator/SignatureVerifier to release
* all resouces it uses.
- */
+ */
xMissionTaker->endMission();
}
}
-
+
m_xUriBinding = NULL;
m_xSecurityContext = NULL;
-
+
/*
* free the status change listener reference to this object
*/
if (m_xSAXEventKeeper.is())
{
- cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster>
- xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
+ cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster>
+ xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
xSAXEventKeeperStatusChangeBroadcaster
->addSAXEventKeeperStatusChangeListener( NULL );
}
@@ -1013,26 +1013,26 @@ const char* XSecController::getErrorMessage()
/****** XSecController/getErrorMessage ****************************************
*
* NAME
- * getErrorMessage -- get the last error message
+ * getErrorMessage -- get the last error message
*
* SYNOPSIS
- * pErrorMessage = getErrorMessage( );
+ * pErrorMessage = getErrorMessage( );
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 22.04.2004 - implemented
+ * 22.04.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return m_pErrorMessage;
@@ -1044,27 +1044,27 @@ void XSecController::exportSignature(
/****** XSecController/exportSignature ****************************************
*
* NAME
- * exportSignature -- export a signature structure to an XDocumentHandler
+ * exportSignature -- export a signature structure to an XDocumentHandler
*
* SYNOPSIS
- * exportSignature( xDocumentHandler, signatureInfo);
+ * exportSignature( xDocumentHandler, signatureInfo);
*
* FUNCTION
- * see NAME.
+ * see NAME.
*
* INPUTS
- * xDocumentHandler - the document handler to receive the signature
- * signatureInfo - signature to be exported
+ * xDocumentHandler - the document handler to receive the signature
+ * signatureInfo - signature to be exported
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 26.05.2004 - implemented
+ * 26.05.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
/*
@@ -1091,34 +1091,34 @@ void XSecController::exportSignature(
rtl::OUString tag_SignatureProperties(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTIES));
rtl::OUString tag_SignatureProperty(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY));
rtl::OUString tag_Date(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE));
-#if 0
+#if 0
rtl::OUString tag_Timestamp(RTL_CONSTASCII_USTRINGPARAM(TAG_TIMESTAMP));
rtl::OUString tag_Date(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE));
rtl::OUString tag_Time(RTL_CONSTASCII_USTRINGPARAM(TAG_TIME));
#endif
-
+
const SignatureReferenceInformations& vReferenceInfors = signatureInfo.vSignatureReferenceInfors;
SvXMLAttributeList *pAttributeList;
/*
- * Write Signature element
+ * Write Signature element
*/
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_XMLDSIG)));
-
+
if (signatureInfo.ouSignatureId.getLength()>0)
{
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ID)),
rtl::OUString(signatureInfo.ouSignatureId));
}
-
+
xDocumentHandler->startElement( tag_Signature, cssu::Reference< cssxs::XAttributeList > (pAttributeList));
{
/* Write SignedInfo element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_SignedInfo,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
{
@@ -1129,7 +1129,7 @@ void XSecController::exportSignature(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_C14N)));
xDocumentHandler->startElement( tag_CanonicalizationMethod, cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( tag_CanonicalizationMethod );
-
+
/* Write SignatureMethod element */
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
@@ -1141,7 +1141,7 @@ void XSecController::exportSignature(
/* Write Reference element */
int j;
int refNum = vReferenceInfors.size();
-
+
for(j=0; j<refNum; ++j)
{
const SignatureReferenceInformation& refInfor = vReferenceInfors[j];
@@ -1165,7 +1165,7 @@ void XSecController::exportSignature(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_URI)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_FRAGMENT))+refInfor.ouURI);
}
-
+
xDocumentHandler->startElement( tag_Reference, cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
{
/* Write Transforms element */
@@ -1182,24 +1182,24 @@ void XSecController::exportSignature(
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ALGORITHM)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_C14N)));
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_Transform,
cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( tag_Transform );
}
xDocumentHandler->endElement( tag_Transforms );
}
-
+
/* Write DigestMethod element */
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ALGORITHM)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_XMLDSIGSHA1)));
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_DigestMethod,
cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( tag_DigestMethod );
-
+
/* Write DigestValue element */
xDocumentHandler->startElement(
tag_DigestValue,
@@ -1211,49 +1211,49 @@ void XSecController::exportSignature(
}
}
xDocumentHandler->endElement( tag_SignedInfo );
-
+
/* Write SignatureValue element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_SignatureValue,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouSignatureValue );
xDocumentHandler->endElement( tag_SignatureValue );
-
+
/* Write KeyInfo element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_KeyInfo,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
{
/* Write X509Data element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_X509Data,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
{
/* Write X509IssuerSerial element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_X509IssuerSerial,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
{
/* Write X509IssuerName element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_X509IssuerName,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouX509IssuerName );
xDocumentHandler->endElement( tag_X509IssuerName );
-
+
/* Write X509SerialNumber element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_X509SerialNumber,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouX509SerialNumber );
xDocumentHandler->endElement( tag_X509SerialNumber );
}
xDocumentHandler->endElement( tag_X509IssuerSerial );
-
+
/* Write X509Certificate element */
if (signatureInfo.ouX509Certificate.getLength()>0)
{
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_X509Certificate,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouX509Certificate );
@@ -1263,14 +1263,14 @@ void XSecController::exportSignature(
xDocumentHandler->endElement( tag_X509Data );
}
xDocumentHandler->endElement( tag_KeyInfo );
-
+
/* Write Object element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_Object,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
{
/* Write SignatureProperties element */
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_SignatureProperties,
cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
{
@@ -1282,12 +1282,12 @@ void XSecController::exportSignature(
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_TARGET)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_FRAGMENT))+signatureInfo.ouSignatureId);
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
tag_SignatureProperty,
cssu::Reference< cssxs::XAttributeList > (pAttributeList));
{
/* Write timestamp element */
-
+
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS))
@@ -1295,16 +1295,16 @@ void XSecController::exportSignature(
+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DC)));
- xDocumentHandler->startElement(
+ xDocumentHandler->startElement(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC))
+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":"))
+tag_Date,
cssu::Reference< cssxs::XAttributeList > (pAttributeList));
-
+
::rtl::OUStringBuffer buffer;
- //If the xml signature was already contained in the document,
- //then we use the original date and time string, rather then the
- //converted one. When the original string is converted to the DateTime
+ //If the xml signature was already contained in the document,
+ //then we use the original date and time string, rather then the
+ //converted one. When the original string is converted to the DateTime
//structure then information may be lost because it only holds a fractional
//of a second with a accuracy of one hundredth of second. If the string contains
//milli seconds (document was signed by an application other than OOo)
@@ -1316,7 +1316,7 @@ void XSecController::exportSignature(
convertDateTime( buffer, signatureInfo.stDateTime );
xDocumentHandler->characters( buffer.makeStringAndClear() );
- xDocumentHandler->endElement(
+ xDocumentHandler->endElement(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC))
+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":"))
+tag_Date);
@@ -1326,7 +1326,7 @@ void XSecController::exportSignature(
xDocumentHandler->endElement( tag_SignatureProperties );
}
xDocumentHandler->endElement( tag_Object );
- }
+ }
xDocumentHandler->endElement( tag_Signature );
}
@@ -1346,13 +1346,13 @@ SignatureInformations XSecController::getSignatureInformations() const
{
SignatureInformations vInfors;
int sigNum = m_vInternalSignatureInformations.size();
-
+
for (int i=0; i<sigNum; ++i)
{
SignatureInformation si = m_vInternalSignatureInformations[i].signatureInfor;
vInfors.push_back(si);
}
-
+
return vInfors;
}
@@ -1363,13 +1363,13 @@ SignatureInformations XSecController::getSignatureInformations() const
*/
/*
- * XFastPropertySet
+ * XFastPropertySet
*/
/*
void SAL_CALL XSecController::setFastPropertyValue(
sal_Int32 nHandle,
const cssu::Any& aValue )
- throw ( cssb::UnknownPropertyException,
+ throw ( cssb::UnknownPropertyException,
cssb::PropertyVetoException,
cssl::IllegalArgumentException,
cssl::WrappedTargetException,
@@ -1386,7 +1386,7 @@ void SAL_CALL XSecController::setFastPropertyValue(
m_vFastPropertyValues[nIndex] = aValue;
}
}
-
+
cssu::Any SAL_CALL XSecController::getFastPropertyValue(
sal_Int32 nHandle )
throw (
@@ -1401,7 +1401,7 @@ cssu::Any SAL_CALL XSecController::getFastPropertyValue(
{
aValue = m_vFastPropertyValues[nIndex];
}
-
+
return aValue;
}
*/
@@ -1409,7 +1409,7 @@ cssu::Any SAL_CALL XSecController::getFastPropertyValue(
/*
* XSAXEventKeeperStatusChangeListener
*/
-
+
void SAL_CALL XSecController::blockingStatusChanged( sal_Bool isBlocking )
throw (cssu::RuntimeException)
{
@@ -1423,18 +1423,18 @@ void SAL_CALL XSecController::blockingStatusChanged( sal_Bool isBlocking )
this->m_bIsBlocking = isBlocking;
checkChainingStatus();
}
-
-void SAL_CALL XSecController::collectionStatusChanged(
+
+void SAL_CALL XSecController::collectionStatusChanged(
sal_Bool isInsideCollectedElement )
throw (cssu::RuntimeException)
{
/*
- showMessageBox( rtl::OUString::createFromAscii((isInsideCollectedElement?
+ showMessageBox( rtl::OUString::createFromAscii((isInsideCollectedElement?
"Collection Status => TRUE":
"Collection Status => FALSE")),
rtl::OUString::createFromAscii("SAXEventKeeper Status"));
*/
-
+
this->m_bIsCollectingElement = isInsideCollectedElement;
checkChainingStatus();
}
@@ -1443,7 +1443,7 @@ void SAL_CALL XSecController::bufferStatusChanged( sal_Bool /*isBufferEmpty*/)
throw (cssu::RuntimeException)
{
/*
- showMessageBox( rtl::OUString::createFromAscii((isBufferEmpty?
+ showMessageBox( rtl::OUString::createFromAscii((isBufferEmpty?
"Buffer Empty => TRUE":
"Buffer Empty => FALSE")),
rtl::OUString::createFromAscii("SAXEventKeeper Status"));
@@ -1460,7 +1460,7 @@ void SAL_CALL XSecController::signatureCreated( sal_Int32 securityId, com::sun::
DBG_ASSERT( index != -1, "Signature Not Found!" );
SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor;
-
+
/*
if (nResult == cssxc::sax::SignatureCreationResult_CREATIONSUCCEED)
{
@@ -1469,7 +1469,7 @@ void SAL_CALL XSecController::signatureCreated( sal_Int32 securityId, com::sun::
else
{
signatureInfor.nStatus = STATUS_CREATION_FAIL;
- }
+ }
*/
signatureInfor.nStatus = nResult;
}
@@ -1484,7 +1484,7 @@ void SAL_CALL XSecController::signatureVerified( sal_Int32 securityId, com::sun:
DBG_ASSERT( index != -1, "Signature Not Found!" );
SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor;
-
+
/*
if (nResult == cssxc::sax::SignatureVerifyResult_VERIFYSUCCEED)
{
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 5fafb4c51fa9..73d6e0d198a0 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -70,49 +70,49 @@
/*
* all stringS in signature element
*/
-#define TAG_SIGNATURE "Signature"
-#define TAG_SIGNEDINFO "SignedInfo"
-#define TAG_CANONICALIZATIONMETHOD "CanonicalizationMethod"
-#define TAG_SIGNATUREMETHOD "SignatureMethod"
-#define TAG_REFERENCE "Reference"
-#define TAG_TRANSFORMS "Transforms"
-#define TAG_TRANSFORM "Transform"
-#define TAG_DIGESTMETHOD "DigestMethod"
-#define TAG_DIGESTVALUE "DigestValue"
-#define TAG_SIGNATUREVALUE "SignatureValue"
-#define TAG_KEYINFO "KeyInfo"
-#define TAG_X509DATA "X509Data"
-#define TAG_X509ISSUERSERIAL "X509IssuerSerial"
-#define TAG_X509ISSUERNAME "X509IssuerName"
-#define TAG_X509SERIALNUMBER "X509SerialNumber"
-#define TAG_X509CERTIFICATE "X509Certificate"
-#define TAG_OBJECT "Object"
-#define TAG_SIGNATUREPROPERTIES "SignatureProperties"
-#define TAG_SIGNATUREPROPERTY "SignatureProperty"
-#define TAG_TIMESTAMP "timestamp"
-#define TAG_DATE "date"
-//#define TAG_TIME "time"
-
-#define ATTR_XMLNS "xmlns"
-#define ATTR_ALGORITHM "Algorithm"
-#define ATTR_URI "URI"
-#define ATTR_ID "Id"
-#define ATTR_TARGET "Target"
-
-#define NSTAG_DC "dc"
-
-#define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#"
-//#define NS_DATETIME "http://www.ietf.org/rfcXXXX.txt"
-#define NS_DC "http://purl.org/dc/elements/1.1/"
-
-#define ALGO_C14N "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
-#define ALGO_RSASHA1 "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
-#define ALGO_XMLDSIGSHA1 "http://www.w3.org/2000/09/xmldsig#sha1"
-
-#define CHAR_FRAGMENT "#"
-#define CHAR_BLANK " "
-
-
+#define TAG_SIGNATURE "Signature"
+#define TAG_SIGNEDINFO "SignedInfo"
+#define TAG_CANONICALIZATIONMETHOD "CanonicalizationMethod"
+#define TAG_SIGNATUREMETHOD "SignatureMethod"
+#define TAG_REFERENCE "Reference"
+#define TAG_TRANSFORMS "Transforms"
+#define TAG_TRANSFORM "Transform"
+#define TAG_DIGESTMETHOD "DigestMethod"
+#define TAG_DIGESTVALUE "DigestValue"
+#define TAG_SIGNATUREVALUE "SignatureValue"
+#define TAG_KEYINFO "KeyInfo"
+#define TAG_X509DATA "X509Data"
+#define TAG_X509ISSUERSERIAL "X509IssuerSerial"
+#define TAG_X509ISSUERNAME "X509IssuerName"
+#define TAG_X509SERIALNUMBER "X509SerialNumber"
+#define TAG_X509CERTIFICATE "X509Certificate"
+#define TAG_OBJECT "Object"
+#define TAG_SIGNATUREPROPERTIES "SignatureProperties"
+#define TAG_SIGNATUREPROPERTY "SignatureProperty"
+#define TAG_TIMESTAMP "timestamp"
+#define TAG_DATE "date"
+//#define TAG_TIME "time"
+
+#define ATTR_XMLNS "xmlns"
+#define ATTR_ALGORITHM "Algorithm"
+#define ATTR_URI "URI"
+#define ATTR_ID "Id"
+#define ATTR_TARGET "Target"
+
+#define NSTAG_DC "dc"
+
+#define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#"
+//#define NS_DATETIME "http://www.ietf.org/rfcXXXX.txt"
+#define NS_DC "http://purl.org/dc/elements/1.1/"
+
+#define ALGO_C14N "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
+#define ALGO_RSASHA1 "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
+#define ALGO_XMLDSIGSHA1 "http://www.w3.org/2000/09/xmldsig#sha1"
+
+#define CHAR_FRAGMENT "#"
+#define CHAR_BLANK " "
+
+
/*
* status of security related components
*/
@@ -129,22 +129,22 @@ class InternalSignatureInformation
{
public:
SignatureInformation signatureInfor;
-
+
com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
+ com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
xReferenceResolvedListener;
-
+
::std::vector< sal_Int32 > vKeeperIds;
-
+
InternalSignatureInformation(
- sal_Int32 nId,
+ sal_Int32 nId,
com::sun::star::uno::Reference< com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
xListener)
:signatureInfor(nId)
{
xReferenceResolvedListener = xListener;
}
-
+
void addReference( sal_Int32 type, rtl::OUString uri, sal_Int32 keeperId )
{
signatureInfor.vSignatureReferenceInfors.push_back(
@@ -155,62 +155,62 @@ public:
typedef ::std::vector< InternalSignatureInformation > InternalSignatureInformations;
-class XSecController : public cppu::WeakImplHelper4
-<
+class XSecController : public cppu::WeakImplHelper4
+<
com::sun::star::xml::crypto::sax::XSecurityController,
//com::sun::star::beans::XFastPropertySet,
com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener,
com::sun::star::xml::crypto::sax::XSignatureCreationResultListener,
- com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
+ com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
>
/****** XSecController.hxx/CLASS XSecController *******************************
*
* NAME
- * XSecController -- the xml security framework controller
+ * XSecController -- the xml security framework controller
*
* FUNCTION
- * Controlls the whole xml security framework to create signatures or to
- * verify signatures.
+ * Controlls the whole xml security framework to create signatures or to
+ * verify signatures.
*
* HISTORY
- * 05.01.2004 - Interface supported: XSecurityController,
- * XFastPropertySet, XSAXEventKeeperStatusChangeListener,
- * XSignatureCreationResultListener,
- * XSignatureVerifyResultListener
+ * 05.01.2004 - Interface supported: XSecurityController,
+ * XFastPropertySet, XSAXEventKeeperStatusChangeListener,
+ * XSignatureCreationResultListener,
+ * XSignatureVerifyResultListener
*
* NOTES
- * The XFastPropertySet interface is used to transfer common values to
- * classes in other module, for instance, the signature id for all
- * sessions is transferred to xmloff module through this interface.
+ * The XFastPropertySet interface is used to transfer common values to
+ * classes in other module, for instance, the signature id for all
+ * sessions is transferred to xmloff module through this interface.
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
friend class XSecParser;
private:
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> mxCtx;
-
+
/*
* used to buffer SAX events
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLDocumentWrapper > m_xXMLDocumentWrapper;
-
+
/*
* the SAX events keeper
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper > m_xSAXEventKeeper;
-
+
/*
* the bridge component which creates/verifies signature
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSignature > m_xXMLSignature;
-
+
/*
* the Security Context
*/
@@ -228,8 +228,8 @@ private:
*/
com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener > m_xSignatureVerifyResultListener;
-#endif
-
+#endif
+
/*
* the security id incrementer, in order to make any security id unique
* to the SAXEventKeeper.
@@ -242,7 +242,7 @@ private:
* Signature information
*/
InternalSignatureInformations m_vInternalSignatureInformations;
-
+
/*
* the previous node on the SAX chain.
* The reason that use a Reference<XInterface> type variable
@@ -250,22 +250,22 @@ private:
* and importing, and there is no other common interface they
* can provided.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::uno::XInterface > m_xPreviousNodeOnSAXChain;
/*
- * whether the preivous node can provide an XInitiazlize interface,
- * use this variable in order to typecast the XInterface to the
+ * whether the preivous node can provide an XInitiazlize interface,
+ * use this variable in order to typecast the XInterface to the
* correct interface type.
*/
bool m_bIsPreviousNodeInitializable;
-
+
/*
* the next node on the SAX chain.
* it can always provide an XDocumentHandler interface.
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler > m_xNextNodeOnSAXChain;
-
+
/*
* the ElementStackKeeper is used to reserve the key SAX events.
* when the SAXEventKeeper is chained on the SAX chain, it need
@@ -282,7 +282,7 @@ private:
* <A>
* <B/>
* <C>
- * <D>
+ * <D>
* <E/>
* </D>
* </C>
@@ -290,7 +290,7 @@ private:
*
* If we consider the SAX event section from startElement(<A>) to
* startElement(<D>), then the key SAX events are:
- *
+ *
* startElement(<A>), startElement(<C>), startElement(<D>)
*
* The startElement(<B>) and endElement(<B>) is ignored, because
@@ -299,38 +299,38 @@ private:
* If we consider the SAX event section from startElement(<D>) to
* endElement(<A>), the key SAX events are:
*
- * startElement(<D>), endElement(<D>), endElement(<C>),
+ * startElement(<D>), endElement(<D>), endElement(<C>),
* endElement(<A>).
- */
- com::sun::star::uno::Reference<
+ */
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XElementStackKeeper > m_xElementStackKeeper;
-
+
/*
* a flag representing whether the SAXEventKeeper is now on the
* SAX chain.
*/
bool m_bIsSAXEventKeeperConnected;
-
+
/*
- * a flag representing whether it is collecting some element,
+ * a flag representing whether it is collecting some element,
* which means that the SAXEventKeeper can't be chained off the
* SAX chain.
*/
bool m_bIsCollectingElement;
-
+
/*
* a flag representing whether the SAX event stream is blocking,
* which also means that the SAXEventKeeper can't be chained off
* the SAX chain.
*/
bool m_bIsBlocking;
-
+
/*
* a flag representing the current status of security related
* components.
*/
sal_Int32 m_nStatusOfSecurityComponents;
-
+
/*
* a flag representing whether the SAXEventKeeper need to be
* on the SAX chain all the time.
@@ -348,12 +348,12 @@ private:
* error message pointer
*/
const char *m_pErrorMessage;
-
+
/*
* the XSecParser which is used to parse the signature stream
*/
XSecParser *m_pXSecParser;
-
+
/*
* the caller assigned signature id for the next signature in the
* signature stream
@@ -364,7 +364,7 @@ private:
* representing whether to verify the current signature
*/
bool m_bVerifyCurrentSignature;
-public:
+public:
/*
* An xUriBinding is provided to map Uris to XInputStream interfaces.
*/
@@ -379,7 +379,7 @@ private:
sal_Bool convertNumber( sal_Int32& rValue, const rtl::OUString& rString, sal_Int32 nMin, sal_Int32 nMax );
void convertDateTime( ::rtl::OUStringBuffer& rBuffer, const com::sun::star::util::DateTime& rDateTime );
sal_Bool convertDateTime( com::sun::star::util::DateTime& rDateTime, const ::rtl::OUString& rString );
-
+
void createXSecComponent( );
int findSignatureInfor( sal_Int32 nSecurityId ) const;
bool chainOn( bool bRetrievingLastEvent );
@@ -389,7 +389,7 @@ private:
com::sun::star::uno::Reference<
com::sun::star::io::XInputStream > getObjectInputStream( const rtl::OUString& objectURL );
-
+
//sal_Int32 getFastPropertyIndex(sal_Int32 nHandle) const;
/*
@@ -399,7 +399,7 @@ private:
com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToWrite(
InternalSignatureInformation& signatureInfo );
-
+
/*
* For signature verification
*/
@@ -409,47 +409,47 @@ private:
const rtl::OUString& ouUri,
bool isBinary );
void setReferenceCount() const;
-
+
void setX509IssuerName( rtl::OUString& ouX509IssuerName );
void setX509SerialNumber( rtl::OUString& ouX509SerialNumber );
void setX509Certificate( rtl::OUString& ouX509Certificate );
void setSignatureValue( rtl::OUString& ouSignatureValue );
void setDigestValue( rtl::OUString& ouDigestValue );
-
+
void setDate( rtl::OUString& ouDate );
void setId( rtl::OUString& ouId );
void setPropertyId( rtl::OUString& ouPropertyId );
-
- com::sun::star::uno::Reference<
+
+ com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToRead(
sal_Int32 nSecurityId );
-
+
public:
XSecController(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxCtx);
~XSecController();
-
+
sal_Int32 getNewSecurityId( );
- void startMission( const com::sun::star::uno::Reference<
+ void startMission( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XUriBinding >& xUriBinding,
const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext >& xSecurityContext );
-
+
void setSAXChainConnector(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::lang::XInitialization >& xInitialization,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XElementStackKeeper >& xElementStackKeeper);
void setSAXChainConnector(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XParser >& xParser,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XElementStackKeeper >& xElementStackKeeper);
void clearSAXChainConnector();
@@ -458,13 +458,13 @@ public:
SignatureInformation getSignatureInformation( sal_Int32 nSecurityId ) const;
SignatureInformations getSignatureInformations() const;
-
+
void exportSignature(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler,
const SignatureInformation& signatureInfo );
-
+
/*
* For signature generation
*/
@@ -495,10 +495,10 @@ public:
const rtl::OUString& ouX509IssuerName,
const rtl::OUString& ouX509SerialNumber,
const rtl::OUString& ouX509Cert);
- // see the other setX509Certifcate function
+ // see the other setX509Certifcate function
void setX509Certificate(
sal_Int32 nSecurityId,
- const sal_Int32 nSecurityEnvironmentIndex,
+ const sal_Int32 nSecurityEnvironmentIndex,
const rtl::OUString& ouX509IssuerName,
const rtl::OUString& ouX509SerialNumber,
const rtl::OUString& ouX509Cert);
@@ -506,12 +506,12 @@ public:
void setDate(
sal_Int32 nSecurityId,
const ::com::sun::star::util::DateTime& rDateTime );
-
-
+
+
bool WriteSignature(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler );
-
+
/*
* For signature verification
*/
@@ -555,7 +555,7 @@ public:
*/
virtual void SAL_CALL blockingStatusChanged( sal_Bool isBlocking )
throw (com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL collectionStatusChanged(
+ virtual void SAL_CALL collectionStatusChanged(
sal_Bool isInsideCollectedElement )
throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL bufferStatusChanged( sal_Bool isBufferEmpty )
@@ -574,7 +574,7 @@ public:
throw (com::sun::star::uno::RuntimeException);
};
-#endif
-
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 8d9b84132712..57b559e691db 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,18 +53,18 @@ rtl::OUString XSecParser::getIdAttr(const cssu::Reference< cssxs::XAttributeList
{
rtl::OUString ouIdAttr = xAttribs->getValueByName(
rtl::OUString(RTL_ASCII_USTRINGPARAM("id")));
-
- if (ouIdAttr == NULL)
+
+ if (ouIdAttr == NULL)
{
ouIdAttr = xAttribs->getValueByName(
rtl::OUString(RTL_ASCII_USTRINGPARAM("Id")));
}
-
+
return ouIdAttr;
}
/*
- * XDocumentHandler
+ * XDocumentHandler
*/
void SAL_CALL XSecParser::startDocument( )
throw (cssxs::SAXException, cssu::RuntimeException)
@@ -76,13 +76,13 @@ void SAL_CALL XSecParser::startDocument( )
m_bInDigestValue = false;
m_bInDate = false;
//m_bInTime = false;
-
+
if (m_xNextHandler.is())
{
m_xNextHandler->startDocument();
}
}
-
+
void SAL_CALL XSecParser::endDocument( )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -104,7 +104,7 @@ void SAL_CALL XSecParser::startElement(
{
m_pXSecController->collectToVerify( ouIdAttr );
}
-
+
if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATURE)) )
{
m_pXSecController->addSignature();
@@ -117,7 +117,7 @@ void SAL_CALL XSecParser::startElement(
{
rtl::OUString ouUri = xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(ATTR_URI)));
DBG_ASSERT( ouUri != NULL, "URI == NULL" );
-
+
if (0 == ouUri.compareTo(rtl::OUString(RTL_ASCII_USTRINGPARAM(CHAR_FRAGMENT)),1))
{
/*
@@ -139,7 +139,7 @@ void SAL_CALL XSecParser::startElement(
if ( m_bReferenceUnresolved )
{
rtl::OUString ouAlgorithm = xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(ATTR_ALGORITHM)));
-
+
if (ouAlgorithm != NULL && ouAlgorithm == rtl::OUString(RTL_ASCII_USTRINGPARAM(ALGO_C14N)))
/*
* a xml stream
@@ -196,7 +196,7 @@ void SAL_CALL XSecParser::startElement(
m_bInTime = true;
}
*/
-
+
if (m_xNextHandler.is())
{
m_xNextHandler->startElement(aName, xAttribs);
@@ -217,11 +217,11 @@ void SAL_CALL XSecParser::startElement(
cssu::Any());
}
}
-
-void SAL_CALL XSecParser::endElement( const rtl::OUString& aName )
+
+void SAL_CALL XSecParser::endElement( const rtl::OUString& aName )
throw (cssxs::SAXException, cssu::RuntimeException)
{
- try
+ try
{
if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE)))
{
@@ -237,7 +237,7 @@ void SAL_CALL XSecParser::endElement( const rtl::OUString& aName )
m_pXSecController->addStreamReference( m_currentReferenceURI, sal_True);
m_bReferenceUnresolved = false;
}
-
+
m_pXSecController->setDigestValue( m_ouDigestValue );
}
else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNEDINFO)) )
@@ -299,7 +299,7 @@ void SAL_CALL XSecParser::endElement( const rtl::OUString& aName )
cssu::Any());
}
}
-
+
void SAL_CALL XSecParser::characters( const rtl::OUString& aChars )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -331,15 +331,15 @@ void SAL_CALL XSecParser::characters( const rtl::OUString& aChars )
else if (m_bInTime)
{
m_ouTime += aChars;
- }
+ }
*/
-
+
if (m_xNextHandler.is())
{
m_xNextHandler->characters(aChars);
}
}
-
+
void SAL_CALL XSecParser::ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -348,7 +348,7 @@ void SAL_CALL XSecParser::ignorableWhitespace( const rtl::OUString& aWhitespaces
m_xNextHandler->ignorableWhitespace( aWhitespaces );
}
}
-
+
void SAL_CALL XSecParser::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -357,7 +357,7 @@ void SAL_CALL XSecParser::processingInstruction( const rtl::OUString& aTarget, c
m_xNextHandler->processingInstruction(aTarget, aData);
}
}
-
+
void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator )
throw (cssxs::SAXException, cssu::RuntimeException)
{
diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx
index 3cfb033be534..931f098ae5b9 100644
--- a/xmlsecurity/source/helper/xsecparser.hxx
+++ b/xmlsecurity/source/helper/xsecparser.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,30 +38,30 @@
#include <cppuhelper/implbase2.hxx>
-class XSecParser: public cppu::WeakImplHelper2
-<
+class XSecParser: public cppu::WeakImplHelper2
+<
com::sun::star::xml::sax::XDocumentHandler,
com::sun::star::lang::XInitialization
>
/****** XSecController.hxx/CLASS XSecParser ***********************************
*
* NAME
- * XSecParser -- a SAX parser that can detect security elements
+ * XSecParser -- a SAX parser that can detect security elements
*
* FUNCTION
- * The XSecParser object is connected on the SAX chain and detects
- * security elements in the SAX event stream, then notifies
- * the XSecController.
+ * The XSecParser object is connected on the SAX chain and detects
+ * security elements in the SAX event stream, then notifies
+ * the XSecController.
*
* HISTORY
- * 05.01.2004 - Interface supported: XDocumentHandler, XInitialization
+ * 05.01.2004 - Interface supported: XDocumentHandler, XInitialization
*
* NOTES
- * This class is used when importing a document.
+ * This class is used when importing a document.
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
friend class XSecController;
@@ -88,16 +88,16 @@ private:
bool m_bInSignatureValue;
bool m_bInDate;
//bool m_bInTime;
-
+
/*
* the XSecController collaborating with XSecParser
*/
XSecController* m_pXSecController;
-
+
/*
* the next XDocumentHandler on the SAX chain
*/
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler;
/*
@@ -108,61 +108,61 @@ private:
* URI when the startElement event is met.
*/
rtl::OUString m_currentReferenceURI;
- bool m_bReferenceUnresolved;
+ bool m_bReferenceUnresolved;
private:
rtl::OUString getIdAttr(const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XAttributeList >& xAttribs );
-
+
public:
- XSecParser( XSecController* pXSecController,
+ XSecParser( XSecController* pXSecController,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xNextHandler );
~XSecParser(){};
-
+
/*
- * XDocumentHandler
+ * XDocumentHandler
*/
virtual void SAL_CALL startDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL endDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL startElement(
- const rtl::OUString& aName,
+ const rtl::OUString& aName,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XAttributeList >& xAttribs )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL endElement( const rtl::OUString& aName )
+
+ virtual void SAL_CALL endElement( const rtl::OUString& aName )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL characters( const rtl::OUString& aChars )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL processingInstruction(
const rtl::OUString& aTarget,
const rtl::OUString& aData )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setDocumentLocator(
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XLocator >& xLocator )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
/*
- * XInitialization
+ * XInitialization
*/
virtual void SAL_CALL initialize(
const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
};
-
-#endif
-
+
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index c40492c41991..33ed8c2fa0e2 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -56,14 +56,14 @@ rtl::OUString XSecController::createId()
{
cssu::Sequence< sal_Int8 > aSeq( 16 );
rtl_createUuid ((sal_uInt8 *)aSeq.getArray(), 0, sal_True);
-
+
char str[68]="ID_";
int length = 3;
for (int i=0; i<16; ++i)
{
length += sprintf(str+length, "%04x", (unsigned char)aSeq[i]);
}
-
+
return rtl::OUString::createFromAscii(str);
}
@@ -72,11 +72,11 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
{
sal_Int32 nSecurityId = internalSignatureInfor.signatureInfor.nSecurityId;
SignatureReferenceInformations& vReferenceInfors = internalSignatureInfor.signatureInfor.vSignatureReferenceInfors;
-
+
sal_Int32 nIdOfSignatureElementCollector;
cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
- nIdOfSignatureElementCollector =
+ nIdOfSignatureElementCollector =
m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_AFTERMODIFY, sal_True );
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
@@ -89,14 +89,14 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
xMCF->createInstanceWithContext(
rtl::OUString::createFromAscii(SIGNATURECREATOR_COMPONENT), mxCtx),
cssu::UNO_QUERY);
-
+
cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);
cssu::Sequence<cssu::Any> args(5);
args[0] = cssu::makeAny(rtl::OUString::valueOf(nSecurityId));
args[1] = cssu::makeAny(m_xSAXEventKeeper);
args[2] = cssu::makeAny(rtl::OUString::valueOf(nIdOfSignatureElementCollector));
-
+
//i39448 : for nss, the internal module is used for signing, which needs to be improved later
sal_Int32 nEnvIndex = internalSignatureInfor.signatureInfor.nSecurityEnvironmentIndex;
if( nEnvIndex < 0 || nEnvIndex >= m_xSecurityContext->getSecurityEnvironmentNumber())
@@ -107,41 +107,41 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
{
args[3] = cssu::makeAny(m_xSecurityContext->getSecurityEnvironmentByIndex(nEnvIndex));
}
-
+
args[4] = cssu::makeAny(m_xXMLSignature);
xInitialization->initialize(args);
-
+
sal_Int32 nBlockerId = m_xSAXEventKeeper->addBlocker();
m_xSAXEventKeeper->setSecurityId(nBlockerId, nSecurityId);
-
+
cssu::Reference<cssxc::sax::XBlockerMonitor> xBlockerMonitor(xReferenceResolvedListener, cssu::UNO_QUERY);
xBlockerMonitor->setBlockerId(nBlockerId);
cssu::Reference< cssxc::sax::XSignatureCreationResultBroadcaster >
xSignatureCreationResultBroadcaster(xReferenceResolvedListener, cssu::UNO_QUERY);
-
+
xSignatureCreationResultBroadcaster->addSignatureCreationResultListener( this );
-
- cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster>
- xReferenceResolvedBroadcaster
+
+ cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster>
+ xReferenceResolvedBroadcaster
(m_xSAXEventKeeper,
cssu::UNO_QUERY);
-
+
xReferenceResolvedBroadcaster->addReferenceResolvedListener(
nIdOfSignatureElementCollector,
xReferenceResolvedListener);
-
+
cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
(xReferenceResolvedListener, cssu::UNO_QUERY);
-
+
int i;
int size = vReferenceInfors.size();
sal_Int32 nReferenceCount = 0;
-
+
for(i=0; i<size; ++i)
{
sal_Int32 keeperId = internalSignatureInfor.vKeeperIds[i];
-
+
if ( keeperId != -1)
{
m_xSAXEventKeeper->setSecurityId(keeperId, nSecurityId);
@@ -150,19 +150,19 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
nReferenceCount++;
}
}
-
+
xReferenceCollector->setReferenceCount( nReferenceCount );
-
+
/*
* adds all URI binding
*/
cssu::Reference<cssxc::XUriBinding> xUriBinding
(xReferenceResolvedListener, cssu::UNO_QUERY);
-
+
for(i=0; i<size; ++i)
{
const SignatureReferenceInformation& refInfor = vReferenceInfors[i];
-
+
cssu::Reference< com::sun::star::io::XInputStream > xInputStream
= getObjectInputStream( refInfor.ouURI );
@@ -171,15 +171,15 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
xUriBinding->setUriBinding(refInfor.ouURI,xInputStream);
}
}
-
+
cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, cssu::UNO_QUERY);
keyCollector->setKeyId(0);
-
+
internalSignatureInfor.signatureInfor.ouSignatureId = createId();
internalSignatureInfor.signatureInfor.ouPropertyId = createId();
internalSignatureInfor.addReference(TYPE_SAMEDOCUMENT_REFERENCE, internalSignatureInfor.signatureInfor.ouPropertyId, -1 );
size++;
-
+
/*
* replace both digestValues and signatueValue to " "
*/
@@ -190,7 +190,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
}
internalSignatureInfor.signatureInfor.ouSignatureValue = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_BLANK));
-
+
return xReferenceResolvedListener;
}
@@ -198,9 +198,9 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
void XSecController::collectToSign( sal_Int32 securityId, const rtl::OUString& referenceId )
{
/* DBG_ASSERT( m_xSAXEventKeeper.is(), "the SAXEventKeeper is NULL" ); */
-
+
chainOn(true);
-
+
if ( m_nStatusOfSecurityComponents == INITIALIZED )
/*
* if all security components are ready, add a signature.
@@ -208,9 +208,9 @@ void XSecController::collectToSign( sal_Int32 securityId, const rtl::OUString& r
{
sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
cssxc::sax::ElementMarkPriority_AFTERMODIFY, sal_False);
-
+
int index = findSignatureInfor( securityId );
-
+
if ( index == -1 )
{
InternalSignatureInformation isi(securityId, NULL);
@@ -227,9 +227,9 @@ void XSecController::collectToSign( sal_Int32 securityId, const rtl::OUString& r
void XSecController::signAStream( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& /*objectURL*/, sal_Bool isBinary)
{
sal_Int32 type = ((isBinary==sal_True)?TYPE_BINARYSTREAM_REFERENCE:TYPE_XMLSTREAM_REFERENCE);
-
+
int index = findSignatureInfor( securityId );
-
+
if (index == -1)
{
InternalSignatureInformation isi(securityId, NULL);
@@ -253,7 +253,7 @@ void XSecController::setX509Certificate(
void XSecController::setX509Certificate(
sal_Int32 nSecurityId,
- const sal_Int32 nSecurityEnvironmentIndex,
+ const sal_Int32 nSecurityEnvironmentIndex,
const rtl::OUString& ouX509IssuerName,
const rtl::OUString& ouX509SerialNumber,
const rtl::OUString& ouX509Cert)
@@ -304,14 +304,14 @@ bool XSecController::WriteSignature(
const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler )
{
bool rc = false;
-
+
DBG_ASSERT( xDocumentHandler.is(), "I really need a document handler!" );
-
+
/*
- * chain the SAXEventKeeper to the SAX chain
+ * chain the SAXEventKeeper to the SAX chain
*/
chainOn(true);
-
+
if ( m_nStatusOfSecurityComponents == INITIALIZED )
/*
* if all security components are ready, add the signature
@@ -320,33 +320,33 @@ bool XSecController::WriteSignature(
{
m_bIsSAXEventKeeperSticky = true;
m_xSAXEventKeeper->setNextHandler(xDocumentHandler);
-
+
try
{
/*
- * export the signature template
+ * export the signature template
*/
cssu::Reference<cssxs::XDocumentHandler> xSEKHandler( m_xSAXEventKeeper,cssu::UNO_QUERY);
-
+
int i;
int sigNum = m_vInternalSignatureInformations.size();
-
+
for (i=0; i<sigNum; ++i)
{
InternalSignatureInformation &isi = m_vInternalSignatureInformations[i];
-
+
/*
* prepare the signature creator
*/
- isi.xReferenceResolvedListener
+ isi.xReferenceResolvedListener
= prepareSignatureToWrite( isi );
-
+
exportSignature( xSEKHandler, isi.signatureInfor );
}
-
+
m_bIsSAXEventKeeperSticky = false;
chainOff();
-
+
rc = true;
}
catch( cssxs::SAXException& )
@@ -361,7 +361,7 @@ bool XSecController::WriteSignature(
{
m_pErrorMessage = ERROR_EXCEPTIONDURINGCREATION;
}
-
+
m_xSAXEventKeeper->setNextHandler( NULL );
m_bIsSAXEventKeeperSticky = false;
}
@@ -369,7 +369,7 @@ bool XSecController::WriteSignature(
{
m_pErrorMessage = ERROR_CANNOTCREATEXMLSECURITYCOMPONENT;
}
-
+
return rc;
}
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 8f903dd2053d..000f0d40f523 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -60,11 +60,11 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
sal_Int32 nIdOfSignatureElementCollector;
cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
- nIdOfSignatureElementCollector =
+ nIdOfSignatureElementCollector =
m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_BEFOREMODIFY, sal_False);
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
-
+
/*
* create a SignatureVerifier
*/
@@ -73,9 +73,9 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
xMCF->createInstanceWithContext(
rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT ), mxCtx),
cssu::UNO_QUERY);
-
+
cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);
-
+
cssu::Sequence<cssu::Any> args(5);
args[0] = cssu::makeAny(rtl::OUString::valueOf(nSecurityId));
args[1] = cssu::makeAny(m_xSAXEventKeeper);
@@ -83,23 +83,23 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
args[3] = cssu::makeAny(m_xSecurityContext);
args[4] = cssu::makeAny(m_xXMLSignature);
xInitialization->initialize(args);
-
+
cssu::Reference< cssxc::sax::XSignatureVerifyResultBroadcaster >
signatureVerifyResultBroadcaster(xReferenceResolvedListener, cssu::UNO_QUERY);
-
+
signatureVerifyResultBroadcaster->addSignatureVerifyResultListener( this );
- cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster
+ cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster
(m_xSAXEventKeeper,
cssu::UNO_QUERY);
-
+
xReferenceResolvedBroadcaster->addReferenceResolvedListener(
nIdOfSignatureElementCollector,
xReferenceResolvedListener);
-
+
cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, cssu::UNO_QUERY);
keyCollector->setKeyId(0);
-
+
return xReferenceResolvedListener;
}
@@ -107,8 +107,8 @@ void XSecController::addSignature()
{
cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener = NULL;
sal_Int32 nSignatureId = 0;
-
-
+
+
if (m_bVerifyCurrentSignature)
{
chainOn(true);
@@ -116,7 +116,7 @@ void XSecController::addSignature()
m_bVerifyCurrentSignature = false;
nSignatureId = m_nReservedSignatureId;
}
-
+
InternalSignatureInformation isi( nSignatureId, xReferenceResolvedListener );
m_vInternalSignatureInformations.push_back( isi );
}
@@ -127,7 +127,7 @@ void XSecController::addReference( const rtl::OUString& ouUri)
isi.addReference(TYPE_SAMEDOCUMENT_REFERENCE,ouUri, -1 );
}
-void XSecController::addStreamReference(
+void XSecController::addStreamReference(
const rtl::OUString& ouUri,
bool isBinary )
{
@@ -142,7 +142,7 @@ void XSecController::addStreamReference(
*/
cssu::Reference< com::sun::star::io::XInputStream > xObjectInputStream
= getObjectInputStream( ouUri );
-
+
if ( xObjectInputStream.is() )
{
cssu::Reference<cssxc::XUriBinding> xUriBinding
@@ -150,21 +150,21 @@ void XSecController::addStreamReference(
xUriBinding->setUriBinding(ouUri, xObjectInputStream);
}
}
-
+
isi.addReference(type, ouUri, -1);
}
void XSecController::setReferenceCount() const
{
const InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1];
-
+
if ( isi.xReferenceResolvedListener.is() )
{
const SignatureReferenceInformations &refInfors = isi.signatureInfor.vSignatureReferenceInfors;
-
+
int refNum = refInfors.size();
sal_Int32 referenceCount = 0;
-
+
for(int i=0 ; i<refNum; ++i)
{
if (refInfors[i].nType == TYPE_SAMEDOCUMENT_REFERENCE )
@@ -175,7 +175,7 @@ void XSecController::setReferenceCount() const
referenceCount++;
}
}
-
+
cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
(isi.xReferenceResolvedListener, cssu::UNO_QUERY);
xReferenceCollector->setReferenceCount( referenceCount );
@@ -244,7 +244,7 @@ void XSecController::setPropertyId( rtl::OUString& ouPropertyId )
void XSecController::collectToVerify( const rtl::OUString& referenceId )
{
/* DBG_ASSERT( m_xSAXEventKeeper.is(), "the SAXEventKeeper is NULL" ); */
-
+
if ( m_nStatusOfSecurityComponents == INITIALIZED )
/*
* if all security components are ready, verify the signature.
@@ -252,20 +252,20 @@ void XSecController::collectToVerify( const rtl::OUString& referenceId )
{
bool bJustChainingOn = false;
cssu::Reference< cssxs::XDocumentHandler > xHandler = NULL;
-
+
int i,j;
int sigNum = m_vInternalSignatureInformations.size();
-
+
for (i=0; i<sigNum; ++i)
{
InternalSignatureInformation& isi = m_vInternalSignatureInformations[i];
SignatureReferenceInformations& vReferenceInfors = isi.signatureInfor.vSignatureReferenceInfors;
int refNum = vReferenceInfors.size();
-
+
for (j=0; j<refNum; ++j)
{
SignatureReferenceInformation &refInfor = vReferenceInfors[j];
-
+
if (refInfor.ouURI == referenceId)
{
if (chainOn(false))
@@ -273,27 +273,27 @@ void XSecController::collectToVerify( const rtl::OUString& referenceId )
bJustChainingOn = true;
xHandler = m_xSAXEventKeeper->setNextHandler(NULL);
}
-
+
sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
cssxc::sax::ElementMarkPriority_BEFOREMODIFY, sal_False );
-
- cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster
+
+ cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster
(m_xSAXEventKeeper,
cssu::UNO_QUERY );
-
+
cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
( isi.xReferenceResolvedListener, cssu::UNO_QUERY );
-
+
m_xSAXEventKeeper->setSecurityId(nKeeperId, isi.signatureInfor.nSecurityId);
xReferenceResolvedBroadcaster->addReferenceResolvedListener( nKeeperId, isi.xReferenceResolvedListener);
xReferenceCollector->setReferenceId( nKeeperId );
-
+
isi.vKeeperIds[j] = nKeeperId;
break;
}
}
}
-
+
if ( bJustChainingOn )
{
cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(m_xSAXEventKeeper, cssu::UNO_QUERY);
@@ -309,7 +309,7 @@ void XSecController::collectToVerify( const rtl::OUString& referenceId )
void XSecController::addSignature( sal_Int32 nSignatureId )
{
DBG_ASSERT( m_pXSecParser != NULL, "No XSecParser initialized" );
-
+
m_nReservedSignatureId = nSignatureId;
m_bVerifyCurrentSignature = true;
}
@@ -318,12 +318,12 @@ cssu::Reference< cssxs::XDocumentHandler > XSecController::createSignatureReader
{
m_pXSecParser = new XSecParser( this, NULL );
cssu::Reference< cssl::XInitialization > xInitialization = m_pXSecParser;
-
+
setSAXChainConnector(xInitialization, NULL, NULL);
-
+
return m_pXSecParser;
}
-
+
void XSecController::releaseSignatureReader()
{
clearSAXChainConnector( );
diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx
index 100708938cdb..c79e9af5ca3c 100644
--- a/xmlsecurity/source/xmlsec/biginteger.cxx
+++ b/xmlsecurity/source/xmlsec/biginteger.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,9 +43,9 @@
using namespace ::com::sun::star::uno ;
using ::rtl::OUString ;
-Sequence< sal_Int8 > numericStringToBigInteger ( OUString numeral )
+Sequence< sal_Int8 > numericStringToBigInteger ( OUString numeral )
{
- if( numeral.getStr() != NULL )
+ if( numeral.getStr() != NULL )
{
xmlChar* chNumeral ;
const xmlSecByte* bnInteger ;
@@ -94,7 +94,7 @@ Sequence< sal_Int8 > numericStringToBigInteger ( OUString numeral )
return Sequence< sal_Int8 >();
}
-OUString bigIntegerToNumericString ( Sequence< sal_Int8 > integer )
+OUString bigIntegerToNumericString ( Sequence< sal_Int8 > integer )
{
OUString aRet ;
diff --git a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx
index c7e3c0fa61be..efc10fa01e07 100644
--- a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx
index bbfecbbcd760..13524621fe65 100644
--- a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx
+++ b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,6 +62,6 @@ class CertificateExtension_XmlSecImpl : public ::cppu::WeakImplHelper1<
void setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, sal_Bool critical ) ;
} ;
-#endif // _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_
+#endif // _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/certvalidity.cxx b/xmlsecurity/source/xmlsec/certvalidity.cxx
index b487c7e67a69..2ce5c14e21ed 100644
--- a/xmlsecurity/source/xmlsec/certvalidity.cxx
+++ b/xmlsecurity/source/xmlsec/certvalidity.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -65,7 +65,7 @@ rtl::OUString certificateValidityToOUString( ::sal_Int32 certValidity ) {
} else if( ( certValidity & CertificateValidity::TIME_INVALID ) == CertificateValidity::TIME_INVALID ) {
aValidity = OUString::createFromAscii( ( const char* )TIME_INVALID_STR ) ;
} else if( ( certValidity & CertificateValidity::NOT_TIME_NESTED ) == CertificateValidity::NOT_TIME_NESTED ) {
- aValidity = OUString::createFromAscii( ( const char* )NOT_NESTED_TIME_STR ) ;
+ aValidity = OUString::createFromAscii( ( const char* )NOT_NESTED_TIME_STR ) ;
} else if( ( certValidity & CertificateValidity::REVOKED ) == CertificateValidity::REVOKED ) {
aValidity = OUString::createFromAscii( ( const char* )REVOKED_STR ) ;
} else if( ( certValidity & CertificateValidity::UNKNOWN_REVOKATION ) == CertificateValidity::UNKNOWN_REVOKATION ) {
diff --git a/xmlsecurity/source/xmlsec/diagnose.cxx b/xmlsecurity/source/xmlsec/diagnose.cxx
index 683884eeb32e..19763bb6064b 100644
--- a/xmlsecurity/source/xmlsec/diagnose.cxx
+++ b/xmlsecurity/source/xmlsec/diagnose.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -56,7 +56,7 @@ struct UseDiagnose : public rtl::StaticWithInit<
void xmlsec_trace(const char* pszFormat, ...)
{
bool bDebug = false;
-
+
#if OSL_DEBUG_LEVEL > 1
bDebug = true;
#endif
@@ -67,7 +67,7 @@ void xmlsec_trace(const char* pszFormat, ...)
va_start(args, pszFormat);
vfprintf(stderr, pszFormat, args);
va_end(args);
-
+
fprintf(stderr,"\n");
fflush(stderr);
}
diff --git a/xmlsecurity/source/xmlsec/diagnose.hxx b/xmlsecurity/source/xmlsec/diagnose.hxx
index e59e24d42068..9c18b19b26b2 100644
--- a/xmlsecurity/source/xmlsec/diagnose.hxx
+++ b/xmlsecurity/source/xmlsec/diagnose.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx
index a533c1291c12..9ec99686dc12 100644
--- a/xmlsecurity/source/xmlsec/errorcallback.cxx
+++ b/xmlsecurity/source/xmlsec/errorcallback.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,105 +49,105 @@ using namespace ::com::sun::star::xml::crypto;
// SecurityOperationStatus getOperationStatus(int reason)
// {
-// switch (reason)
-// {
-// case XMLSEC_ERRORS_R_XMLSEC_FAILED:
-// return SecurityOperationStatus_ENGINE_FAILED;
-// case XMLSEC_ERRORS_R_MALLOC_FAILED:
-// return SecurityOperationStatus_MALLOC_FAILED;
-// case XMLSEC_ERRORS_R_STRDUP_FAILED:
-// return SecurityOperationStatus_STRDUP_FAILED;
-// case XMLSEC_ERRORS_R_CRYPTO_FAILED:
-// return SecurityOperationStatus_CRYPTO_FAILED;
-// case XMLSEC_ERRORS_R_XML_FAILED:
-// return SecurityOperationStatus_XML_FAILED;
-// case XMLSEC_ERRORS_R_XSLT_FAILED:
-// return SecurityOperationStatus_XSLT_FAILED;
-// case XMLSEC_ERRORS_R_IO_FAILED:
-// return SecurityOperationStatus_IO_FAILED;
-// case XMLSEC_ERRORS_R_DISABLED:
-// return SecurityOperationStatus_DISABLED;
-// case XMLSEC_ERRORS_R_NOT_IMPLEMENTED:
-// return SecurityOperationStatus_NOT_IMPLEMENTED;
-// case XMLSEC_ERRORS_R_INVALID_SIZE:
-// return SecurityOperationStatus_INVALID_SIZE;
-// case XMLSEC_ERRORS_R_INVALID_DATA:
-// return SecurityOperationStatus_INVALID_DATA;
-// case XMLSEC_ERRORS_R_INVALID_RESULT:
-// return SecurityOperationStatus_INVALID_RESULT;
-// case XMLSEC_ERRORS_R_INVALID_TYPE:
-// return SecurityOperationStatus_INVALID_TYPE;
-// case XMLSEC_ERRORS_R_INVALID_OPERATION:
-// return SecurityOperationStatus_INVALID_OPERATION;
-// case XMLSEC_ERRORS_R_INVALID_STATUS:
-// return SecurityOperationStatus_INVALID_STATUS;
-// case XMLSEC_ERRORS_R_INVALID_FORMAT:
-// return SecurityOperationStatus_INVALID_FORMAT;
-// case XMLSEC_ERRORS_R_DATA_NOT_MATCH:
-// return SecurityOperationStatus_DATA_NOT_MATCH;
-// case XMLSEC_ERRORS_R_INVALID_NODE:
-// return SecurityOperationStatus_INVALID_NODE;
-// case XMLSEC_ERRORS_R_INVALID_NODE_CONTENT:
-// return SecurityOperationStatus_INVALID_NODE_CONTENT;
-// case XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE:
-// return SecurityOperationStatus_INVALID_NODE_ATTRIBUTE;
-// case XMLSEC_ERRORS_R_MISSING_NODE_ATTRIBUTE:
-// return SecurityOperationStatus_MISSING_NODE_ATTRIBUTE;
-// case XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT:
-// return SecurityOperationStatus_NODE_ALREADY_PRESENT;
-// case XMLSEC_ERRORS_R_UNEXPECTED_NODE:
-// return SecurityOperationStatus_UNEXPECTED_NODE;
-// case XMLSEC_ERRORS_R_NODE_NOT_FOUND:
-// return SecurityOperationStatus_NODE_NOT_FOUND;
-// case XMLSEC_ERRORS_R_INVALID_TRANSFORM:
-// return SecurityOperationStatus_INVALID_TRANSFORM;
-// case XMLSEC_ERRORS_R_INVALID_TRANSFORM_KEY:
-// return SecurityOperationStatus_INVALID_TRANSFORM_KEY;
-// case XMLSEC_ERRORS_R_INVALID_URI_TYPE:
-// return SecurityOperationStatus_INVALID_URI_TYPE;
-// case XMLSEC_ERRORS_R_TRANSFORM_SAME_DOCUMENT_REQUIRED:
-// return SecurityOperationStatus_TRANSFORM_SAME_DOCUMENT_REQUIRED;
-// case XMLSEC_ERRORS_R_TRANSFORM_DISABLED:
-// return SecurityOperationStatus_TRANSFORM_DISABLED;
-// case XMLSEC_ERRORS_R_INVALID_KEY_DATA:
-// return SecurityOperationStatus_INVALID_KEY_DATA;
-// case XMLSEC_ERRORS_R_KEY_DATA_NOT_FOUND:
-// return SecurityOperationStatus_KEY_DATA_NOT_FOUND;
-// case XMLSEC_ERRORS_R_KEY_DATA_ALREADY_EXIST:
-// return SecurityOperationStatus_KEY_DATA_ALREADY_EXIST;
-// case XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE:
-// return SecurityOperationStatus_INVALID_KEY_DATA_SIZE;
-// case XMLSEC_ERRORS_R_KEY_NOT_FOUND:
-// return SecurityOperationStatus_KEY_NOT_FOUND;
-// case XMLSEC_ERRORS_R_KEYDATA_DISABLED:
-// return SecurityOperationStatus_KEYDATA_DISABLED;
-// case XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL:
-// return SecurityOperationStatus_MAX_RETRIEVALS_LEVEL;
-// case XMLSEC_ERRORS_R_MAX_RETRIEVAL_TYPE_MISMATCH:
-// return SecurityOperationStatus_MAX_RETRIEVAL_TYPE_MISMATCH;
-// case XMLSEC_ERRORS_R_MAX_ENCKEY_LEVEL:
-// return SecurityOperationStatus_MAX_ENCKEY_LEVEL;
-// case XMLSEC_ERRORS_R_CERT_VERIFY_FAILED:
-// return SecurityOperationStatus_CERT_VERIFY_FAILED;
-// case XMLSEC_ERRORS_R_CERT_NOT_FOUND:
-// return SecurityOperationStatus_CERT_NOT_FOUND;
-// case XMLSEC_ERRORS_R_CERT_REVOKED:
-// return SecurityOperationStatus_CERT_REVOKED;
-// case XMLSEC_ERRORS_R_CERT_ISSUER_FAILED:
-// return SecurityOperationStatus_CERT_ISSUER_FAILED;
-// case XMLSEC_ERRORS_R_CERT_NOT_YET_VALID:
-// return SecurityOperationStatus_CERT_NOT_YET_VALID;
-// case XMLSEC_ERRORS_R_CERT_HAS_EXPIRED:
-// return SecurityOperationStatus_CERT_HAS_EXPIRED;
-// case XMLSEC_ERRORS_R_DSIG_NO_REFERENCES:
-// return SecurityOperationStatus_DSIG_NO_REFERENCES;
-// case XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE:
-// return SecurityOperationStatus_DSIG_INVALID_REFERENCE;
-// case XMLSEC_ERRORS_R_ASSERTION:
-// return SecurityOperationStatus_ASSERTION;
-// default:
-// return SecurityOperationStatus_RUNTIMEERROR_FAILED;
-// }
+// switch (reason)
+// {
+// case XMLSEC_ERRORS_R_XMLSEC_FAILED:
+// return SecurityOperationStatus_ENGINE_FAILED;
+// case XMLSEC_ERRORS_R_MALLOC_FAILED:
+// return SecurityOperationStatus_MALLOC_FAILED;
+// case XMLSEC_ERRORS_R_STRDUP_FAILED:
+// return SecurityOperationStatus_STRDUP_FAILED;
+// case XMLSEC_ERRORS_R_CRYPTO_FAILED:
+// return SecurityOperationStatus_CRYPTO_FAILED;
+// case XMLSEC_ERRORS_R_XML_FAILED:
+// return SecurityOperationStatus_XML_FAILED;
+// case XMLSEC_ERRORS_R_XSLT_FAILED:
+// return SecurityOperationStatus_XSLT_FAILED;
+// case XMLSEC_ERRORS_R_IO_FAILED:
+// return SecurityOperationStatus_IO_FAILED;
+// case XMLSEC_ERRORS_R_DISABLED:
+// return SecurityOperationStatus_DISABLED;
+// case XMLSEC_ERRORS_R_NOT_IMPLEMENTED:
+// return SecurityOperationStatus_NOT_IMPLEMENTED;
+// case XMLSEC_ERRORS_R_INVALID_SIZE:
+// return SecurityOperationStatus_INVALID_SIZE;
+// case XMLSEC_ERRORS_R_INVALID_DATA:
+// return SecurityOperationStatus_INVALID_DATA;
+// case XMLSEC_ERRORS_R_INVALID_RESULT:
+// return SecurityOperationStatus_INVALID_RESULT;
+// case XMLSEC_ERRORS_R_INVALID_TYPE:
+// return SecurityOperationStatus_INVALID_TYPE;
+// case XMLSEC_ERRORS_R_INVALID_OPERATION:
+// return SecurityOperationStatus_INVALID_OPERATION;
+// case XMLSEC_ERRORS_R_INVALID_STATUS:
+// return SecurityOperationStatus_INVALID_STATUS;
+// case XMLSEC_ERRORS_R_INVALID_FORMAT:
+// return SecurityOperationStatus_INVALID_FORMAT;
+// case XMLSEC_ERRORS_R_DATA_NOT_MATCH:
+// return SecurityOperationStatus_DATA_NOT_MATCH;
+// case XMLSEC_ERRORS_R_INVALID_NODE:
+// return SecurityOperationStatus_INVALID_NODE;
+// case XMLSEC_ERRORS_R_INVALID_NODE_CONTENT:
+// return SecurityOperationStatus_INVALID_NODE_CONTENT;
+// case XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE:
+// return SecurityOperationStatus_INVALID_NODE_ATTRIBUTE;
+// case XMLSEC_ERRORS_R_MISSING_NODE_ATTRIBUTE:
+// return SecurityOperationStatus_MISSING_NODE_ATTRIBUTE;
+// case XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT:
+// return SecurityOperationStatus_NODE_ALREADY_PRESENT;
+// case XMLSEC_ERRORS_R_UNEXPECTED_NODE:
+// return SecurityOperationStatus_UNEXPECTED_NODE;
+// case XMLSEC_ERRORS_R_NODE_NOT_FOUND:
+// return SecurityOperationStatus_NODE_NOT_FOUND;
+// case XMLSEC_ERRORS_R_INVALID_TRANSFORM:
+// return SecurityOperationStatus_INVALID_TRANSFORM;
+// case XMLSEC_ERRORS_R_INVALID_TRANSFORM_KEY:
+// return SecurityOperationStatus_INVALID_TRANSFORM_KEY;
+// case XMLSEC_ERRORS_R_INVALID_URI_TYPE:
+// return SecurityOperationStatus_INVALID_URI_TYPE;
+// case XMLSEC_ERRORS_R_TRANSFORM_SAME_DOCUMENT_REQUIRED:
+// return SecurityOperationStatus_TRANSFORM_SAME_DOCUMENT_REQUIRED;
+// case XMLSEC_ERRORS_R_TRANSFORM_DISABLED:
+// return SecurityOperationStatus_TRANSFORM_DISABLED;
+// case XMLSEC_ERRORS_R_INVALID_KEY_DATA:
+// return SecurityOperationStatus_INVALID_KEY_DATA;
+// case XMLSEC_ERRORS_R_KEY_DATA_NOT_FOUND:
+// return SecurityOperationStatus_KEY_DATA_NOT_FOUND;
+// case XMLSEC_ERRORS_R_KEY_DATA_ALREADY_EXIST:
+// return SecurityOperationStatus_KEY_DATA_ALREADY_EXIST;
+// case XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE:
+// return SecurityOperationStatus_INVALID_KEY_DATA_SIZE;
+// case XMLSEC_ERRORS_R_KEY_NOT_FOUND:
+// return SecurityOperationStatus_KEY_NOT_FOUND;
+// case XMLSEC_ERRORS_R_KEYDATA_DISABLED:
+// return SecurityOperationStatus_KEYDATA_DISABLED;
+// case XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL:
+// return SecurityOperationStatus_MAX_RETRIEVALS_LEVEL;
+// case XMLSEC_ERRORS_R_MAX_RETRIEVAL_TYPE_MISMATCH:
+// return SecurityOperationStatus_MAX_RETRIEVAL_TYPE_MISMATCH;
+// case XMLSEC_ERRORS_R_MAX_ENCKEY_LEVEL:
+// return SecurityOperationStatus_MAX_ENCKEY_LEVEL;
+// case XMLSEC_ERRORS_R_CERT_VERIFY_FAILED:
+// return SecurityOperationStatus_CERT_VERIFY_FAILED;
+// case XMLSEC_ERRORS_R_CERT_NOT_FOUND:
+// return SecurityOperationStatus_CERT_NOT_FOUND;
+// case XMLSEC_ERRORS_R_CERT_REVOKED:
+// return SecurityOperationStatus_CERT_REVOKED;
+// case XMLSEC_ERRORS_R_CERT_ISSUER_FAILED:
+// return SecurityOperationStatus_CERT_ISSUER_FAILED;
+// case XMLSEC_ERRORS_R_CERT_NOT_YET_VALID:
+// return SecurityOperationStatus_CERT_NOT_YET_VALID;
+// case XMLSEC_ERRORS_R_CERT_HAS_EXPIRED:
+// return SecurityOperationStatus_CERT_HAS_EXPIRED;
+// case XMLSEC_ERRORS_R_DSIG_NO_REFERENCES:
+// return SecurityOperationStatus_DSIG_NO_REFERENCES;
+// case XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE:
+// return SecurityOperationStatus_DSIG_INVALID_REFERENCE;
+// case XMLSEC_ERRORS_R_ASSERTION:
+// return SecurityOperationStatus_ASSERTION;
+// default:
+// return SecurityOperationStatus_RUNTIMEERROR_FAILED;
+// }
// }
@@ -165,49 +165,49 @@ void errorCallback(const char * /*file*/,
// const char * errObj = errorObject ? errorObject : "";
// const char * errSub = errorSubject ? errorSubject : "";
// const char * amsg = msg ? msg : "";
-// fprintf(stdout, "xmlsec error: %s, %s, %s, %i %s \n", afunc, errObj, errSub, reason, amsg);
+// fprintf(stdout, "xmlsec error: %s, %s, %s, %i %s \n", afunc, errObj, errSub, reason, amsg);
#endif
//ToDo write log message
-// if (g_xErrorRecorder.is() && !g_bErrorRecorded)
-// {
-// g_xErrorRecorder->setStatus(getOperationStatus(reason));
+// if (g_xErrorRecorder.is() && !g_bErrorRecorded)
+// {
+// g_xErrorRecorder->setStatus(getOperationStatus(reason));
-// if ( reason != XMLSEC_ERRORS_R_ASSERTION && reason!=XMLSEC_ERRORS_R_XMLSEC_FAILED)
-// {
+// if ( reason != XMLSEC_ERRORS_R_ASSERTION && reason!=XMLSEC_ERRORS_R_XMLSEC_FAILED)
+// {
// g_bErrorRecorded = true;
-// }
-// }
+// }
+// }
}
// void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate >& xTemplate)
// {
-// g_xErrorRecorder = xTemplate;
-// g_xErrorRecorder->setStatus(SecurityOperationStatus_OPERATION_SUCCEEDED);
-// g_bErrorRecorded = false;
-// xmlSecErrorsSetCallback(errorCallback);
+// g_xErrorRecorder = xTemplate;
+// g_xErrorRecorder->setStatus(SecurityOperationStatus_OPERATION_SUCCEEDED);
+// g_bErrorRecorded = false;
+// xmlSecErrorsSetCallback(errorCallback);
// }
//void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& xTemplate)
-void setErrorRecorder()
+void setErrorRecorder()
{
-// ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate >
-// xSecurityTemplate(xTemplate, ::com::sun::star::uno::UNO_QUERY);
-// setErrorRecorder( xSecurityTemplate );
+// ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate >
+// xSecurityTemplate(xTemplate, ::com::sun::star::uno::UNO_QUERY);
+// setErrorRecorder( xSecurityTemplate );
xmlSecErrorsSetCallback(errorCallback);
}
// void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& xTemplate)
// {
-// ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate >
-// xSecurityTemplate(xTemplate, ::com::sun::star::uno::UNO_QUERY);
-// setErrorRecorder( xSecurityTemplate );
+// ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate >
+// xSecurityTemplate(xTemplate, ::com::sun::star::uno::UNO_QUERY);
+// setErrorRecorder( xSecurityTemplate );
// }
void clearErrorRecorder()
{
xmlSecErrorsSetCallback(NULL);
-// g_xErrorRecorder = NULL;
+// g_xErrorRecorder = NULL;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/errorcallback.hxx b/xmlsecurity/source/xmlsec/errorcallback.hxx
index c861263a0f22..c7f361e00a21 100644
--- a/xmlsecurity/source/xmlsec/errorcallback.hxx
+++ b/xmlsecurity/source/xmlsec/errorcallback.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/xmlsec/mscrypt/oid.hxx b/xmlsecurity/source/xmlsec/mscrypt/oid.hxx
index c46456d4dc87..1e69414e3169 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/oid.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/oid.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,121 +37,121 @@ struct OIDItemStr {
};
OIDItem OIDs[] = {
- {"1.2.840.113549", "RSA Data Security Inc."},
- {"1.2.840.113549.1", "PKCS"},
- {"1.2.840.113549.2", "RSA digest algorithm"},
- {"1.2.840.113549.3", "RSA cipher algorithm"},
- {"1.2.840.113549.1.1", "PKCS #1"},
- {"1.2.840.113549.1.2", "Unknown"},
- {"1.2.840.113549.1.3", "Unknown"},
- {"1.2.840.113549.1.4", "Unknown"},
- {"1.2.840.113549.1.5", "PKCS #5"},
- {"1.2.840.113549.1.6", "Unknown"},
- {"1.2.840.113549.1.7", "PKCS #7"},
- {"1.2.840.113549.1.8", "Unknown"},
- {"1.2.840.113549.1.9", "PKCS #9"},
- {"1.2.840.113549.1.10", "Unknown"},
- {"1.2.840.113549.1.12", "PKCS #12"},
- {"1.2.840.113549.1.1.2", "PKCS #1 MD2 With RSA Encryption"},
- {"1.2.840.113549.1.1.3", "PKCS #1 MD4 With RSA Encryption"},
- {"1.2.840.113549.1.1.4", "PKCS #1 MD5 With RSA Encryption"},
- {"1.2.840.113549.1.1.1", "PKCS #1 RSA Encryption"},
- {"1.2.840.113549.1.1.2", "PKCS #1 MD2 With RSA Encryption"},
- {"1.2.840.113549.1.1.3", "PKCS #1 MD4 With RSA Encryption"},
- {"1.2.840.113549.1.1.4", "PKCS #1 MD5 With RSA Encryption"},
- {"1.2.840.113549.1.1.5", "PKCS #1 SHA-1 With RSA Encryption"},
- {"1.2.840.113549.1.1.5", "PKCS #1 SHA-1 With RSA Encryption"},
- {"1.2.840.113549.1.3.1", "Unknown"},
- {"1.2.840.113549.1.7.1", "PKCS #7 Data"},
- {"1.2.840.113549.1.7.2", "PKCS #7 Signed Data"},
- {"1.2.840.113549.1.7.3", "PKCS #7 Enveloped Data"},
- {"1.2.840.113549.1.7.4", "PKCS #7 Signed and Enveloped Data"},
- {"1.2.840.113549.1.7.5", "PKCS #7 Digested Data"},
- {"1.2.840.113549.1.7.5", "PKCS #7 Digested Data"},
- {"1.2.840.113549.1.7.6", "PKCS #7 Encrypted Data"},
- {"1.2.840.113549.1.9.1", "PKCS #9 Email Address"},
- {"1.2.840.113549.1.9.2", "PKCS #9 Unstructured Name"},
- {"1.2.840.113549.1.9.3", "PKCS #9 Content Type"},
- {"1.2.840.113549.1.9.4", "PKCS #9 Message Digest"},
- {"1.2.840.113549.1.9.5", "PKCS #9 Signing Time"},
- {"1.2.840.113549.1.9.6", "PKCS #9 Counter Signature"},
- {"1.2.840.113549.1.9.7", "PKCS #9 Challenge Password"},
- {"1.2.840.113549.1.9.8", "PKCS #9 Unstructured Address"},
- {"1.2.840.113549.1.9.9", "PKCS #9 Extended Certificate Attributes"},
- {"1.2.840.113549.1.9.15", "PKCS #9 S/MIME Capabilities"},
- {"1.2.840.113549.1.9.15.1", "Unknown"},
- {"1.2.840.113549.3.2", "RC2-CBC"},
- {"1.2.840.113549.3.4", "RC4"},
- {"1.2.840.113549.3.7", "DES-EDE3-CBC"},
- {"1.2.840.113549.3.9", "RC5-CBCPad"},
- {"1.2.840.10046", "ANSI X9.42"},
- {"1.2.840.10046.2.1", "Diffie-Hellman Public Key Algorithm"},
- {"1.2.840.10040", "ANSI X9.57"},
- {"1.2.840.10040.4.1", "ANSI X9.57 DSA Signature"},
- {"1.2.840.10040.4.3", "ANSI X9.57 Algorithm DSA Signature with SHA-1 Digest"},
- {"2.5", "Directory"},
- {"2.5.8", "X.500-defined algorithms"},
- {"2.5.8.1", "X.500-defined encryption algorithms"},
- {"2.5.8.2", "Unknown"},
- {"2.5.8.3", "Unknown"},
- {"2.5.8.1.1", "RSA Encryption Algorithm"},
- {"1.3.14", "Open Systems Implementors Workshop"},
- {"1.3.14.3.2", "OIW SECSIG Algorithm"},
- {"1.3.14.3.2.2", "Unknown"},
- {"1.3.14.3.2.3", "Unknown"},
- {"1.3.14.3.2.4", "Unknown"},
- {"1.3.14.3.2.6", "DES-ECB"},
- {"1.3.14.3.2.7", "DES-CBC"},
- {"1.3.14.3.2.8", "DES-OFB"},
- {"1.3.14.3.2.9", "DES-CFB"},
- {"1.3.14.3.2.10", "DES-MAC"},
- {"1.3.14.3.2.11", "Unknown"},
- {"1.3.14.3.2.12", "Unknown"},
- {"1.3.14.3.2.13", "Unknown"},
- {"1.3.14.3.2.14", "Unknown"},
- {"1.3.14.3.2.15", "ISO SHA with RSA Signature"},
- {"1.3.14.3.2.16", "Unknown"},
- {"1.3.14.3.2.17", "DES-EDE"},
- {"1.3.14.3.2.18", "Unknown"},
- {"1.3.14.3.2.19", "Unknown"},
- {"1.3.14.3.2.20", "Unknown"},
- {"1.3.14.3.2.21", "Unknown"},
- {"1.3.14.3.2.22", "Unknown"},
- {"1.3.14.3.2.23", "Unknown"},
- {"1.3.14.3.2.24", "Unknown"},
- {"1.3.14.3.2.25", "Unknown"},
- {"1.3.14.3.2.26", "SHA-1"},
- {"1.3.14.3.2.27", "Forgezza DSA Signature with SHA-1 Digest"},
- {"1.3.14.3.2.28", "Unknown"},
- {"1.3.14.3.2.29", "Unknown"},
- {"1.3.14.7.2", "Unknown"},
- {"1.3.14.7.2.1", "Unknown"},
- {"1.3.14.7.2.2", "Unknown"},
- {"1.3.14.7.2.3", "Unknown"},
- {"1.3.14.7.2.2.1", "Unknown"},
- {"1.3.14.7.2.3.1", "Unknown"},
- {"2.16.840.1.101.2.1", "US DOD Infosec"},
- {"2.16.840.1.101.2.1.1.1", "Unknown"},
- {"2.16.840.1.101.2.1.1.2", "MISSI DSS Algorithm (Old)"},
- {"2.16.840.1.101.2.1.1.3", "Unknown"},
- {"2.16.840.1.101.2.1.1.4", "Skipjack CBC64"},
- {"2.16.840.1.101.2.1.1.5", "Unknown"},
- {"2.16.840.1.101.2.1.1.6", "Unknown"},
- {"2.16.840.1.101.2.1.1.7", "Unknown"},
- {"2.16.840.1.101.2.1.1.8", "Unknown"},
- {"2.16.840.1.101.2.1.1.9", "Unknown"},
- {"2.16.840.1.101.2.1.1.10", "MISSI KEA Algorithm"},
- {"2.16.840.1.101.2.1.1.11", "Unknown"},
- {"2.16.840.1.101.2.1.1.12", "MISSI KEA and DSS Algorithm (Old)"},
- {"2.16.840.1.101.2.1.1.13", "Unknown"},
- {"2.16.840.1.101.2.1.1.14", "Unknown"},
- {"2.16.840.1.101.2.1.1.15", "Unknown"},
- {"2.16.840.1.101.2.1.1.16", "Unknown"},
- {"2.16.840.1.101.2.1.1.17", "Unknown"},
- {"2.16.840.1.101.2.1.1.18", "Unknown"},
- {"2.16.840.1.101.2.1.1.19", "MISSI DSS Algorithm"},
- {"2.16.840.1.101.2.1.1.20", "MISSI KEA and DSS Algorithm"},
- {"2.16.840.1.101.2.1.1.21", "Unknown"}
+ {"1.2.840.113549", "RSA Data Security Inc."},
+ {"1.2.840.113549.1", "PKCS"},
+ {"1.2.840.113549.2", "RSA digest algorithm"},
+ {"1.2.840.113549.3", "RSA cipher algorithm"},
+ {"1.2.840.113549.1.1", "PKCS #1"},
+ {"1.2.840.113549.1.2", "Unknown"},
+ {"1.2.840.113549.1.3", "Unknown"},
+ {"1.2.840.113549.1.4", "Unknown"},
+ {"1.2.840.113549.1.5", "PKCS #5"},
+ {"1.2.840.113549.1.6", "Unknown"},
+ {"1.2.840.113549.1.7", "PKCS #7"},
+ {"1.2.840.113549.1.8", "Unknown"},
+ {"1.2.840.113549.1.9", "PKCS #9"},
+ {"1.2.840.113549.1.10", "Unknown"},
+ {"1.2.840.113549.1.12", "PKCS #12"},
+ {"1.2.840.113549.1.1.2", "PKCS #1 MD2 With RSA Encryption"},
+ {"1.2.840.113549.1.1.3", "PKCS #1 MD4 With RSA Encryption"},
+ {"1.2.840.113549.1.1.4", "PKCS #1 MD5 With RSA Encryption"},
+ {"1.2.840.113549.1.1.1", "PKCS #1 RSA Encryption"},
+ {"1.2.840.113549.1.1.2", "PKCS #1 MD2 With RSA Encryption"},
+ {"1.2.840.113549.1.1.3", "PKCS #1 MD4 With RSA Encryption"},
+ {"1.2.840.113549.1.1.4", "PKCS #1 MD5 With RSA Encryption"},
+ {"1.2.840.113549.1.1.5", "PKCS #1 SHA-1 With RSA Encryption"},
+ {"1.2.840.113549.1.1.5", "PKCS #1 SHA-1 With RSA Encryption"},
+ {"1.2.840.113549.1.3.1", "Unknown"},
+ {"1.2.840.113549.1.7.1", "PKCS #7 Data"},
+ {"1.2.840.113549.1.7.2", "PKCS #7 Signed Data"},
+ {"1.2.840.113549.1.7.3", "PKCS #7 Enveloped Data"},
+ {"1.2.840.113549.1.7.4", "PKCS #7 Signed and Enveloped Data"},
+ {"1.2.840.113549.1.7.5", "PKCS #7 Digested Data"},
+ {"1.2.840.113549.1.7.5", "PKCS #7 Digested Data"},
+ {"1.2.840.113549.1.7.6", "PKCS #7 Encrypted Data"},
+ {"1.2.840.113549.1.9.1", "PKCS #9 Email Address"},
+ {"1.2.840.113549.1.9.2", "PKCS #9 Unstructured Name"},
+ {"1.2.840.113549.1.9.3", "PKCS #9 Content Type"},
+ {"1.2.840.113549.1.9.4", "PKCS #9 Message Digest"},
+ {"1.2.840.113549.1.9.5", "PKCS #9 Signing Time"},
+ {"1.2.840.113549.1.9.6", "PKCS #9 Counter Signature"},
+ {"1.2.840.113549.1.9.7", "PKCS #9 Challenge Password"},
+ {"1.2.840.113549.1.9.8", "PKCS #9 Unstructured Address"},
+ {"1.2.840.113549.1.9.9", "PKCS #9 Extended Certificate Attributes"},
+ {"1.2.840.113549.1.9.15", "PKCS #9 S/MIME Capabilities"},
+ {"1.2.840.113549.1.9.15.1", "Unknown"},
+ {"1.2.840.113549.3.2", "RC2-CBC"},
+ {"1.2.840.113549.3.4", "RC4"},
+ {"1.2.840.113549.3.7", "DES-EDE3-CBC"},
+ {"1.2.840.113549.3.9", "RC5-CBCPad"},
+ {"1.2.840.10046", "ANSI X9.42"},
+ {"1.2.840.10046.2.1", "Diffie-Hellman Public Key Algorithm"},
+ {"1.2.840.10040", "ANSI X9.57"},
+ {"1.2.840.10040.4.1", "ANSI X9.57 DSA Signature"},
+ {"1.2.840.10040.4.3", "ANSI X9.57 Algorithm DSA Signature with SHA-1 Digest"},
+ {"2.5", "Directory"},
+ {"2.5.8", "X.500-defined algorithms"},
+ {"2.5.8.1", "X.500-defined encryption algorithms"},
+ {"2.5.8.2", "Unknown"},
+ {"2.5.8.3", "Unknown"},
+ {"2.5.8.1.1", "RSA Encryption Algorithm"},
+ {"1.3.14", "Open Systems Implementors Workshop"},
+ {"1.3.14.3.2", "OIW SECSIG Algorithm"},
+ {"1.3.14.3.2.2", "Unknown"},
+ {"1.3.14.3.2.3", "Unknown"},
+ {"1.3.14.3.2.4", "Unknown"},
+ {"1.3.14.3.2.6", "DES-ECB"},
+ {"1.3.14.3.2.7", "DES-CBC"},
+ {"1.3.14.3.2.8", "DES-OFB"},
+ {"1.3.14.3.2.9", "DES-CFB"},
+ {"1.3.14.3.2.10", "DES-MAC"},
+ {"1.3.14.3.2.11", "Unknown"},
+ {"1.3.14.3.2.12", "Unknown"},
+ {"1.3.14.3.2.13", "Unknown"},
+ {"1.3.14.3.2.14", "Unknown"},
+ {"1.3.14.3.2.15", "ISO SHA with RSA Signature"},
+ {"1.3.14.3.2.16", "Unknown"},
+ {"1.3.14.3.2.17", "DES-EDE"},
+ {"1.3.14.3.2.18", "Unknown"},
+ {"1.3.14.3.2.19", "Unknown"},
+ {"1.3.14.3.2.20", "Unknown"},
+ {"1.3.14.3.2.21", "Unknown"},
+ {"1.3.14.3.2.22", "Unknown"},
+ {"1.3.14.3.2.23", "Unknown"},
+ {"1.3.14.3.2.24", "Unknown"},
+ {"1.3.14.3.2.25", "Unknown"},
+ {"1.3.14.3.2.26", "SHA-1"},
+ {"1.3.14.3.2.27", "Forgezza DSA Signature with SHA-1 Digest"},
+ {"1.3.14.3.2.28", "Unknown"},
+ {"1.3.14.3.2.29", "Unknown"},
+ {"1.3.14.7.2", "Unknown"},
+ {"1.3.14.7.2.1", "Unknown"},
+ {"1.3.14.7.2.2", "Unknown"},
+ {"1.3.14.7.2.3", "Unknown"},
+ {"1.3.14.7.2.2.1", "Unknown"},
+ {"1.3.14.7.2.3.1", "Unknown"},
+ {"2.16.840.1.101.2.1", "US DOD Infosec"},
+ {"2.16.840.1.101.2.1.1.1", "Unknown"},
+ {"2.16.840.1.101.2.1.1.2", "MISSI DSS Algorithm (Old)"},
+ {"2.16.840.1.101.2.1.1.3", "Unknown"},
+ {"2.16.840.1.101.2.1.1.4", "Skipjack CBC64"},
+ {"2.16.840.1.101.2.1.1.5", "Unknown"},
+ {"2.16.840.1.101.2.1.1.6", "Unknown"},
+ {"2.16.840.1.101.2.1.1.7", "Unknown"},
+ {"2.16.840.1.101.2.1.1.8", "Unknown"},
+ {"2.16.840.1.101.2.1.1.9", "Unknown"},
+ {"2.16.840.1.101.2.1.1.10", "MISSI KEA Algorithm"},
+ {"2.16.840.1.101.2.1.1.11", "Unknown"},
+ {"2.16.840.1.101.2.1.1.12", "MISSI KEA and DSS Algorithm (Old)"},
+ {"2.16.840.1.101.2.1.1.13", "Unknown"},
+ {"2.16.840.1.101.2.1.1.14", "Unknown"},
+ {"2.16.840.1.101.2.1.1.15", "Unknown"},
+ {"2.16.840.1.101.2.1.1.16", "Unknown"},
+ {"2.16.840.1.101.2.1.1.17", "Unknown"},
+ {"2.16.840.1.101.2.1.1.18", "Unknown"},
+ {"2.16.840.1.101.2.1.1.19", "MISSI DSS Algorithm"},
+ {"2.16.840.1.101.2.1.1.20", "MISSI KEA and DSS Algorithm"},
+ {"2.16.840.1.101.2.1.1.21", "Unknown"}
};
int nOID = 115;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 5e466ab471a5..049b52185aaa 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -56,7 +56,7 @@
//CP : added by CP
#include <rtl/locale.h>
-#include <osl/nlsupport.h>
+#include <osl/nlsupport.h>
#include <osl/process.h>
//CP : end
@@ -171,7 +171,7 @@ SecurityEnvironment_MSCryptImpl :: ~SecurityEnvironment_MSCryptImpl() {
for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ )
CryptDestroyKey( *priKeyIt ) ;
}
-
+
}
/* XInitialization */
@@ -222,10 +222,10 @@ Reference< XSingleServiceFactory > SecurityEnvironment_MSCryptImpl :: impl_creat
}
/* XUnoTunnel */
-sal_Int64 SAL_CALL SecurityEnvironment_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
+sal_Int64 SAL_CALL SecurityEnvironment_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
throw( RuntimeException )
{
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
return ( sal_Int64 )this ;
}
return 0 ;
@@ -317,7 +317,7 @@ void SecurityEnvironment_MSCryptImpl :: setCertDb( HCERTSTORE aCertDb ) throw( E
}
void SecurityEnvironment_MSCryptImpl :: adoptSymKey( HCRYPTKEY aSymKey ) throw( Exception , RuntimeException ) {
- HCRYPTKEY symkey ;
+ HCRYPTKEY symkey ;
std::list< HCRYPTKEY >::iterator keyIt ;
if( aSymKey != NULL ) {
@@ -373,7 +373,7 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getSymKey( unsigned int position )
}
void SecurityEnvironment_MSCryptImpl :: adoptPubKey( HCRYPTKEY aPubKey ) throw( Exception , RuntimeException ) {
- HCRYPTKEY pubkey ;
+ HCRYPTKEY pubkey ;
std::list< HCRYPTKEY >::iterator keyIt ;
if( aPubKey != NULL ) {
@@ -429,7 +429,7 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getPubKey( unsigned int position )
}
void SecurityEnvironment_MSCryptImpl :: adoptPriKey( HCRYPTKEY aPriKey ) throw( Exception , RuntimeException ) {
- HCRYPTKEY prikey ;
+ HCRYPTKEY prikey ;
std::list< HCRYPTKEY >::iterator keyIt ;
if( aPriKey != NULL ) {
@@ -455,7 +455,7 @@ void SecurityEnvironment_MSCryptImpl :: adoptPriKey( HCRYPTKEY aPriKey ) throw(
}
void SecurityEnvironment_MSCryptImpl :: rejectPriKey( HCRYPTKEY aPriKey ) throw( Exception , RuntimeException ) {
- HCRYPTKEY prikey ;
+ HCRYPTKEY prikey ;
std::list< HCRYPTKEY >::iterator keyIt ;
if( aPriKey != NULL ) {
@@ -485,7 +485,7 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getPriKey( unsigned int position )
}
//Methods from XSecurityEnvironment
-Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPersonalCertificates() throw( SecurityException , RuntimeException )
+Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPersonalCertificates() throw( SecurityException , RuntimeException )
{
sal_Int32 length ;
X509Certificate_MSCryptImpl* xcert ;
@@ -573,8 +573,8 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPer
Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( const OUString& issuerName, const Sequence< sal_Int8 >& serialNumber ) throw( SecurityException , RuntimeException ) {
unsigned int i ;
-// sal_Int8 found = 0 ;
- LPSTR pszName ;
+// sal_Int8 found = 0 ;
+ LPSTR pszName ;
X509Certificate_MSCryptImpl *xcert = NULL ;
PCCERT_CONTEXT pCertContext = NULL ;
HCERTSTORE hCertStore = NULL ;
@@ -621,8 +621,8 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
//Get the SerialNumber
cryptSerialNumber.cbData = serialNumber.getLength() ;
- cryptSerialNumber.pbData = ( BYTE* )malloc( cryptSerialNumber.cbData);
- if (!cryptSerialNumber.pbData)
+ cryptSerialNumber.pbData = ( BYTE* )malloc( cryptSerialNumber.cbData);
+ if (!cryptSerialNumber.pbData)
{
free( certInfo.Issuer.pbData ) ;
throw RuntimeException() ;
@@ -632,7 +632,7 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
certInfo.SerialNumber.cbData = cryptSerialNumber.cbData ;
certInfo.SerialNumber.pbData = cryptSerialNumber.pbData ;
-
+
// Get the Cert from all store.
for( i = 0 ; i < 6 ; i ++ )
{
@@ -667,11 +667,11 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
continue;
}
-/*******************************************************************************
- * This code reserved for remind us there are another way to find one cert by
- * IssuerName&serialnumber. You can use the code to replaced the function
+/*******************************************************************************
+ * This code reserved for remind us there are another way to find one cert by
+ * IssuerName&serialnumber. You can use the code to replaced the function
* CertFindCertificateInStore IF and ONLY IF you must find one special cert in
- * certStore but can not be found by CertFindCertificateInStore , then , you
+ * certStore but can not be found by CertFindCertificateInStore , then , you
* should also change the same part in libxmlsec/.../src/mscrypto/x509vfy.c#875.
* By Chandler Peng(chandler.peng@sun.com)
*****/
@@ -679,7 +679,7 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
pCertContext = NULL ;
found = 0;
do{
- // 1. enum the certs has same string in the issuer string.
+ // 1. enum the certs has same string in the issuer string.
pCertContext = CertEnumCertificatesInStore( hCertStore , pCertContext ) ;
if( pCertContext != NULL )
{
@@ -693,7 +693,7 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG ,
NULL, 0
) ;
-
+
if( cbIssuer == 0 ) continue ; // discard this cert;
issuer = (char *)malloc( cbIssuer ) ;
@@ -719,7 +719,7 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
continue ;// discard this cert;
}
- if(strncmp(pszName , issuer , cbIssuer) != 0)
+ if(strncmp(pszName , issuer , cbIssuer) != 0)
{
free( issuer ) ;
continue ;// discard this cert;
@@ -738,7 +738,7 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
}
}while(pCertContext);
-
+
if(i != 0 && i != 1) CertCloseStore( hCertStore, CERT_CLOSE_STORE_CHECK_FLAG ) ;
if( found != 0 ) break; // Found the certificate.
********************************************************************************/
@@ -751,7 +751,7 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con
&certInfo,
NULL
) ;
-
+
if(i != 0 && i != 1) CertCloseStore( hCertStore, CERT_CLOSE_STORE_CHECK_FLAG ) ;
if( pCertContext != NULL ) break ; // Found the certificate.
@@ -780,9 +780,9 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: buildC
PCCERT_CONTEXT pCertContext ;
const X509Certificate_MSCryptImpl* xcert ;
- CERT_ENHKEY_USAGE enhKeyUsage ;
- CERT_USAGE_MATCH certUsage ;
- CERT_CHAIN_PARA chainPara ;
+ CERT_ENHKEY_USAGE enhKeyUsage ;
+ CERT_USAGE_MATCH certUsage ;
+ CERT_CHAIN_PARA chainPara ;
enhKeyUsage.cUsageIdentifier = 0 ;
enhKeyUsage.rgpszUsageIdentifier = NULL ;
@@ -857,7 +857,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: buildC
&pChainContext);
if (!bChain)
pChainContext = NULL;
-
+
//Close the additional store
CertCloseStore(hCollectionStore, CERT_CLOSE_STORE_CHECK_FLAG);
}
@@ -964,16 +964,16 @@ HCERTSTORE getCertStoreForIntermediatCerts(
//explicitly that all validation steps are carried out even if one or several
//errors occur. See also
//http://wiki.services.openoffice.org/wiki/Certificate_Path_Validation#Validation_status
-sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
+sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
const Reference< ::com::sun::star::security::XCertificate >& aCert,
- const Sequence< Reference< ::com::sun::star::security::XCertificate > >& seqCerts)
- throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException )
+ const Sequence< Reference< ::com::sun::star::security::XCertificate > >& seqCerts)
+ throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException )
{
sal_Int32 validity = 0;
PCCERT_CHAIN_CONTEXT pChainContext = NULL;
PCCERT_CONTEXT pCertContext = NULL;
const X509Certificate_MSCryptImpl* xcert = NULL;
-
+
Reference< XUnoTunnel > xCertTunnel( aCert, UNO_QUERY ) ;
if( !xCertTunnel.is() ) {
throw RuntimeException() ;
@@ -987,14 +987,14 @@ sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
if( xcert == NULL ) {
throw RuntimeException() ;
}
-
+
pCertContext = xcert->getMswcryCert() ;
- CERT_ENHKEY_USAGE enhKeyUsage ;
- CERT_USAGE_MATCH certUsage ;
- CERT_CHAIN_PARA chainPara ;
+ CERT_ENHKEY_USAGE enhKeyUsage ;
+ CERT_USAGE_MATCH certUsage ;
+ CERT_CHAIN_PARA chainPara ;
rtl_zeroMemory(&chainPara, sizeof(CERT_CHAIN_PARA));
-
+
//Prepare parameter for CertGetCertificateChain
enhKeyUsage.cUsageIdentifier = 0 ;
enhKeyUsage.rgpszUsageIdentifier = NULL ;
@@ -1012,7 +1012,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
hIntermediateCertsStore =
getCertStoreForIntermediatCerts(seqCerts);
- //Merge m_hCertStore and m_hKeyStore and the store of the intermediate
+ //Merge m_hCertStore and m_hKeyStore and the store of the intermediate
//certificates into one store.
hCollectionStore = CertOpenStore(
CERT_STORE_PROV_COLLECTION ,
@@ -1038,9 +1038,9 @@ sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
hIntermediateCertsStore,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG,
0);
-
+
}
-
+
//CertGetCertificateChain searches by default in MY, CA, ROOT and TRUST
//We do not check revocation of the root. In most cases there are none.
//Then we would get CERT_TRUST_REVOCATION_STATUS_UNKNOWN
@@ -1051,7 +1051,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
NULL , //use current system time
hCollectionStore,
&chainPara ,
- CERT_CHAIN_REVOCATION_CHECK_CHAIN | CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT,
+ CERT_CHAIN_REVOCATION_CHECK_CHAIN | CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT,
NULL ,
&pChainContext);
@@ -1166,9 +1166,9 @@ sal_Int32 SecurityEnvironment_MSCryptImpl :: getCertificateCharacters( const ::c
//Secondly, make sentence whether or not the cert has a private key.
{
- BOOL fCallerFreeProv ;
- DWORD dwKeySpec ;
- HCRYPTPROV hProv ;
+ BOOL fCallerFreeProv ;
+ DWORD dwKeySpec ;
+ HCRYPTPROV hProv ;
if( CryptAcquireCertificatePrivateKey( pCertContext ,
0 ,
NULL ,
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
index 6da54acc7cd4..187a302d038e 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -65,22 +65,22 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4<
{
private :
//cyrpto provider and key container
- HCRYPTPROV m_hProv ;
- LPCTSTR m_pszContainer ;
+ HCRYPTPROV m_hProv ;
+ LPCTSTR m_pszContainer ;
//Key store
- HCERTSTORE m_hKeyStore ;
+ HCERTSTORE m_hKeyStore ;
//Certiticate store
- HCERTSTORE m_hCertStore ;
+ HCERTSTORE m_hCertStore ;
//Enable default system cryptography setting
- sal_Bool m_bEnableDefault ;
+ sal_Bool m_bEnableDefault ;
//External keys
- std::list< HCRYPTKEY > m_tSymKeyList ;
- std::list< HCRYPTKEY > m_tPubKeyList ;
- std::list< HCRYPTKEY > m_tPriKeyList ;
+ std::list< HCRYPTKEY > m_tSymKeyList ;
+ std::list< HCRYPTKEY > m_tPubKeyList ;
+ std::list< HCRYPTKEY > m_tPriKeyList ;
//Service manager
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
@@ -102,15 +102,15 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4<
virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromAscii( const ::rtl::OUString& asciiCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ;
- virtual ::sal_Int32 SAL_CALL verifyCertificate(
+ virtual ::sal_Int32 SAL_CALL verifyCertificate(
const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& xCert,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
- ::com::sun::star::security::XCertificate > >& intermediateCertificates)
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::security::XCertificate > >& intermediateCertificates)
throw (::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException) ;
virtual ::sal_Int32 SAL_CALL getCertificateCharacters( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& xCert ) throw (::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException) ;
-
+
virtual ::rtl::OUString SAL_CALL getSecurityEnvironmentInformation( ) throw (::com::sun::star::uno::RuntimeException);
-
+
//Methods from XInitialization
virtual void SAL_CALL initialize(
@@ -137,7 +137,7 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
//Methods from XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
throw (::com::sun::star::uno::RuntimeException);
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
@@ -188,6 +188,6 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4<
virtual void destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
} ;
-#endif // _XSECURITYENVIRONMENT_MSCRYPTIMPL_HXX_
+#endif // _XSECURITYENVIRONMENT_MSCRYPTIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
index 72063a140240..5f728c6b23ce 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -51,26 +51,26 @@ SEInitializer_MSCryptImpl::SEInitializer_MSCryptImpl(
{
}
-SEInitializer_MSCryptImpl::~SEInitializer_MSCryptImpl()
+SEInitializer_MSCryptImpl::~SEInitializer_MSCryptImpl()
{
}
/* XSEInitializer */
-cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
+cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
SEInitializer_MSCryptImpl::createSecurityContext(
const rtl::OUString& sCertDB )
throw (cssu::RuntimeException)
{
const char* n_pCertStore ;
HCERTSTORE n_hStoreHandle ;
-
+
//Initialize the crypto engine
- if( sCertDB.getLength() > 0 )
+ if( sCertDB.getLength() > 0 )
{
rtl::OString sCertDir(sCertDB, sCertDB.getLength(), RTL_TEXTENCODING_ASCII_US);
n_pCertStore = sCertDir.getStr();
n_hStoreHandle = CertOpenSystemStore( NULL, n_pCertStore ) ;
- if( n_hStoreHandle == NULL )
+ if( n_hStoreHandle == NULL )
{
return NULL;
}
@@ -80,50 +80,50 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
n_pCertStore = NULL ;
n_hStoreHandle = NULL ;
}
-
+
xmlSecMSCryptoAppInit( n_pCertStore ) ;
try {
/* Build Security Environment */
- const rtl::OUString sSecyrutyEnvironment ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_ENVIRONMENT ) );
+ const rtl::OUString sSecyrutyEnvironment ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_ENVIRONMENT ) );
cssu::Reference< cssxc::XSecurityEnvironment > xSecEnv( mxMSF->createInstance ( sSecyrutyEnvironment ), cssu::UNO_QUERY );
- if( !xSecEnv.is() )
+ if( !xSecEnv.is() )
{
if( n_hStoreHandle != NULL )
{
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
-
+
xmlSecMSCryptoAppShutdown() ;
return NULL;
}
-
+
/* Setup key slot and certDb */
cssu::Reference< cssl::XUnoTunnel > xEnvTunnel( xSecEnv , cssu::UNO_QUERY ) ;
- if( !xEnvTunnel.is() )
+ if( !xEnvTunnel.is() )
{
if( n_hStoreHandle != NULL )
{
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
-
+
xmlSecMSCryptoAppShutdown() ;
return NULL;
}
SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ;
- if( pSecEnv == NULL )
+ if( pSecEnv == NULL )
{
if( n_hStoreHandle != NULL )
{
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
-
+
xmlSecMSCryptoAppShutdown() ;
return NULL;
}
- if( n_hStoreHandle != NULL )
+ if( n_hStoreHandle != NULL )
{
pSecEnv->setCryptoSlot( n_hStoreHandle ) ;
pSecEnv->setCertDb( n_hStoreHandle ) ;
@@ -134,19 +134,19 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
}
/* Build XML Security Context */
- const rtl::OUString sSecyrutyContext ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_CONTEXT ) );
+ const rtl::OUString sSecyrutyContext ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_CONTEXT ) );
cssu::Reference< cssxc::XXMLSecurityContext > xSecCtx( mxMSF->createInstance ( sSecyrutyContext ), cssu::UNO_QUERY );
- if( !xSecCtx.is() )
+ if( !xSecCtx.is() )
{
if( n_hStoreHandle != NULL )
{
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
-
+
xmlSecMSCryptoAppShutdown() ;
return NULL;
}
-
+
xSecCtx->setDefaultSecurityEnvironmentIndex(xSecCtx->addSecurityEnvironment( xSecEnv )) ;
return xSecCtx;
}
@@ -156,7 +156,7 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
{
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
-
+
xmlSecMSCryptoAppShutdown() ;
return NULL;
}
@@ -168,27 +168,27 @@ void SAL_CALL SEInitializer_MSCryptImpl::freeSecurityContext( const cssu::Refere
/*
cssu::Reference< cssxc::XSecurityEnvironment > xSecEnv
= securityContext->getSecurityEnvironment();
-
- if( xSecEnv.is() )
+
+ if( xSecEnv.is() )
{
cssu::Reference< cssl::XUnoTunnel > xEnvTunnel( xSecEnv , cssu::UNO_QUERY ) ;
- if( xEnvTunnel.is() )
+ if( xEnvTunnel.is() )
{
SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ;
HCERTSTORE n_hStoreHandle = pSecEnv->getCryptoSlot();
-
+
if( n_hStoreHandle != NULL )
{
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
pSecEnv->setCryptoSlot( NULL ) ;
pSecEnv->setCertDb( NULL ) ;
}
-
+
xmlSecMSCryptoAppShutdown() ;
}
- }
+ }
*/
-
+
xmlSecMSCryptoAppShutdown() ;
}
@@ -198,13 +198,13 @@ rtl::OUString SEInitializer_MSCryptImpl_getImplementationName ()
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -221,17 +221,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL SEInitializer_MSCryptImpl_createIns
}
/* XServiceInfo */
-rtl::OUString SAL_CALL SEInitializer_MSCryptImpl::getImplementationName( )
+rtl::OUString SAL_CALL SEInitializer_MSCryptImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return SEInitializer_MSCryptImpl_getImplementationName();
}
-sal_Bool SAL_CALL SEInitializer_MSCryptImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL SEInitializer_MSCryptImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return SEInitializer_MSCryptImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return SEInitializer_MSCryptImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx
index b4ee827b74f0..97c8510089b9 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,65 +38,65 @@
#include <libxml/tree.h>
-class SEInitializer_MSCryptImpl : public cppu::WeakImplHelper2
-<
+class SEInitializer_MSCryptImpl : public cppu::WeakImplHelper2
+<
com::sun::star::xml::crypto::XSEInitializer,
com::sun::star::lang::XServiceInfo
>
/****** SEInitializer_MSCryptImpl.hxx/CLASS SEInitializer_MSCryptImpl ***********
*
* NAME
- * SEInitializer_MSCryptImpl -- Class to initialize a Security Context
- * instance
+ * SEInitializer_MSCryptImpl -- Class to initialize a Security Context
+ * instance
*
* FUNCTION
- * Use this class to initialize a XmlSec based Security Context
- * instance. After this instance is used up, use this class to free this
- * instance.
+ * Use this class to initialize a XmlSec based Security Context
+ * instance. After this instance is used up, use this class to free this
+ * instance.
*
* HISTORY
- * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer
+ * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
-
+
public:
SEInitializer_MSCryptImpl(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF);
virtual ~SEInitializer_MSCryptImpl();
/* XSEInitializer */
- virtual com::sun::star::uno::Reference<
+ virtual com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext >
SAL_CALL createSecurityContext( const rtl::OUString& certDB )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL freeSecurityContext( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext >& securityContext )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
-
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString SEInitializer_MSCryptImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index 2b5c6e5ed5dd..3ee12fab0e73 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@
//CP : added by CP
#include <rtl/locale.h>
-#include <osl/nlsupport.h>
+#include <osl/nlsupport.h>
#include <osl/process.h>
#include <utility>
@@ -57,11 +57,11 @@ using ::com::sun::star::util::DateTime ;
/*Resturns the index withing rRawString where sTypeName starts and where it ends.
The starting index is pair.first. The ending index in pair.second points
one char after the last character of the type.
- sTypeName can be
+ sTypeName can be
"S" or "CN" (without ""). Do not use spaces at the beginning of the type name.
If the type name is not found then pair.first and pair.second are -1.
*/
-std::pair< sal_Int32, sal_Int32 >
+std::pair< sal_Int32, sal_Int32 >
findTypeInDN(const OUString& rRawString, const OUString& sTypeName)
{
std::pair< sal_Int32, sal_Int32 > retVal;
@@ -92,9 +92,9 @@ findTypeInDN(const OUString& rRawString, const OUString& sTypeName)
{
if (!bInEscape)
{
- //If this is the quote is the first of the couple which enclose the
+ //If this is the quote is the first of the couple which enclose the
//whole value, because the value contains special characters
- //then we just drop it. That is, this character must be followed by
+ //then we just drop it. That is, this character must be followed by
//a character which is not '"'.
if ( i + 1 < length && rRawString[i+1] == '"')
bInEscape = true;
@@ -103,15 +103,15 @@ findTypeInDN(const OUString& rRawString, const OUString& sTypeName)
}
else
{
- //This quote is escaped by a preceding quote and therefore is
+ //This quote is escaped by a preceding quote and therefore is
//part of the value
bInEscape = false;
}
}
else if (c == ',' || c == '+')
{
- //The comma separate the attribute value pairs.
- //If the comma is not part of a value (the value would then be enclosed in '"'),
+ //The comma separate the attribute value pairs.
+ //If the comma is not part of a value (the value would then be enclosed in '"'),
//then we have reached the end of the value
if (!bInValue)
{
@@ -154,16 +154,16 @@ findTypeInDN(const OUString& rRawString, const OUString& sTypeName)
/*
- MS Crypto uses the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise
+ MS Crypto uses the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise
it, so the 'S' tag should be changed to 'ST' tag. However I am not sure if this is necessary
- anymore, because we provide always the signers certificate when signing. So libmlsec can find
+ anymore, because we provide always the signers certificate when signing. So libmlsec can find
the private key based on the provided certificate (X509Certificate element) and does not need
the issuer name (X509IssuerName element). The issuer name in the xml signature has also no
effect for the signature nor the certificate validation.
In many RFCs, for example 4519, on speaks of 'ST'. However, the certificate does not contain
strings for type names. Instead it uses OIDs.
*/
-
+
OUString replaceTagSWithTagST(OUString oldDN)
{
std::pair<sal_Int32, sal_Int32 > pairIndex = findTypeInDN(oldDN, OUSTR("S"));
@@ -174,7 +174,7 @@ OUString replaceTagSWithTagST(OUString oldDN)
newDN += OUSTR("ST");
newDN += oldDN.copy(pairIndex.second);
return newDN;
- }
+ }
return oldDN;
}
/* end */
@@ -204,7 +204,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
Sequence< sal_Int8 > serial( m_pCertContext->pCertInfo->SerialNumber.cbData ) ;
for( unsigned int i = 0 ; i < m_pCertContext->pCertInfo->SerialNumber.cbData ; i ++ )
serial[i] = *( m_pCertContext->pCertInfo->SerialNumber.pbData + m_pCertContext->pCertInfo->SerialNumber.cbData - i - 1 ) ;
-
+
return serial ;
} else {
return NULL ;
@@ -261,9 +261,9 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
}
}
-::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException)
+::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException)
{
- if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL )
+ if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL )
{
wchar_t* subject ;
DWORD cbSubject ;
@@ -275,7 +275,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
NULL, 0
) ;
- if( cbSubject != 0 )
+ if( cbSubject != 0 )
{
subject = new wchar_t[ cbSubject ] ;
if( subject == NULL )
@@ -296,13 +296,13 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
OUString xSubject(reinterpret_cast<const sal_Unicode*>(subject));
delete [] subject ;
- return replaceTagSWithTagST(xSubject);
- } else
+ return replaceTagSWithTagST(xSubject);
+ } else
{
return OUString() ;
}
- }
- else
+ }
+ else
{
return OUString() ;
}
@@ -481,7 +481,7 @@ void X509Certificate_MSCryptImpl :: setRawCert( Sequence< sal_Int8 > rawCert ) t
/* XUnoTunnel */
sal_Int64 SAL_CALL X509Certificate_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw( RuntimeException ) {
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
return ( sal_Int64 )this ;
}
return 0 ;
@@ -522,7 +522,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
return OUString::createFromAscii( OIDs[i].desc );
}
}
-
+
return OUString() ;
}
@@ -539,7 +539,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
{
thumbprint[i] = fingerprint[i];
}
-
+
return thumbprint;
}
else
@@ -548,7 +548,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
cbData = e;
}
}
-
+
return NULL;
}
@@ -572,7 +572,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL )
{
CRYPT_BIT_BLOB publicKey = m_pCertContext->pCertInfo->SubjectPublicKeyInfo.PublicKey;
-
+
Sequence< sal_Int8 > key( publicKey.cbData ) ;
for( unsigned int i = 0 ; i < publicKey.cbData ; i++ )
{
@@ -586,7 +586,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
return NULL ;
}
}
-
+
::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl::getSignatureAlgorithm()
throw ( ::com::sun::star::uno::RuntimeException)
{
@@ -600,13 +600,13 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
return OUString() ;
}
}
-
+
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl::getSHA1Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException)
{
return getThumbprint(m_pCertContext, CERT_SHA1_HASH_PROP_ID);
}
-
+
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl::getMD5Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException)
{
@@ -616,7 +616,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c
sal_Int32 SAL_CALL X509Certificate_MSCryptImpl::getCertificateUsage( )
throw ( ::com::sun::star::uno::RuntimeException)
{
- sal_Int32 usage =
+ sal_Int32 usage =
CERT_DATA_ENCIPHERMENT_KEY_USAGE |
CERT_DIGITAL_SIGNATURE_KEY_USAGE |
CERT_KEY_AGREEMENT_KEY_USAGE |
@@ -625,18 +625,18 @@ sal_Int32 SAL_CALL X509Certificate_MSCryptImpl::getCertificateUsage( )
CERT_NON_REPUDIATION_KEY_USAGE |
CERT_OFFLINE_CRL_SIGN_KEY_USAGE;
- if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL && m_pCertContext->pCertInfo->cExtension != 0 )
+ if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL && m_pCertContext->pCertInfo->cExtension != 0 )
{
CERT_EXTENSION* pExtn = CertFindExtension(
szOID_KEY_USAGE,
m_pCertContext->pCertInfo->cExtension,
m_pCertContext->pCertInfo->rgExtension);
-
+
if (pExtn != NULL)
{
CERT_KEY_USAGE_RESTRICTION_INFO keyUsage;
DWORD length = sizeof(CERT_KEY_USAGE_RESTRICTION_INFO);
-
+
bool rc = CryptDecodeObject(
X509_ASN_ENCODING,
X509_KEY_USAGE,
@@ -644,15 +644,15 @@ sal_Int32 SAL_CALL X509Certificate_MSCryptImpl::getCertificateUsage( )
pExtn->Value.cbData,
CRYPT_DECODE_NOCOPY_FLAG,
(void *)&keyUsage,
- &length);
-
+ &length);
+
if (rc && keyUsage.RestrictedKeyUsage.cbData!=0)
{
usage = (sal_Int32)keyUsage.RestrictedKeyUsage.pbData;
- }
+ }
}
}
-
+
return usage;
}
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx
index f9eba3248c94..62bfb8a4b074 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -86,16 +86,16 @@ class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper2<
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectPublicKeyValue()
throw ( ::com::sun::star::uno::RuntimeException) ;
-
+
virtual ::rtl::OUString SAL_CALL getSignatureAlgorithm()
throw ( ::com::sun::star::uno::RuntimeException) ;
-
+
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSHA1Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException) ;
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMD5Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException) ;
-
+
virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ;
// MM : end
@@ -111,6 +111,6 @@ class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper2<
void setRawCert( ::com::sun::star::uno::Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) ;
} ;
-#endif // _X509CERTIFICATE_MSCRYPTIMPL_HXX_
+#endif // _X509CERTIFICATE_MSCRYPTIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx
index ab800b40b376..80d97b0b2ca9 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmlsecurity.hxx"
-
+
#include <sal/config.h>
#include <rtl/uuid.h>
#include "xmlencryption_mscryptimpl.hxx"
@@ -74,7 +74,7 @@ Reference< XXMLEncryptionTemplate >
SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
const Reference< XXMLEncryptionTemplate >& aTemplate ,
const Reference< XSecurityEnvironment >& aEnvironment
-) throw( com::sun::star::xml::crypto::XMLEncryptionException,
+) throw( com::sun::star::xml::crypto::XMLEncryptionException,
com::sun::star::uno::SecurityException )
{
xmlSecKeysMngrPtr pMngr = NULL ;
@@ -116,7 +116,7 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
pEncryptedData = pTemplate->getNativeElement() ;
- //Find the element to be encrypted.
+ //Find the element to be encrypted.
//This element is wrapped in the CipherValue sub-element.
xmlNodePtr pCipherData = pEncryptedData->children;
while (pCipherData != NULL && stricmp((const char *)(pCipherData->name), "CipherData"))
@@ -143,7 +143,7 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
if( pContent == NULL ) {
throw XMLEncryptionException() ;
}
-
+
xmlUnlinkNode(pContent);
xmlAddNextSibling(pEncryptedData, pContent);
@@ -187,7 +187,7 @@ SAL_CALL XMLEncryption_MSCryptImpl :: encrypt(
clearErrorRecorder();
return aTemplate;
}
- aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
+ aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
xmlSecEncCtxDestroy( pEncCtx ) ;
pSecEnv->destroyKeysManager( pMngr ) ; //i39448
@@ -210,7 +210,7 @@ Reference< XXMLEncryptionTemplate > SAL_CALL
XMLEncryption_MSCryptImpl :: decrypt(
const Reference< XXMLEncryptionTemplate >& aTemplate ,
const Reference< XXMLSecurityContext >& aSecurityCtx
-) throw( com::sun::star::xml::crypto::XMLEncryptionException ,
+) throw( com::sun::star::xml::crypto::XMLEncryptionException ,
com::sun::star::uno::SecurityException) {
xmlSecKeysMngrPtr pMngr = NULL ;
xmlSecEncCtxPtr pEncCtx = NULL ;
@@ -223,7 +223,7 @@ XMLEncryption_MSCryptImpl :: decrypt(
throw RuntimeException() ;
//Get Keys Manager
- Reference< XSecurityEnvironment > xSecEnv
+ Reference< XSecurityEnvironment > xSecEnv
= aSecurityCtx->getSecurityEnvironmentByIndex(
aSecurityCtx->getDefaultSecurityEnvironmentIndex());
Reference< XUnoTunnel > xSecTunnel( xSecEnv , UNO_QUERY ) ;
@@ -290,7 +290,7 @@ XMLEncryption_MSCryptImpl :: decrypt(
aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN);
xmlSecEncCtxDestroy( pEncCtx ) ;
pSecEnv->destroyKeysManager( pMngr ) ; //i39448
-
+
//throw XMLEncryptionException() ;
clearErrorRecorder();
return aTemplate;
@@ -299,7 +299,7 @@ XMLEncryption_MSCryptImpl :: decrypt(
/*----------------------------------------
if( pEncCtx->resultReplaced != 0 ) {
pContent = pEncryptedData ;
-
+
Reference< XUnoTunnel > xTunnel( ret , UNO_QUERY ) ;
if( !xTunnel.is() ) {
xmlSecEncCtxDestroy( pEncCtx ) ;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx
index 539c9afff55f..47b621ea1fc1 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -95,6 +95,6 @@ class XMLEncryption_MSCryptImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
} ;
-#endif // _XMLENCRYPTION_MSCRYPTIMPL_HXX_
+#endif // _XMLENCRYPTION_MSCRYPTIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx
index 52f3cc3b983d..3204ba85bfba 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,10 +49,10 @@ using ::rtl::OUString ;
using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
-XMLSecurityContext_MSCryptImpl :: XMLSecurityContext_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory )
+XMLSecurityContext_MSCryptImpl :: XMLSecurityContext_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory )
://m_pKeysMngr( NULL ) ,
m_xServiceManager( aFactory ),
- m_xSecurityEnvironment( NULL )
+ m_xSecurityEnvironment( NULL )
{
//Init xmlsec library
if( xmlSecInit() < 0 ) {
@@ -88,7 +88,7 @@ sal_Int32 SAL_CALL XMLSecurityContext_MSCryptImpl::addSecurityEnvironment(
{
throw RuntimeException() ;
}
-
+
m_xSecurityEnvironment = aSecurityEnvironment;
return 0;
@@ -100,7 +100,7 @@ sal_Int32 SAL_CALL XMLSecurityContext_MSCryptImpl::getSecurityEnvironmentNumber(
{
return 1;
}
-
+
::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
XMLSecurityContext_MSCryptImpl::getSecurityEnvironmentByIndex( sal_Int32 index )
throw (::com::sun::star::uno::RuntimeException)
@@ -112,9 +112,9 @@ sal_Int32 SAL_CALL XMLSecurityContext_MSCryptImpl::getSecurityEnvironmentNumber(
else
throw RuntimeException() ;
}
-
-::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
- XMLSecurityContext_MSCryptImpl::getSecurityEnvironment( )
+
+::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
+ XMLSecurityContext_MSCryptImpl::getSecurityEnvironment( )
throw (::com::sun::star::uno::RuntimeException)
{
return m_xSecurityEnvironment;
@@ -245,10 +245,10 @@ void SAL_CALL XMLSecurityContext_MSCryptImpl :: setSecurityEnvironment( const Re
}
/* XXMLSecurityContext */
-Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSecurityEnvironment()
+Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSecurityEnvironment()
throw (RuntimeException)
{
- return m_xSecurityEnvironment ;
+ return m_xSecurityEnvironment ;
}
#endif
@@ -304,10 +304,10 @@ Reference< XSingleServiceFactory > XMLSecurityContext_MSCryptImpl :: impl_create
#if 0
/* XUnoTunnel */
-sal_Int64 SAL_CALL XMLSecurityContext_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
+sal_Int64 SAL_CALL XMLSecurityContext_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
throw (RuntimeException)
{
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
return ( sal_Int64 )this ;
}
return 0 ;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx
index dfc8217aa957..29ad6bc712e0 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -63,27 +63,27 @@ class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3<
virtual sal_Int32 SAL_CALL addSecurityEnvironment(
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment
) throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException);
-
+
virtual ::sal_Int32 SAL_CALL getSecurityEnvironmentNumber( )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual ::com::sun::star::uno::Reference<
::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
getSecurityEnvironmentByIndex( ::sal_Int32 index )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
- getSecurityEnvironment( )
+ ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
+ getSecurityEnvironment( )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual ::sal_Int32 SAL_CALL getDefaultSecurityEnvironmentIndex( )
throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex )
throw (::com::sun::star::uno::RuntimeException);
-#if 0
+#if 0
virtual void SAL_CALL setSecurityEnvironment(
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment
) throw( com::sun::star::security::SecurityInfrastructureException) ;
@@ -118,7 +118,7 @@ class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3<
#if 0
//Methods from XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
throw (com::sun::star::uno::RuntimeException);
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
@@ -129,6 +129,6 @@ class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3<
//virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
} ;
-#endif // _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
+#endif // _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
index e7fa7f96aa68..25c7825e702c 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -73,7 +73,7 @@ Reference< XXMLSignatureTemplate >
SAL_CALL XMLSignature_MSCryptImpl :: generate(
const Reference< XXMLSignatureTemplate >& aTemplate ,
const Reference< XSecurityEnvironment >& aEnvironment
-) throw( com::sun::star::xml::crypto::XMLSignatureException,
+) throw( com::sun::star::xml::crypto::XMLSignatureException,
com::sun::star::uno::SecurityException )
{
xmlSecKeysMngrPtr pMngr = NULL ;
@@ -140,7 +140,7 @@ SAL_CALL XMLSignature_MSCryptImpl :: generate(
}
//Sign the template
- if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 )
+ if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 )
{
if (pDsigCtx->status == xmlSecDSigStatusSucceeded)
aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
@@ -169,8 +169,8 @@ Reference< XXMLSignatureTemplate >
SAL_CALL XMLSignature_MSCryptImpl :: validate(
const Reference< XXMLSignatureTemplate >& aTemplate ,
const Reference< XXMLSecurityContext >& aSecurityCtx
-) throw( com::sun::star::uno::RuntimeException,
- com::sun::star::uno::SecurityException,
+) throw( com::sun::star::uno::RuntimeException,
+ com::sun::star::uno::SecurityException,
com::sun::star::xml::crypto::XMLSignatureException ) {
xmlSecKeysMngrPtr pMngr = NULL ;
xmlSecDSigCtxPtr pDsigCtx = NULL ;
@@ -184,7 +184,7 @@ SAL_CALL XMLSignature_MSCryptImpl :: validate(
throw RuntimeException() ;
//Get Keys Manager
- Reference< XSecurityEnvironment > xSecEnv
+ Reference< XSecurityEnvironment > xSecEnv
= aSecurityCtx->getSecurityEnvironmentByIndex(
aSecurityCtx->getDefaultSecurityEnvironmentIndex());
Reference< XUnoTunnel > xSecTunnel( xSecEnv , UNO_QUERY ) ;
@@ -267,12 +267,12 @@ SAL_CALL XMLSignature_MSCryptImpl :: validate(
xmlSecDSigCtxDestroy( pDsigCtx ) ;
pSecEnv->destroyKeysManager( pMngr ) ; //i39448
-
+
//Unregistered the stream/URI binding
if( xUriBinding.is() )
xmlUnregisterStreamInputCallbacks() ;
-
-
+
+
clearErrorRecorder();
return aTemplate;
}
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx
index d31050484548..bc5af5ecf14b 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -67,7 +67,7 @@ class XMLSignature_MSCryptImpl : public ::cppu::WeakImplHelper3<
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& aTemplate ,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext >& aContext
) throw( com::sun::star::uno::RuntimeException,
- com::sun::star::uno::SecurityException,
+ com::sun::star::uno::SecurityException,
com::sun::star::xml::crypto::XMLSignatureException);
//Methods from XInitialization
@@ -95,6 +95,6 @@ class XMLSignature_MSCryptImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
} ;
-#endif // _XMLSIGNATURE_MSCRYPTIMPL_HXX_
+#endif // _XMLSIGNATURE_MSCRYPTIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx b/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx
index c9ba623d2140..918d076567de 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,7 +62,7 @@ sal_Bool SAL_CALL mscrypt_component_writeInfo( void* /*pServiceManager*/ , void*
Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ;
if( xKey.is() ) {
- // try {
+ // try {
// XMLSignature_MSCryptImpl
sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ;
sKeyName += XMLSignature_MSCryptImpl::impl_getImplementationName() ;
@@ -122,11 +122,11 @@ sal_Bool SAL_CALL mscrypt_component_writeInfo( void* /*pServiceManager*/ , void*
for( i = seqServices.getLength() ; i -- ; )
xNewKey->createKey( seqServices.getConstArray()[i] ) ;
}
-
+
return sal_True;
//} catch( InvalidRegistryException & ) {
- // //we should not ignore exceptions
- // return sal_False ;
+ // //we should not ignore exceptions
+ // return sal_False ;
//}
}
return result;
diff --git a/xmlsecurity/source/xmlsec/nss/certerrors.h b/xmlsecurity/source/xmlsec/nss/certerrors.h
index a587792b448d..c2b96c2944ee 100644
--- a/xmlsecurity/source/xmlsec/nss/certerrors.h
+++ b/xmlsecurity/source/xmlsec/nss/certerrors.h
@@ -102,8 +102,8 @@
{SEC_ERROR_EXTENSION_NOT_FOUND, "Certificate extension not found."},
{SEC_ERROR_CA_CERT_INVALID, "Issuer certificate is invalid."},
-
-{SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID, "Certificate path length constraint is invalid."},
+
+{SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID, "Certificate path length constraint is invalid."},
{SEC_ERROR_CERT_USAGES_INVALID, "Certificate usages field is invalid."},
@@ -138,7 +138,7 @@ Please remove it and return it to your issuer."},
{XP_SEC_FORTEZZA_NO_CARD, "No Fortezza cards Found"},
-{XP_SEC_FORTEZZA_NONE_SELECTED, "No Fortezza card selected"},
+{XP_SEC_FORTEZZA_NONE_SELECTED, "No Fortezza card selected"},
{XP_SEC_FORTEZZA_MORE_INFO, "Please select a personality to get more info on"},
@@ -221,13 +221,13 @@ Please remove it and return it to your issuer."},
{SEC_ERROR_CERT_ADDR_MISMATCH, "Address in signing certificate does not match address in message headers."},
-{SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY, "Unable to import. Error attempting to import private key."},
+{SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY, "Unable to import. Error attempting to import private key."},
-{SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN, "Unable to import. Error attempting to import certificate chain."},
+{SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN, "Unable to import. Error attempting to import certificate chain."},
{SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME, "Unable to export. Unable to locate certificate or key by nickname."},
-{SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY, "Unable to export. Private Key could not be located and exported."},
+{SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY, "Unable to export. Private Key could not be located and exported."},
{SEC_ERROR_PKCS12_UNABLE_TO_WRITE, "Unable to export. Unable to write the export file."},
@@ -256,7 +256,7 @@ Please remove it and return it to your issuer."},
{SEC_ERROR_JS_DEL_MOD_FAILURE, "Unable to delete module"},
{SEC_ERROR_OLD_KRL, "New KRL is not later than the current one."},
-
+
{SEC_ERROR_CKL_CONFLICT, "New CKL has different issuer than current CKL. Delete current CKL."},
{SEC_ERROR_CERT_NOT_IN_NAME_SPACE, "The Certifying Authority for this certificate is not permitted to issue a \
@@ -338,9 +338,9 @@ an existing cert, but that is not the same cert."},
{SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION, "Issuer's V2 Certificate Revocation List has an unknown critical extension."},
-{SEC_ERROR_UNKNOWN_OBJECT_TYPE, "Unknown object type specified."},
+{SEC_ERROR_UNKNOWN_OBJECT_TYPE, "Unknown object type specified."},
-{SEC_ERROR_INCOMPATIBLE_PKCS11, "PKCS #11 driver violates the spec in an incompatible way."},
+{SEC_ERROR_INCOMPATIBLE_PKCS11, "PKCS #11 driver violates the spec in an incompatible way."},
{SEC_ERROR_NO_EVENT, "No new slot event is available at this time."},
diff --git a/xmlsecurity/source/xmlsec/nss/nssrenam.h b/xmlsecurity/source/xmlsec/nss/nssrenam.h
index bc3249e1bfc4..903aded42d1e 100644
--- a/xmlsecurity/source/xmlsec/nss/nssrenam.h
+++ b/xmlsecurity/source/xmlsec/nss/nssrenam.h
@@ -4,25 +4,25 @@
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
- *
+ *
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
- *
+ *
* The Original Code is the Netscape security libraries.
- *
+ *
* The Initial Developer of the Original Code is Netscape
- * Communications Corporation. Portions created by Netscape are
+ * Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
- *
+ *
* Contributor(s):
- *
+ *
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
+ * "GPL"), in which case the provisions of the GPL are applicable
+ * instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
diff --git a/xmlsecurity/source/xmlsec/nss/secerror.cxx b/xmlsecurity/source/xmlsec/nss/secerror.cxx
index cc7fdd27e0f5..8c44540fce6e 100644
--- a/xmlsecurity/source/xmlsec/nss/secerror.cxx
+++ b/xmlsecurity/source/xmlsec/nss/secerror.cxx
@@ -40,7 +40,7 @@
using namespace xmlsecurity;
struct ErrDesc {
- PRErrorCode errNum;
+ PRErrorCode errNum;
const char * errString;
};
@@ -50,7 +50,7 @@ const ErrDesc allDesc[] = {
#include "certerrors.h"
-};
+};
@@ -79,7 +79,7 @@ printChainFailure(CERTVerifyLog *log)
const char * specificError = NULL;
const char * issuer = NULL;
CERTVerifyLogNode *node = NULL;
-
+
if (log->count > 0)
{
xmlsec_trace("Bad certifcation path:");
@@ -89,7 +89,7 @@ printChainFailure(CERTVerifyLog *log)
{
depth = node->depth;
xmlsec_trace("Certificate: %d. %s %s:", depth,
- node->cert->subjectName,
+ node->cert->subjectName,
depth ? "[Certificate Authority]": "");
}
xmlsec_trace(" ERROR %ld: %s", node->error,
@@ -161,7 +161,7 @@ printChainFailure(CERTVerifyLog *log)
xmlsec_trace("%s", specificError);
if (issuer)
xmlsec_trace("%s", issuer);
- }
+ }
}
}
diff --git a/xmlsecurity/source/xmlsec/nss/secerror.hxx b/xmlsecurity/source/xmlsec/nss/secerror.hxx
index 34f81cb4023d..4f7468eb914e 100644
--- a/xmlsecurity/source/xmlsec/nss/secerror.hxx
+++ b/xmlsecurity/source/xmlsec/nss/secerror.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,6 +37,6 @@ getCertError(PRErrorCode errNum);
void
printChainFailure(CERTVerifyLog *log);
-#endif // _XSECERROR_HXX_
+#endif // _XSECERROR_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 87b02e948d34..3643491cc311 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -90,10 +90,10 @@ struct UsageDescription
SECCertificateUsage usage;
char const * const description;
};
+
-
-char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ )
+char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ )
{
uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
if ( xMSF.is() )
@@ -212,10 +212,10 @@ Reference< XSingleServiceFactory > SecurityEnvironment_NssImpl :: impl_createFac
}
/* XUnoTunnel */
-sal_Int64 SAL_CALL SecurityEnvironment_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
+sal_Int64 SAL_CALL SecurityEnvironment_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
throw( RuntimeException )
{
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;
@@ -258,7 +258,7 @@ SecurityEnvironment_NssImpl* SecurityEnvironment_NssImpl :: getImplementation( c
return buff.makeStringAndClear();
}
-void SecurityEnvironment_NssImpl::addCryptoSlot( PK11SlotInfo* aSlot) throw( Exception , RuntimeException )
+void SecurityEnvironment_NssImpl::addCryptoSlot( PK11SlotInfo* aSlot) throw( Exception , RuntimeException )
{
PK11_ReferenceSlot(aSlot);
m_Slots.push_back(aSlot);
@@ -274,7 +274,7 @@ void SecurityEnvironment_NssImpl :: setCertDb( CERTCertDBHandle* aCertDb ) throw
}
void SecurityEnvironment_NssImpl :: adoptSymKey( PK11SymKey* aSymKey ) throw( Exception , RuntimeException ) {
- PK11SymKey* symkey ;
+ PK11SymKey* symkey ;
std::list< PK11SymKey* >::iterator keyIt ;
if( aSymKey != NULL ) {
@@ -298,7 +298,7 @@ void SecurityEnvironment_NssImpl :: adoptSymKey( PK11SymKey* aSymKey ) throw( Ex
}
void SecurityEnvironment_NssImpl :: rejectSymKey( PK11SymKey* aSymKey ) throw( Exception , RuntimeException ) {
- PK11SymKey* symkey ;
+ PK11SymKey* symkey ;
std::list< PK11SymKey* >::iterator keyIt ;
if( aSymKey != NULL ) {
@@ -328,7 +328,7 @@ PK11SymKey* SecurityEnvironment_NssImpl :: getSymKey( unsigned int position ) th
}
void SecurityEnvironment_NssImpl :: adoptPubKey( SECKEYPublicKey* aPubKey ) throw( Exception , RuntimeException ) {
- SECKEYPublicKey* pubkey ;
+ SECKEYPublicKey* pubkey ;
std::list< SECKEYPublicKey* >::iterator keyIt ;
if( aPubKey != NULL ) {
@@ -352,7 +352,7 @@ void SecurityEnvironment_NssImpl :: adoptPubKey( SECKEYPublicKey* aPubKey ) thro
}
void SecurityEnvironment_NssImpl :: rejectPubKey( SECKEYPublicKey* aPubKey ) throw( Exception , RuntimeException ) {
- SECKEYPublicKey* pubkey ;
+ SECKEYPublicKey* pubkey ;
std::list< SECKEYPublicKey* >::iterator keyIt ;
if( aPubKey != NULL ) {
@@ -382,7 +382,7 @@ SECKEYPublicKey* SecurityEnvironment_NssImpl :: getPubKey( unsigned int position
}
void SecurityEnvironment_NssImpl :: adoptPriKey( SECKEYPrivateKey* aPriKey ) throw( Exception , RuntimeException ) {
- SECKEYPrivateKey* prikey ;
+ SECKEYPrivateKey* prikey ;
std::list< SECKEYPrivateKey* >::iterator keyIt ;
if( aPriKey != NULL ) {
@@ -406,7 +406,7 @@ void SecurityEnvironment_NssImpl :: adoptPriKey( SECKEYPrivateKey* aPriKey ) thr
}
void SecurityEnvironment_NssImpl :: rejectPriKey( SECKEYPrivateKey* aPriKey ) throw( Exception , RuntimeException ) {
- SECKEYPrivateKey* prikey ;
+ SECKEYPrivateKey* prikey ;
std::list< SECKEYPrivateKey* >::iterator keyIt ;
if( aPriKey != NULL ) {
@@ -444,38 +444,38 @@ void SecurityEnvironment_NssImpl::updateSlots()
PK11SymKey * pSymKey = NULL;
osl::MutexGuard guard(m_mutex);
-
+
m_Slots.clear();
m_tSymKeyList.clear();
soltList = PK11_GetAllTokens( CKM_INVALID_MECHANISM, PR_FALSE, PR_FALSE, NULL ) ;
- if( soltList != NULL )
+ if( soltList != NULL )
{
- for( soltEle = soltList->head ; soltEle != NULL; soltEle = soltEle->next )
+ for( soltEle = soltList->head ; soltEle != NULL; soltEle = soltEle->next )
{
pSlot = soltEle->slot ;
-
+
if(pSlot != NULL)
{
RTL_LOGFILE_TRACE2( "XMLSEC: Found a slot: SlotName=%s, TokenName=%s", PK11_GetSlotName(pSlot), PK11_GetTokenName(pSlot) );
//The following code which is commented out checks if a slot, that is a smart card for example, is
-// able to generate a symmetric key of type CKM_DES3_CBC. If this fails then this token
-// will not be used. This key is possibly used for the encryption service. However, all
-// interfaces and services used for public key signature and encryption are not published
-// and the encryption is not used in OOo. Therefore it does not do any harm to remove
-// this code, hence allowing smart cards which cannot generate this type of key.
+// able to generate a symmetric key of type CKM_DES3_CBC. If this fails then this token
+// will not be used. This key is possibly used for the encryption service. However, all
+// interfaces and services used for public key signature and encryption are not published
+// and the encryption is not used in OOo. Therefore it does not do any harm to remove
+// this code, hence allowing smart cards which cannot generate this type of key.
//
// By doing this, the encryption may fail if a smart card is being used which does not
// support this key generation.
-//
+//
pSymKey = PK11_KeyGen( pSlot , CKM_DES3_CBC, NULL, 128, NULL ) ;
-// if( pSymKey == NULL )
-// {
-// PK11_FreeSlot( pSlot ) ;
-// RTL_LOGFILE_TRACE( "XMLSEC: Error - pSymKey is NULL" );
-// continue;
-// }
+// if( pSymKey == NULL )
+// {
+// PK11_FreeSlot( pSlot ) ;
+// RTL_LOGFILE_TRACE( "XMLSEC: Error - pSymKey is NULL" );
+// continue;
+// }
addCryptoSlot(pSlot);
PK11_FreeSlot( pSlot ) ;
pSlot = NULL;
@@ -489,18 +489,18 @@ void SecurityEnvironment_NssImpl::updateSlots()
}// end of if(pSlot != NULL)
}// end of for
- }// end of if( soltList != NULL )
+ }// end of if( soltList != NULL )
}
-Sequence< Reference < XCertificate > >
-SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException , RuntimeException )
+Sequence< Reference < XCertificate > >
+SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException , RuntimeException )
{
sal_Int32 length ;
X509Certificate_NssImpl* xcert ;
std::list< X509Certificate_NssImpl* > certsList ;
-
+
updateSlots();
//firstly, we try to find private keys in slot
for (CIT_SLOTS is = m_Slots.begin(); is != m_Slots.end(); is++)
@@ -513,16 +513,16 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException
SECStatus nRet = PK11_Authenticate(slot, PR_TRUE, NULL);
//PK11_Authenticate may fail in case the a slot has not been initialized.
//this is the case if the user has a new profile, so that they have never
- //added a personal certificate.
+ //added a personal certificate.
if( nRet != SECSuccess && PORT_GetError() != SEC_ERROR_IO) {
throw NoPasswordException();
}
- }
-
+ }
+
priKeyList = PK11_ListPrivateKeysInSlot(slot) ;
if( priKeyList != NULL ) {
- for( curPri = PRIVKEY_LIST_HEAD( priKeyList );
- !PRIVKEY_LIST_END( curPri, priKeyList ) && curPri != NULL ;
+ for( curPri = PRIVKEY_LIST_HEAD( priKeyList );
+ !PRIVKEY_LIST_END( curPri, priKeyList ) && curPri != NULL ;
curPri = PRIVKEY_LIST_NEXT( curPri ) ) {
xcert = NssPrivKeyToXCert( curPri->key ) ;
if( xcert != NULL )
@@ -560,7 +560,7 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException
return Sequence< Reference < XCertificate > > ();
}
-Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const OUString& issuerName, const Sequence< sal_Int8 >& serialNumber ) throw( SecurityException , RuntimeException )
+Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const OUString& issuerName, const Sequence< sal_Int8 >& serialNumber ) throw( SecurityException , RuntimeException )
{
X509Certificate_NssImpl* xcert = NULL;
@@ -577,13 +577,13 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O
throw RuntimeException() ;
/*
- * mmi : because MS Crypto use the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise
+ * mmi : because MS Crypto use the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise
* it, so the 'S' tag should be changed to 'ST' tag
*
* PS : it can work, but inside libxmlsec, the 'S' tag is till used to find cert in NSS engine, so it
* is not useful at all. (comment out now)
*/
-
+
/*
sal_Int32 nIndex = 0;
OUString newIssuerName;
@@ -599,16 +599,16 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O
{
newIssuerName+=aToken;
}
-
+
if (nIndex >= 0)
{
newIssuerName+=OUString::createFromAscii(",");
}
} while ( nIndex >= 0 );
*/
-
+
/* end */
-
+
//Create cert info from issue and serial
rtl::OString ostr = rtl::OUStringToOString( issuerName , RTL_TEXTENCODING_UTF8 ) ;
chIssuer = PL_strndup( ( char* )ostr.getStr(), ( int )ostr.getLength() ) ;
@@ -616,7 +616,7 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O
if( nmIssuer == NULL ) {
PL_strfree( chIssuer ) ;
PORT_FreeArena( arena, PR_FALSE ) ;
-
+
/*
* i40394
*
@@ -775,7 +775,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
xmlsec_trace("Start verification of certificate: \n %s \n",
OUStringToOString(
aCert->getSubjectName(), osl_getThreadTextEncoding()).getStr());
-
+
xcert = reinterpret_cast<X509Certificate_NssImpl*>(
sal::static_int_cast<sal_uIntPtr>(xCertTunnel->getSomething( X509Certificate_NssImpl::getUnoTunnelId() ))) ;
if( xcert == NULL ) {
@@ -788,7 +788,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
OSL_ASSERT(m_pHandler == CERT_GetDefaultCertDB());
CERTCertDBHandle * certDb = m_pHandler != NULL ? m_pHandler : CERT_GetDefaultCertDB();
cert = xcert->getNssCert() ;
- if( cert != NULL )
+ if( cert != NULL )
{
//prepare the intermediate certificates
@@ -799,10 +799,10 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
item.type = siBuffer;
item.data = (unsigned char*)der.getArray();
item.len = der.getLength();
-
- CERTCertificate* certTmp = CERT_NewTempCertificate(certDb, &item,
- NULL /* nickname */,
- PR_FALSE /* isPerm */,
+
+ CERTCertificate* certTmp = CERT_NewTempCertificate(certDb, &item,
+ NULL /* nickname */,
+ PR_FALSE /* isPerm */,
PR_TRUE /* copyDER */);
if (!certTmp)
{
@@ -818,7 +818,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
vecTmpNSSCertificates.push_back(certTmp);
}
}
-
+
SECStatus status ;
@@ -826,7 +826,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
log.arena = PORT_NewArena(512);
log.head = log.tail = NULL;
log.count = 0;
-
+
CERT_EnableOCSPChecking(certDb);
CERT_DisableOCSPDefaultResponder(certDb);
CERTValOutParam cvout[5];
@@ -866,10 +866,10 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
| CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE;
rev.leafTests.number_of_preferred_methods = 0;
rev.leafTests.preferred_methods = NULL;
- rev.leafTests.cert_rev_method_independent_flags =
+ rev.leafTests.cert_rev_method_independent_flags =
CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST;
// | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE;
-
+
rev.chainTests.number_of_defined_methods = 2;
rev.chainTests.cert_rev_flags_per_method = revFlagsChain;
rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_crl] =
@@ -880,11 +880,11 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
| CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE;
rev.chainTests.number_of_preferred_methods = 0;
rev.chainTests.preferred_methods = NULL;
- rev.chainTests.cert_rev_method_independent_flags =
+ rev.chainTests.cert_rev_method_independent_flags =
CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST;
// | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE;
-
+
cvin[ncvinCount].type = cert_pi_revocationFlags;
cvin[ncvinCount].value.pointer.revocation = &rev;
ncvinCount++;
@@ -899,7 +899,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
cvout[1].type = cert_po_errorLog;
cvout[1].value.pointer.log = &log;
cvout[2].type = cert_po_end;
-
+
// We check SSL server certificates, CA certificates and signing sertificates.
//
// ToDo check keyusage, looking at CERT_KeyUsageAndTypeForCertUsage (
@@ -912,8 +912,8 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
// certificateUsageUserCertImport
// certificateUsageVerifyCA
// certificateUsageAnyCA
- // certificateUsageProtectedObjectSigner
-
+ // certificateUsageProtectedObjectSigner
+
UsageDescription arUsages[] =
{
{certificateUsageSSLClient, "certificateUsageSSLClient" },
@@ -928,10 +928,10 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
{
xmlsec_trace("Testing usage %d of %d: %s (0x%x)", i + 1,
numUsages, arUsages[i].description, (int) arUsages[i].usage);
-
+
status = CERT_PKIXVerifyCert(const_cast<CERTCertificate *>(cert), arUsages[i].usage,
cvin, cvout, NULL);
- if( status == SECSuccess )
+ if( status == SECSuccess )
{
xmlsec_trace("CERT_PKIXVerifyCert returned SECSuccess.");
//When an intermediate or root certificate is checked then we expect the usage
@@ -975,10 +975,10 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
xmlsec_trace("Certificate is invalid.\n");
}
}
-
+
}
- else
- {
+ else
+ {
validity = ::com::sun::star::security::CertificateValidity::INVALID ;
}
@@ -992,7 +992,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
return validity ;
}
-sal_Int32 SecurityEnvironment_NssImpl::getCertificateCharacters(
+sal_Int32 SecurityEnvironment_NssImpl::getCertificateCharacters(
const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& aCert ) throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException ) {
sal_Int32 characters ;
const X509Certificate_NssImpl* xcert ;
@@ -1021,7 +1021,7 @@ sal_Int32 SecurityEnvironment_NssImpl::getCertificateCharacters(
}
//Secondly, find out whether or not the cert has a private key.
-
+
/*
* i40394
*
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
index 64996a3cee8c..5bd22137dd23 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -67,16 +67,16 @@ class SecurityEnvironment_NssImpl : public ::cppu::WeakImplHelper4<
::com::sun::star::lang::XUnoTunnel >
{
private :
-
+
std::list< PK11SlotInfo* > m_Slots;
typedef std::list< PK11SlotInfo* >::const_iterator CIT_SLOTS;
osl::Mutex m_mutex;
-
- CERTCertDBHandle* m_pHandler ;
- std::list< PK11SymKey* > m_tSymKeyList ;
- std::list< SECKEYPublicKey* > m_tPubKeyList ;
- std::list< SECKEYPrivateKey* > m_tPriKeyList ;
+
+ CERTCertDBHandle* m_pHandler ;
+ std::list< PK11SymKey* > m_tSymKeyList ;
+ std::list< SECKEYPublicKey* > m_tPubKeyList ;
+ std::list< SECKEYPrivateKey* > m_tPriKeyList ;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
public :
@@ -122,7 +122,7 @@ private :
virtual ::rtl::OUString SAL_CALL getSecurityEnvironmentInformation( ) throw (::com::sun::star::uno::RuntimeException);
//Methods from XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
throw (::com::sun::star::uno::RuntimeException);
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
@@ -176,6 +176,6 @@ private:
} ;
-#endif // _XSECURITYENVIRONMENT_NSSIMPL_HXX_
+#endif // _XSECURITYENVIRONMENT_NSSIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
index f12632d3da67..71a62eb1b307 100644
--- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -113,7 +113,7 @@ struct InitNSSInitialize
if (bNSSInit)
atexit(nsscrypto_finalize );
return & bInitialized;
-
+
}
};
@@ -130,11 +130,11 @@ void deleteRootsModule()
SECMODModuleList *list = SECMOD_GetDefaultModuleList();
SECMODListLock *lock = SECMOD_GetDefaultModuleListLock();
SECMOD_GetReadLock(lock);
-
+
while (!RootsModule && list)
{
SECMODModule *module = list->module;
-
+
for (int i=0; i < module->slotCount; i++)
{
PK11SlotInfo *slot = module->slots[i];
@@ -154,7 +154,7 @@ void deleteRootsModule()
list = list->next;
}
SECMOD_ReleaseReadLock(lock);
-
+
if (RootsModule)
{
PRInt32 modType;
@@ -208,7 +208,7 @@ bool nsscrypto_initialize( const char* token, bool & out_nss_init )
{
xmlsec_trace("Initializing NSS with profile failed.");
char * error = NULL;
-
+
PR_GetErrorText(error);
if (error)
xmlsec_trace("%s",error);
@@ -229,20 +229,20 @@ bool nsscrypto_initialize( const char* token, bool & out_nss_init )
}
}
out_nss_init = true;
-
+
#if defined SYSTEM_MOZILLA
if (!SECMOD_HasRootCerts())
{
#endif
deleteRootsModule();
-
+
#if defined SYSTEM_MOZILLA
OUString rootModule(RTL_CONSTASCII_USTRINGPARAM("libnssckbi"SAL_DLLEXTENSION));
#else
OUString rootModule(RTL_CONSTASCII_USTRINGPARAM("${OOO_BASE_DIR}/program/libnssckbi"SAL_DLLEXTENSION));
#endif
::rtl::Bootstrap::expandMacros(rootModule);
-
+
OUString rootModulePath;
if (::osl::File::E_None == ::osl::File::getSystemPathFromFileURL(rootModule, rootModulePath))
{
@@ -253,18 +253,18 @@ bool nsscrypto_initialize( const char* token, bool & out_nss_init )
pkcs11moduleSpec.append("\" library=\"");
pkcs11moduleSpec.append(ospath.getStr());
pkcs11moduleSpec.append("\"");
-
+
SECMODModule * RootsModule =
SECMOD_LoadUserModule(
- const_cast<char*>(pkcs11moduleSpec.makeStringAndClear().getStr()),
- 0, // no parent
+ const_cast<char*>(pkcs11moduleSpec.makeStringAndClear().getStr()),
+ 0, // no parent
PR_FALSE); // do not recurse
-
+
if (RootsModule)
{
-
+
bool found = RootsModule->loaded;
-
+
SECMOD_DestroyModule(RootsModule);
RootsModule = 0;
if (found)
@@ -305,7 +305,7 @@ extern "C" void nsscrypto_finalize()
if (RootsModule)
{
-
+
if (SECSuccess == SECMOD_UnloadUserModule(RootsModule))
{
xmlsec_trace("Unloaded module \""ROOT_CERTS"\".");
@@ -332,7 +332,7 @@ bool getMozillaCurrentProfile(
{
/*
* first, try to get the profile from "MOZILLA_CERTIFICATE_FOLDER"
- */
+ */
char * env = getenv("MOZILLA_CERTIFICATE_FOLDER");
if (env)
{
@@ -348,21 +348,21 @@ bool getMozillaCurrentProfile(
mozilla::MozillaProductType_Firefox,
mozilla::MozillaProductType_Default };
int nProduct = 4;
-
+
uno::Reference<uno::XInterface> xInstance = rxMSF->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) );
OSL_ENSURE( xInstance.is(), "failed to create instance" );
-
- uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap
+
+ uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap
= uno::Reference<mozilla::XMozillaBootstrap>(xInstance,uno::UNO_QUERY);
OSL_ENSURE( xMozillaBootstrap.is(), "failed to create instance" );
-
+
if (xMozillaBootstrap.is())
{
for (int i=0; i<nProduct; i++)
{
::rtl::OUString profile = xMozillaBootstrap->getDefaultProfile(productTypes[i]);
-
+
if (profile != NULL && profile.getLength()>0)
{
profilePath = xMozillaBootstrap->getProfilePath(productTypes[i],profile);
@@ -371,7 +371,7 @@ bool getMozillaCurrentProfile(
}
}
}
-
+
RTL_LOGFILE_PRODUCT_TRACE( "XMLSEC: No Mozilla Profile found!" );
return false;
}
@@ -385,12 +385,12 @@ SEInitializer_NssImpl::SEInitializer_NssImpl(
{
}
-SEInitializer_NssImpl::~SEInitializer_NssImpl()
+SEInitializer_NssImpl::~SEInitializer_NssImpl()
{
}
/* XSEInitializer */
-cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
+cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
SEInitializer_NssImpl::createSecurityContext(
const rtl::OUString& sCertDB )
throw (cssu::RuntimeException)
@@ -398,7 +398,7 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
CERTCertDBHandle *pCertHandle = NULL ;
rtl::OString sCertDir;
- if( sCertDB.getLength() )
+ if( sCertDB.getLength() )
{
sCertDir = rtl::OString(sCertDB, sCertDB.getLength(), RTL_TEXTENCODING_ASCII_US);
}
@@ -407,7 +407,7 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
static rtl::OString* pDefaultCertDir = NULL;
if ( !pDefaultCertDir )
{
- pDefaultCertDir = new rtl::OString;
+ pDefaultCertDir = new rtl::OString;
rtl::OUString ouCertDir;
@@ -416,7 +416,7 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
*pDefaultCertDir = rtl::OString(ouCertDir, ouCertDir.getLength(), RTL_TEXTENCODING_ASCII_US);
}
sCertDir = *pDefaultCertDir;
-
+
}
if( ! *initNSS( sCertDir.getStr() ) )
@@ -426,24 +426,24 @@ cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL
pCertHandle = CERT_GetDefaultCertDB() ;
- try
+ try
{
/* Build XML Security Context */
- const rtl::OUString sSecyrutyContext ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_CONTEXT ) );
+ const rtl::OUString sSecyrutyContext ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_CONTEXT ) );
cssu::Reference< cssxc::XXMLSecurityContext > xSecCtx( mxMSF->createInstance ( sSecyrutyContext ), cssu::UNO_QUERY );
- if( !xSecCtx.is() )
+ if( !xSecCtx.is() )
return NULL;
- const rtl::OUString sSecyrutyEnvironment ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_ENVIRONMENT ) );
+ const rtl::OUString sSecyrutyEnvironment ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_ENVIRONMENT ) );
cssu::Reference< cssxc::XSecurityEnvironment > xSecEnv( mxMSF->createInstance ( sSecyrutyEnvironment ), cssu::UNO_QUERY );
cssu::Reference< cssl::XUnoTunnel > xEnvTunnel( xSecEnv , cssu::UNO_QUERY ) ;
- if( !xEnvTunnel.is() )
+ if( !xEnvTunnel.is() )
return NULL;
SecurityEnvironment_NssImpl* pSecEnv = reinterpret_cast<SecurityEnvironment_NssImpl*>(
sal::static_int_cast<sal_uIntPtr>(
xEnvTunnel->getSomething(SecurityEnvironment_NssImpl::getUnoTunnelId() ))) ;
pSecEnv->setCertDb(pCertHandle);
-
+
sal_Int32 n = xSecCtx->addSecurityEnvironment(xSecEnv);
//originally the SecurityEnvironment with the internal slot was set as default
xSecCtx->setDefaultSecurityEnvironmentIndex( n );
@@ -476,13 +476,13 @@ rtl::OUString SEInitializer_NssImpl_getImplementationName ()
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -499,17 +499,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL SEInitializer_NssImpl_createInstanc
}
/* XServiceInfo */
-rtl::OUString SAL_CALL SEInitializer_NssImpl::getImplementationName( )
+rtl::OUString SAL_CALL SEInitializer_NssImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return SEInitializer_NssImpl_getImplementationName();
}
-sal_Bool SAL_CALL SEInitializer_NssImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL SEInitializer_NssImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return SEInitializer_NssImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return SEInitializer_NssImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
index da1f98b68188..d0b8a201687a 100644
--- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,65 +38,65 @@
#include <libxml/tree.h>
-class SEInitializer_NssImpl : public cppu::WeakImplHelper2
-<
+class SEInitializer_NssImpl : public cppu::WeakImplHelper2
+<
com::sun::star::xml::crypto::XSEInitializer,
com::sun::star::lang::XServiceInfo
>
/****** SEInitializer_NssImpl.hxx/CLASS SEInitializer_NssImpl ***********
*
* NAME
- * SEInitializer_NssImpl -- Class to initialize a Security Context
- * instance
+ * SEInitializer_NssImpl -- Class to initialize a Security Context
+ * instance
*
* FUNCTION
- * Use this class to initialize a XmlSec based Security Context
- * instance. After this instance is used up, use this class to free this
- * instance.
+ * Use this class to initialize a XmlSec based Security Context
+ * instance. After this instance is used up, use this class to free this
+ * instance.
*
* HISTORY
- * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer
+ * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
-
+
public:
SEInitializer_NssImpl(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF);
virtual ~SEInitializer_NssImpl();
/* XSEInitializer */
- virtual com::sun::star::uno::Reference<
+ virtual com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext >
SAL_CALL createSecurityContext( const rtl::OUString& certDB )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL freeSecurityContext( const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext >& securityContext )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
-
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString SEInitializer_NssImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 6fad149b1c47..9de48239f642 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -74,7 +74,7 @@ sal_Int16 SAL_CALL X509Certificate_NssImpl :: getVersion() throw ( ::com::sun::s
if( m_pCert != NULL ) {
if( m_pCert->version.len > 0 ) {
return ( char )*( m_pCert->version.data ) ;
- } else
+ } else
return 0 ;
} else {
return -1 ;
@@ -301,7 +301,7 @@ void X509Certificate_NssImpl :: setRawCert( Sequence< sal_Int8 > rawCert ) throw
/* XUnoTunnel */
sal_Int64 SAL_CALL X509Certificate_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw( RuntimeException ) {
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;
@@ -350,19 +350,19 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
//char *fpStr = NULL;
SECItem fpItem;
int length = ((id == SEC_OID_MD5)?MD5_LENGTH:SHA1_LENGTH);
-
+
memset(fingerprint, 0, sizeof fingerprint);
PK11_HashBuf(id, fingerprint, pCert->derCert.data, pCert->derCert.len);
fpItem.data = fingerprint;
fpItem.len = length;
//fpStr = CERT_Hexify(&fpItem, 1);
-
+
Sequence< sal_Int8 > thumbprint( length ) ;
for( int i = 0 ; i < length ; i ++ )
{
thumbprint[i] = fingerprint[i];
}
-
+
//PORT_Free(fpStr);
return thumbprint;
}
@@ -388,11 +388,11 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl::getSubjectPublicKeyValue()
throw ( ::com::sun::star::uno::RuntimeException)
{
- if( m_pCert != NULL )
+ if( m_pCert != NULL )
{
SECItem spk = m_pCert->subjectPublicKeyInfo.subjectPublicKey;
DER_ConvertBitString(&spk);
-
+
if ( spk.len>0)
{
Sequence< sal_Int8 > key( spk.len ) ;
@@ -400,14 +400,14 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
{
key[i] = *( spk.data + i ) ;
}
-
+
return key ;
}
}
-
+
return ::com::sun::star::uno::Sequence< sal_Int8 >();
}
-
+
::rtl::OUString SAL_CALL X509Certificate_NssImpl::getSignatureAlgorithm()
throw ( ::com::sun::star::uno::RuntimeException)
{
@@ -420,7 +420,7 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
return OUString() ;
}
}
-
+
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl::getSHA1Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException)
{
@@ -439,9 +439,9 @@ sal_Int32 SAL_CALL X509Certificate_NssImpl::getCertificateUsage( )
SECStatus rv;
SECItem tmpitem;
sal_Int32 usage;
-
+
rv = CERT_FindKeyUsageExtension(m_pCert, &tmpitem);
- if ( rv == SECSuccess )
+ if ( rv == SECSuccess )
{
usage = tmpitem.data[0];
PORT_Free(tmpitem.data);
@@ -451,18 +451,18 @@ sal_Int32 SAL_CALL X509Certificate_NssImpl::getCertificateUsage( )
{
usage = KU_ALL;
}
-
+
/*
* to make the nss implementation compatible with MSCrypto,
* the following usage is ignored
*
*
- if ( CERT_GovtApprovedBitSet(m_pCert) )
+ if ( CERT_GovtApprovedBitSet(m_pCert) )
{
usage |= KU_NS_GOVT_APPROVED;
}
*/
-
+
return usage;
}
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
index e3297552481a..bedb25651818 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -80,16 +80,16 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2<
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectPublicKeyValue()
throw ( ::com::sun::star::uno::RuntimeException) ;
-
+
virtual ::rtl::OUString SAL_CALL getSignatureAlgorithm()
throw ( ::com::sun::star::uno::RuntimeException) ;
-
+
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSHA1Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException) ;
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMD5Thumbprint()
throw ( ::com::sun::star::uno::RuntimeException) ;
-
+
virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ;
// MM : end
@@ -105,6 +105,6 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2<
void setRawCert( ::com::sun::star::uno::Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) ;
} ;
-#endif // _X509CERTIFICATE_NSSIMPL_HXX_
+#endif // _X509CERTIFICATE_NSSIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
index e2e0c943d8e2..8a5cb3c0ebfc 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -79,7 +79,7 @@ Reference< XXMLEncryptionTemplate >
SAL_CALL XMLEncryption_NssImpl :: encrypt(
const Reference< XXMLEncryptionTemplate >& aTemplate ,
const Reference< XSecurityEnvironment >& aEnvironment
-) throw( com::sun::star::xml::crypto::XMLEncryptionException,
+) throw( com::sun::star::xml::crypto::XMLEncryptionException,
com::sun::star::uno::SecurityException )
{
xmlSecKeysMngrPtr pMngr = NULL ;
@@ -110,7 +110,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
sal::static_int_cast<sal_uIntPtr>(xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))) ;
if( pSecEnv == NULL )
throw RuntimeException() ;
-
+
//Get the encryption template
Reference< XXMLElementWrapper > xTemplate = aTemplate->getTemplate() ;
if( !xTemplate.is() ) {
@@ -155,7 +155,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
if( pContent == NULL ) {
throw XMLEncryptionException() ;
}
-
+
/* MM : remove the following 2 lines
xmlUnlinkNode(pContent);
xmlAddNextSibling(pEncryptedData, pContent);
@@ -195,7 +195,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
pEncryptedData = pTemplate->getNativeElement() ;
- //Find the element to be encrypted.
+ //Find the element to be encrypted.
/* MM : remove the old method to get the target element
//This element is wrapped in the CipherValue sub-element.
xmlNodePtr pCipherData = pEncryptedData->children;
@@ -224,11 +224,11 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
*/
//Encrypt the template
- if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 )
+ if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 )
{
xmlSecEncCtxDestroy( pEncCtx ) ;
pSecEnv->destroyKeysManager( pMngr ) ; //i39448
-
+
//throw XMLEncryptionException() ;
clearErrorRecorder();
return aTemplate;
@@ -255,7 +255,7 @@ Reference< XXMLEncryptionTemplate >
SAL_CALL XMLEncryption_NssImpl :: decrypt(
const Reference< XXMLEncryptionTemplate >& aTemplate ,
const Reference< XXMLSecurityContext >& aSecurityCtx
-) throw( com::sun::star::xml::crypto::XMLEncryptionException ,
+) throw( com::sun::star::xml::crypto::XMLEncryptionException ,
com::sun::star::uno::SecurityException) {
xmlSecKeysMngrPtr pMngr = NULL ;
xmlSecEncCtxPtr pEncCtx = NULL ;
@@ -304,32 +304,32 @@ SAL_CALL XMLEncryption_NssImpl :: decrypt(
}
setErrorRecorder( );
-
+
sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber();
sal_Int32 i;
-
+
for (i=0; i<nSecurityEnvironment; ++i)
{
Reference< XSecurityEnvironment > aEnvironment = aSecurityCtx->getSecurityEnvironmentByIndex(i);
-
+
//Get Keys Manager
Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ;
if( !aEnvironment.is() ) {
throw RuntimeException() ;
}
-
+
SecurityEnvironment_NssImpl* pSecEnv =
reinterpret_cast<SecurityEnvironment_NssImpl*>(
sal::static_int_cast<sal_uIntPtr>(
xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() )));
if( pSecEnv == NULL )
throw RuntimeException() ;
-
+
pMngr = pSecEnv->createKeysManager() ; //i39448
if( !pMngr ) {
throw RuntimeException() ;
}
-
+
//Create Encryption context
pEncCtx = xmlSecEncCtxCreate( pMngr ) ;
if( pEncCtx == NULL )
@@ -348,11 +348,11 @@ SAL_CALL XMLEncryption_NssImpl :: decrypt(
//Destroy the encryption context
xmlSecEncCtxDestroy( pEncCtx ) ;
pSecEnv->destroyKeysManager( pMngr ) ; //i39448
-
+
//get the decrypted element
XMLElementWrapper_XmlSecImpl * ret = new XMLElementWrapper_XmlSecImpl(isParentRef?
(referenceNode->children):(referenceNode->next));
-
+
//return ret;
aTemplate->setTemplate(ret);
break;
diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx
index 1b859734db39..009abec62437 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -95,6 +95,6 @@ class XMLEncryption_NssImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
} ;
-#endif // _XMLENCRYPTION_NSSIMPL_HXX_
+#endif // _XMLENCRYPTION_NSSIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
index db8500fea13d..9b6ed2de1145 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,11 +53,11 @@ using ::rtl::OUString ;
using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
using ::com::sun::star::xml::crypto::XXMLSecurityContext ;
-XMLSecurityContext_NssImpl :: XMLSecurityContext_NssImpl( const Reference< XMultiServiceFactory >& aFactory )
+XMLSecurityContext_NssImpl :: XMLSecurityContext_NssImpl( const Reference< XMultiServiceFactory >& aFactory )
://i39448 : m_pKeysMngr( NULL ) ,
m_xServiceManager( aFactory ) ,
m_nDefaultEnvIndex(-1)
- //m_xSecurityEnvironment( NULL )
+ //m_xSecurityEnvironment( NULL )
{
//Init xmlsec library
if( xmlSecInit() < 0 ) {
@@ -111,25 +111,25 @@ sal_Int32 SAL_CALL XMLSecurityContext_NssImpl::getSecurityEnvironmentNumber( )
{
return m_vSecurityEnvironments.size();
}
-
+
::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
XMLSecurityContext_NssImpl::getSecurityEnvironmentByIndex( sal_Int32 index )
throw (::com::sun::star::uno::RuntimeException)
{
::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment;
-
+
if (index >= 0 && index < ( sal_Int32 )m_vSecurityEnvironments.size())
{
xSecurityEnvironment = m_vSecurityEnvironments[index];
}
else
throw RuntimeException() ;
-
+
return xSecurityEnvironment;
}
-
-::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
- XMLSecurityContext_NssImpl::getSecurityEnvironment( )
+
+::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
+ XMLSecurityContext_NssImpl::getSecurityEnvironment( )
throw (::com::sun::star::uno::RuntimeException)
{
if (m_nDefaultEnvIndex >= 0 && m_nDefaultEnvIndex < ( sal_Int32 )m_vSecurityEnvironments.size())
@@ -184,7 +184,7 @@ void SAL_CALL XMLSecurityContext_NssImpl :: setSecurityEnvironment( const Refere
throw RuntimeException() ;
//todo
-// slot = pSecEnv->getCryptoSlot() ;
+// slot = pSecEnv->getCryptoSlot() ;
handler = pSecEnv->getCertDb() ;
/*-
@@ -224,10 +224,10 @@ void SAL_CALL XMLSecurityContext_NssImpl :: setSecurityEnvironment( const Refere
}
/* XXMLSecurityContext */
-Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_NssImpl :: getSecurityEnvironment()
+Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_NssImpl :: getSecurityEnvironment()
throw (RuntimeException)
{
- return m_xSecurityEnvironment ;
+ return m_xSecurityEnvironment ;
}
#endif
@@ -284,10 +284,10 @@ Reference< XSingleServiceFactory > XMLSecurityContext_NssImpl :: impl_createFact
#if 0 //not useful any longer
/* XUnoTunnel */
-sal_Int64 SAL_CALL XMLSecurityContext_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
+sal_Int64 SAL_CALL XMLSecurityContext_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
throw (RuntimeException)
{
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
return ( sal_Int64 )this ;
}
return 0 ;
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx
index 685f83ec304d..ca69b84dd898 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -71,20 +71,20 @@ class XMLSecurityContext_NssImpl : public ::cppu::WeakImplHelper3<
virtual sal_Int32 SAL_CALL addSecurityEnvironment(
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment
) throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException);
-
+
virtual ::sal_Int32 SAL_CALL getSecurityEnvironmentNumber( )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual ::com::sun::star::uno::Reference<
::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
getSecurityEnvironmentByIndex( ::sal_Int32 index )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
- getSecurityEnvironment( )
+ ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
+ getSecurityEnvironment( )
throw (::com::sun::star::uno::RuntimeException);
-
+
virtual ::sal_Int32 SAL_CALL getDefaultSecurityEnvironmentIndex( )
throw (::com::sun::star::uno::RuntimeException);
@@ -114,13 +114,13 @@ class XMLSecurityContext_NssImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ;
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
-
+
/*
* Because of the issue of multi-securityenvironment, so the keyManager method is not useful any longer.
*
-
+
//Methods from XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
throw (com::sun::star::uno::RuntimeException);
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
@@ -128,10 +128,10 @@ class XMLSecurityContext_NssImpl : public ::cppu::WeakImplHelper3<
//Native mehtods
virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
-
+
*/
} ;
-#endif // _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
+#endif // _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index 9c08a4d01fce..090dee7e2f8a 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -78,7 +78,7 @@ Reference< XXMLSignatureTemplate >
SAL_CALL XMLSignature_NssImpl :: generate(
const Reference< XXMLSignatureTemplate >& aTemplate ,
const Reference< XSecurityEnvironment >& aEnvironment
-) throw( com::sun::star::xml::crypto::XMLSignatureException,
+) throw( com::sun::star::xml::crypto::XMLSignatureException,
com::sun::star::uno::SecurityException )
{
xmlSecKeysMngrPtr pMngr = NULL ;
@@ -157,7 +157,7 @@ SAL_CALL XMLSignature_NssImpl :: generate(
}
//Sign the template
- if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 )
+ if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 )
{
if (pDsigCtx->status == xmlSecDSigStatusSucceeded)
aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
@@ -186,8 +186,8 @@ Reference< XXMLSignatureTemplate >
SAL_CALL XMLSignature_NssImpl :: validate(
const Reference< XXMLSignatureTemplate >& aTemplate ,
const Reference< XXMLSecurityContext >& aSecurityCtx
-) throw( com::sun::star::uno::RuntimeException,
- com::sun::star::uno::SecurityException,
+) throw( com::sun::star::uno::RuntimeException,
+ com::sun::star::uno::SecurityException,
com::sun::star::xml::crypto::XMLSignatureException ) {
xmlSecKeysMngrPtr pMngr = NULL ;
xmlSecDSigCtxPtr pDsigCtx = NULL ;
@@ -228,32 +228,32 @@ SAL_CALL XMLSignature_NssImpl :: validate(
}
setErrorRecorder();
-
+
sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber();
sal_Int32 i;
-
+
for (i=0; i<nSecurityEnvironment; ++i)
{
Reference< XSecurityEnvironment > aEnvironment = aSecurityCtx->getSecurityEnvironmentByIndex(i);
-
+
//Get Keys Manager
Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ;
if( !xSecTunnel.is() ) {
throw RuntimeException() ;
}
-
+
SecurityEnvironment_NssImpl* pSecEnv =
reinterpret_cast<SecurityEnvironment_NssImpl*>(
sal::static_int_cast<sal_uIntPtr>(
xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() )));
if( pSecEnv == NULL )
throw RuntimeException() ;
-
+
pMngr = pSecEnv->createKeysManager() ; //i39448
if( !pMngr ) {
throw RuntimeException() ;
}
-
+
//Create Signature context
pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ;
if( pDsigCtx == NULL )
@@ -266,9 +266,9 @@ SAL_CALL XMLSignature_NssImpl :: validate(
//Verify signature
int rs = xmlSecDSigCtxVerify( pDsigCtx , pNode );
-
-
- if (rs == 0 &&
+
+
+ if (rs == 0 &&
pDsigCtx->status == xmlSecDSigStatusSucceeded)
{
aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx
index 3a8cfecd4eb0..4c6017a69381 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -67,7 +67,7 @@ class XMLSignature_NssImpl : public ::cppu::WeakImplHelper3<
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& aTemplate ,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext >& aContext
) throw( com::sun::star::uno::RuntimeException,
- com::sun::star::uno::SecurityException,
+ com::sun::star::uno::SecurityException,
com::sun::star::xml::crypto::XMLSignatureException);
//Methods from XInitialization
@@ -95,6 +95,6 @@ class XMLSignature_NssImpl : public ::cppu::WeakImplHelper3<
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
} ;
-#endif // _XMLSIGNATURE_NSSIMPL_HXX_
+#endif // _XMLSIGNATURE_NSSIMPL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx b/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx
index bce50a11e5d5..c6155607330f 100644
--- a/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,7 +62,7 @@ sal_Bool SAL_CALL nss_component_writeInfo( void* /*pServiceManager*/ , void* pRe
Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ;
if( xKey.is() ) {
- // try {
+ // try {
// XMLSignature_NssImpl
sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ;
sKeyName += XMLSignature_NssImpl::impl_getImplementationName() ;
@@ -122,11 +122,11 @@ sal_Bool SAL_CALL nss_component_writeInfo( void* /*pServiceManager*/ , void* pRe
for( i = seqServices.getLength() ; i -- ; )
xNewKey->createKey( seqServices.getConstArray()[i] ) ;
}
-
+
return sal_True;
//} catch( InvalidRegistryException & ) {
- // //we should not ignore exceptions
- // return sal_False ;
+ // //we should not ignore exceptions
+ // return sal_False ;
//}
}
return result;
diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx
index 7384c6f310a7..6e40119cdbcd 100644
--- a/xmlsecurity/source/xmlsec/saxhelper.cxx
+++ b/xmlsecurity/source/xmlsec/saxhelper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@ namespace cssxcsax = com::sun::star::xml::csax;
* The return value is NULL terminated. The application has the responsibilty to
* deallocte the return value.
*/
-xmlChar* ous_to_xmlstr( const rtl::OUString& oustr )
+xmlChar* ous_to_xmlstr( const rtl::OUString& oustr )
{
rtl::OString ostr = rtl::OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ;
return xmlStrndup( ( xmlChar* )ostr.getStr(), ( int )ostr.getLength() ) ;
@@ -56,7 +56,7 @@ xmlChar* ous_to_xmlstr( const rtl::OUString& oustr )
* The return value is NULL terminated. The application has the responsibilty to
* deallocte the return value.
*/
-xmlChar* ous_to_nxmlstr( const rtl::OUString& oustr, int& length )
+xmlChar* ous_to_nxmlstr( const rtl::OUString& oustr, int& length )
{
rtl::OString ostr = rtl::OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ;
length = ostr.getLength();
@@ -67,7 +67,7 @@ xmlChar* ous_to_nxmlstr( const rtl::OUString& oustr, int& length )
/**
* The input parameter isn't necessaryly NULL terminated.
*/
-rtl::OUString xmlchar_to_ous( const xmlChar* pChar, int length )
+rtl::OUString xmlchar_to_ous( const xmlChar* pChar, int length )
{
if( pChar != NULL )
{
@@ -82,9 +82,9 @@ rtl::OUString xmlchar_to_ous( const xmlChar* pChar, int length )
/**
* The input parameter is NULL terminated
*/
-rtl::OUString xmlstr_to_ous( const xmlChar* pStr )
+rtl::OUString xmlstr_to_ous( const xmlChar* pStr )
{
- if( pStr != NULL )
+ if( pStr != NULL )
{
return xmlchar_to_ous( pStr , xmlStrlen( pStr ) ) ;
}
@@ -98,16 +98,16 @@ rtl::OUString xmlstr_to_ous( const xmlChar* pStr )
* The return value and the referenced value must be NULL terminated.
* The application has the responsibilty to deallocte the return value.
*/
-const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes )
+const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes )
{
xmlChar* attname = NULL ;
xmlChar* attvalue = NULL ;
const xmlChar** attrs = NULL ;
rtl::OUString oustr ;
-
+
sal_Int32 nLength = aAttributes.getLength();;
- if( nLength != 0 )
+ if( nLength != 0 )
{
attrs = ( const xmlChar** )xmlMalloc( ( nLength * 2 + 2 ) * sizeof( xmlChar* ) ) ;
}
@@ -116,12 +116,12 @@ const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribut
return NULL ;
}
- for( int i = 0 , j = 0 ; j < nLength ; ++j )
+ for( int i = 0 , j = 0 ; j < nLength ; ++j )
{
attname = ous_to_xmlstr( aAttributes[j].sName ) ;
attvalue = ous_to_xmlstr( aAttributes[j].sValue ) ;
- if( attname != NULL && attvalue != NULL )
+ if( attname != NULL && attvalue != NULL )
{
attrs[i++] = attname ;
attrs[i++] = attvalue ;
@@ -152,7 +152,7 @@ SAXHelper::SAXHelper( )
{
xmlInitParser() ;
LIBXML_TEST_VERSION ;
-
+
/*
* compile error:
* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS ;
@@ -170,27 +170,27 @@ SAXHelper::SAXHelper( )
*
* mmi : re-initialize the SAX handler to version 1
*/
-
+
xmlSAXVersion(m_pParserCtxt->sax, 1);
/* end */
- if( m_pParserCtxt->inputTab[0] != NULL )
+ if( m_pParserCtxt->inputTab[0] != NULL )
{
m_pParserCtxt->inputTab[0] = NULL ;
}
-
- if( m_pParserCtxt == NULL )
+
+ if( m_pParserCtxt == NULL )
{
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals() ;
+ xsltCleanupGlobals() ;
#endif
// see issue i74334, we cannot call xmlCleanupParser when libxml is still used
-// in other parts of the office.
-// xmlCleanupParser() ;
+// in other parts of the office.
+// xmlCleanupParser() ;
throw cssu::RuntimeException() ;
}
- else if( m_pParserCtxt->sax == NULL )
+ else if( m_pParserCtxt->sax == NULL )
{
xmlFreeParserCtxt( m_pParserCtxt ) ;
@@ -198,8 +198,8 @@ SAXHelper::SAXHelper( )
xsltCleanupGlobals() ;
#endif
// see issue i74334, we cannot call xmlCleanupParser when libxml is still used
-// in other parts of the office.
-// xmlCleanupParser() ;
+// in other parts of the office.
+// xmlCleanupParser() ;
m_pParserCtxt = NULL ;
throw cssu::RuntimeException() ;
}
@@ -221,7 +221,7 @@ SAXHelper::SAXHelper( )
* destruct the xml tree.
*/
SAXHelper::~SAXHelper() {
- if( m_pParserCtxt != NULL )
+ if( m_pParserCtxt != NULL )
{
/*
* In the situation that no object refer the Document, this destructor
@@ -236,14 +236,14 @@ SAXHelper::~SAXHelper() {
m_pParserCtxt = NULL ;
}
- if( m_pSaxHandler != NULL )
+ if( m_pSaxHandler != NULL )
{
xmlFree( m_pSaxHandler ) ;
m_pSaxHandler = NULL ;
}
// see issue i74334, we cannot call xmlCleanupParser when libxml is still used
-// in other parts of the office.
-// xmlCleanupParser() ;
+// in other parts of the office.
+// xmlCleanupParser() ;
}
xmlNodePtr SAXHelper::getCurrentNode()
@@ -260,7 +260,7 @@ void SAXHelper::setCurrentNode(const xmlNodePtr pNode)
* node, in order to make compatibility.
*/
m_pParserCtxt->nodeTab[m_pParserCtxt->nodeNr - 1]
- = m_pParserCtxt->node
+ = m_pParserCtxt->node
= pNode;
}
@@ -273,14 +273,14 @@ xmlDocPtr SAXHelper::getDocument()
* XDocumentHandler -- start an xml document
*/
void SAXHelper::startDocument( void )
- throw( cssxs::SAXException , cssu::RuntimeException )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
/*
* Adjust inputTab
*/
xmlParserInputPtr pInput = xmlNewInputStream( m_pParserCtxt ) ;
- if( m_pParserCtxt->inputTab != NULL && m_pParserCtxt->inputMax != 0 )
+ if( m_pParserCtxt->inputTab != NULL && m_pParserCtxt->inputMax != 0 )
{
m_pParserCtxt->inputTab[0] = pInput ;
m_pParserCtxt->input = pInput ;
@@ -288,7 +288,7 @@ void SAXHelper::startDocument( void )
m_pSaxHandler->startDocument( m_pParserCtxt ) ;
- if( m_pParserCtxt == NULL || m_pParserCtxt->myDoc == NULL )
+ if( m_pParserCtxt == NULL || m_pParserCtxt->myDoc == NULL )
{
throw cssu::RuntimeException() ;
}
@@ -297,8 +297,8 @@ void SAXHelper::startDocument( void )
/**
* XDocumentHandler -- end an xml document
*/
-void SAXHelper::endDocument( void )
- throw( cssxs::SAXException , cssu::RuntimeException )
+void SAXHelper::endDocument( void )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
m_pSaxHandler->endDocument( m_pParserCtxt ) ;
}
@@ -309,33 +309,33 @@ void SAXHelper::endDocument( void )
void SAXHelper::startElement(
const rtl::OUString& aName,
const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes )
- throw( cssxs::SAXException , cssu::RuntimeException )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
const xmlChar* fullName = NULL ;
const xmlChar** attrs = NULL ;
fullName = ous_to_xmlstr( aName ) ;
attrs = attrlist_to_nxmlstr( aAttributes ) ;
-
+
if( fullName != NULL || attrs != NULL )
{
m_pSaxHandler->startElement( m_pParserCtxt , fullName , attrs ) ;
}
- if( fullName != NULL )
+ if( fullName != NULL )
{
xmlFree( ( xmlChar* )fullName ) ;
fullName = NULL ;
}
-
- if( attrs != NULL )
+
+ if( attrs != NULL )
{
- for( int i = 0 ; attrs[i] != NULL ; ++i )
+ for( int i = 0 ; attrs[i] != NULL ; ++i )
{
xmlFree( ( xmlChar* )attrs[i] ) ;
attrs[i] = NULL ;
}
-
+
xmlFree( ( void* ) attrs ) ;
attrs = NULL ;
}
@@ -345,14 +345,14 @@ void SAXHelper::startElement(
* XDocumentHandler -- end an xml element
*/
void SAXHelper::endElement( const rtl::OUString& aName )
- throw( cssxs::SAXException , cssu::RuntimeException )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
xmlChar* fullname = NULL ;
fullname = ous_to_xmlstr( aName ) ;
m_pSaxHandler->endElement( m_pParserCtxt , fullname ) ;
- if( fullname != NULL )
+ if( fullname != NULL )
{
xmlFree( ( xmlChar* )fullname ) ;
fullname = NULL ;
@@ -363,7 +363,7 @@ void SAXHelper::endElement( const rtl::OUString& aName )
* XDocumentHandler -- an xml element or cdata characters
*/
void SAXHelper::characters( const rtl::OUString& aChars )
- throw( cssxs::SAXException , cssu::RuntimeException )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
const xmlChar* chars = NULL ;
int length = 0 ;
@@ -371,7 +371,7 @@ void SAXHelper::characters( const rtl::OUString& aChars )
chars = ous_to_nxmlstr( aChars, length ) ;
m_pSaxHandler->characters( m_pParserCtxt , chars , length ) ;
- if( chars != NULL )
+ if( chars != NULL )
{
xmlFree( ( xmlChar* )chars ) ;
}
@@ -380,8 +380,8 @@ void SAXHelper::characters( const rtl::OUString& aChars )
/**
* XDocumentHandler -- ignorable xml white space
*/
-void SAXHelper::ignorableWhitespace( const rtl::OUString& aWhitespaces )
- throw( cssxs::SAXException , cssu::RuntimeException )
+void SAXHelper::ignorableWhitespace( const rtl::OUString& aWhitespaces )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
const xmlChar* chars = NULL ;
int length = 0 ;
@@ -389,7 +389,7 @@ void SAXHelper::ignorableWhitespace( const rtl::OUString& aWhitespaces )
chars = ous_to_nxmlstr( aWhitespaces, length ) ;
m_pSaxHandler->ignorableWhitespace( m_pParserCtxt , chars , length ) ;
- if( chars != NULL )
+ if( chars != NULL )
{
xmlFree( ( xmlChar* )chars ) ;
}
@@ -401,7 +401,7 @@ void SAXHelper::ignorableWhitespace( const rtl::OUString& aWhitespaces )
void SAXHelper::processingInstruction(
const rtl::OUString& aTarget,
const rtl::OUString& aData )
- throw( cssxs::SAXException , cssu::RuntimeException )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
xmlChar* target = NULL ;
xmlChar* data = NULL ;
@@ -411,13 +411,13 @@ void SAXHelper::processingInstruction(
m_pSaxHandler->processingInstruction( m_pParserCtxt , target , data ) ;
- if( target != NULL )
+ if( target != NULL )
{
xmlFree( ( xmlChar* )target ) ;
target = NULL ;
}
-
- if( data != NULL )
+
+ if( data != NULL )
{
xmlFree( ( xmlChar* )data ) ;
data = NULL ;
@@ -430,17 +430,17 @@ void SAXHelper::processingInstruction(
*/
void SAXHelper::setDocumentLocator(
const cssu::Reference< cssxs::XLocator > &)
- throw( cssxs::SAXException , cssu::RuntimeException )
+ throw( cssxs::SAXException , cssu::RuntimeException )
{
//--Pseudo code if necessary
//--m_pSaxLocator is a member defined as xmlSAXHabdlerPtr
//--m_pSaxLocatorHdl is a member defined as Sax_Locator
//if( m_pSaxLocator != NULL ) {
- // //Deallocate the memory
+ // //Deallocate the memory
//}
//if( m_pSaxLocatorHdl != NULL ) {
- // //Deallocate the memory
+ // //Deallocate the memory
//}
//m_pSaxLocatorHdl = new Sax_Locator( xLocator ) ;
diff --git a/xmlsecurity/source/xmlsec/saxhelper.hxx b/xmlsecurity/source/xmlsec/saxhelper.hxx
index a18943d5043e..562b6e773eb5 100644
--- a/xmlsecurity/source/xmlsec/saxhelper.hxx
+++ b/xmlsecurity/source/xmlsec/saxhelper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index 15bcd066477d..0426784db6c3 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -60,7 +60,7 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLDocumentWrapper"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLDocumentWrapper_XmlSecImpl"
-
+
#define STRXMLNS "xmlns"
#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US
@@ -75,12 +75,12 @@ XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl( )
{
saxHelper.startDocument();
m_pDocument = saxHelper.getDocument();
-
+
/*
* creates the virtual root element
*/
saxHelper.startElement(rtl::OUString(RTL_UTF8_USTRINGPARAM( "root" )), cssu::Sequence<cssxcsax::XMLAttribute>());
-
+
m_pRootElement = saxHelper.getCurrentNode();
m_pCurrentElement = m_pRootElement;
}
@@ -95,44 +95,44 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent()
/****** XMLDocumentWrapper_XmlSecImpl/getNextSAXEvent *************************
*
* NAME
- * getNextSAXEvent -- Prepares the next SAX event to be manipulate
+ * getNextSAXEvent -- Prepares the next SAX event to be manipulate
*
* SYNOPSIS
- * getNextSAXEvent();
+ * getNextSAXEvent();
*
* FUNCTION
- * When converting the document into SAX events, this method is used to
- * decide the next SAX event to be generated.
- * Two member variables are checked to make the decision, the
- * m_pCurrentElement and the m_nCurrentPosition.
- * The m_pCurrentElement represents the node which have been covered, and
- * the m_nCurrentPosition represents the event which have been sent.
- * For example, suppose that the m_pCurrentElement
- * points to element A, and the m_nCurrentPosition equals to
- * NODEPOSITION_STARTELEMENT, then the next SAX event should be the
- * endElement for element A if A has no child, or startElement for the
- * first child element of element A otherwise.
- * The m_nCurrentPosition can be one of following values:
- * NODEPOSITION_STARTELEMENT for startElement;
- * NODEPOSITION_ENDELEMENT for endElement;
- * NODEPOSITION_NORMAL for other SAX events;
+ * When converting the document into SAX events, this method is used to
+ * decide the next SAX event to be generated.
+ * Two member variables are checked to make the decision, the
+ * m_pCurrentElement and the m_nCurrentPosition.
+ * The m_pCurrentElement represents the node which have been covered, and
+ * the m_nCurrentPosition represents the event which have been sent.
+ * For example, suppose that the m_pCurrentElement
+ * points to element A, and the m_nCurrentPosition equals to
+ * NODEPOSITION_STARTELEMENT, then the next SAX event should be the
+ * endElement for element A if A has no child, or startElement for the
+ * first child element of element A otherwise.
+ * The m_nCurrentPosition can be one of following values:
+ * NODEPOSITION_STARTELEMENT for startElement;
+ * NODEPOSITION_ENDELEMENT for endElement;
+ * NODEPOSITION_NORMAL for other SAX events;
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
OSL_ASSERT( m_pCurrentElement != NULL );
-
+
/*
* Get the next event through tree order.
*
@@ -146,13 +146,13 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent()
* If the current node has children, then its first child
* should be next current node, and the next event will be
* startElement or charaters(PI) based on that child's node
- * type. Otherwise, the endElement of current node is the
+ * type. Otherwise, the endElement of current node is the
* next event.
*/
if (m_pCurrentElement->children != NULL)
{
m_pCurrentElement = m_pCurrentElement->children;
- m_nCurrentPosition
+ m_nCurrentPosition
= (m_pCurrentElement->type == XML_ELEMENT_NODE)?
NODEPOSITION_STARTELEMENT:NODEPOSITION_NORMAL;
}
@@ -169,7 +169,7 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent()
else if (m_nCurrentPosition == NODEPOSITION_ENDELEMENT || m_nCurrentPosition == NODEPOSITION_NORMAL)
{
xmlNodePtr pNextSibling = m_pCurrentElement->next;
-
+
/*
* If the current node has following sibling, that sibling
* should be next current node, and the next event will be
@@ -180,7 +180,7 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent()
if (pNextSibling != NULL)
{
m_pCurrentElement = pNextSibling;
- m_nCurrentPosition
+ m_nCurrentPosition
= (m_pCurrentElement->type == XML_ELEMENT_NODE)?
NODEPOSITION_STARTELEMENT:NODEPOSITION_NORMAL;
}
@@ -193,40 +193,40 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent()
}
void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
- const cssu::Reference< cssxs::XDocumentHandler >& xHandler,
- const cssu::Reference< cssxs::XDocumentHandler >& xHandler2,
+ const cssu::Reference< cssxs::XDocumentHandler >& xHandler,
+ const cssu::Reference< cssxs::XDocumentHandler >& xHandler2,
const xmlNodePtr pNode) const
throw (cssxs::SAXException)
/****** XMLDocumentWrapper_XmlSecImpl/sendStartElement ************************
*
* NAME
- * sendStartElement -- Constructs a startElement SAX event
+ * sendStartElement -- Constructs a startElement SAX event
*
* SYNOPSIS
- * sendStartElement(xHandler, xHandler2, pNode);
+ * sendStartElement(xHandler, xHandler2, pNode);
*
* FUNCTION
- * Used when converting the document into SAX event stream.
- * This method constructs a startElement SAX event for a particular
- * element, then calls the startElement methods of the XDocumentHandlers.
+ * Used when converting the document into SAX event stream.
+ * This method constructs a startElement SAX event for a particular
+ * element, then calls the startElement methods of the XDocumentHandlers.
*
* INPUTS
- * xHandler - the first XDocumentHandler interface to receive the
- * startElement SAX event. It can be NULL.
- * xHandler2 - the second XDocumentHandler interface to receive the
- * startElement SAX event. It can't be NULL.
- * pNode - the node on which the startElement should be generated.
- * This node must be a element type.
+ * xHandler - the first XDocumentHandler interface to receive the
+ * startElement SAX event. It can be NULL.
+ * xHandler2 - the second XDocumentHandler interface to receive the
+ * startElement SAX event. It can't be NULL.
+ * pNode - the node on which the startElement should be generated.
+ * This node must be a element type.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
SvXMLAttributeList* pAttributeList = new SvXMLAttributeList();
@@ -258,12 +258,12 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
}
xmlAttrPtr pAttr = pNode->properties;
-
+
while (pAttr != NULL)
{
const xmlChar* pAttrName = pAttr->name;
xmlNsPtr pAttrNs = pAttr->ns;
-
+
rtl::OUString ouAttrName;
if (pAttrNs == NULL)
{
@@ -281,118 +281,118 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)(pAttr->children->content))));
pAttr = pAttr->next;
}
-
+
rtl::OString sNodeName = getNodeQName(pNode);
-
+
if (xHandler.is())
{
xHandler->startElement(
rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) )),
xAttrList);
}
-
+
xHandler2->startElement(
rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) )),
xAttrList);
}
-
+
void XMLDocumentWrapper_XmlSecImpl::sendEndElement(
- const cssu::Reference< cssxs::XDocumentHandler >& xHandler,
- const cssu::Reference< cssxs::XDocumentHandler >& xHandler2,
+ const cssu::Reference< cssxs::XDocumentHandler >& xHandler,
+ const cssu::Reference< cssxs::XDocumentHandler >& xHandler2,
const xmlNodePtr pNode) const
throw (cssxs::SAXException)
/****** XMLDocumentWrapper_XmlSecImpl/sendEndElement **************************
*
* NAME
- * sendEndElement -- Constructs a endElement SAX event
+ * sendEndElement -- Constructs a endElement SAX event
*
* SYNOPSIS
- * sendEndElement(xHandler, xHandler2, pNode);
+ * sendEndElement(xHandler, xHandler2, pNode);
*
* FUNCTION
- * Used when converting the document into SAX event stream.
- * This method constructs a endElement SAX event for a particular
- * element, then calls the endElement methods of the XDocumentHandlers.
+ * Used when converting the document into SAX event stream.
+ * This method constructs a endElement SAX event for a particular
+ * element, then calls the endElement methods of the XDocumentHandlers.
*
* INPUTS
- * xHandler - the first XDocumentHandler interface to receive the
- * endElement SAX event. It can be NULL.
- * xHandler2 - the second XDocumentHandler interface to receive the
- * endElement SAX event. It can't be NULL.
- * pNode - the node on which the endElement should be generated.
- * This node must be a element type.
+ * xHandler - the first XDocumentHandler interface to receive the
+ * endElement SAX event. It can be NULL.
+ * xHandler2 - the second XDocumentHandler interface to receive the
+ * endElement SAX event. It can't be NULL.
+ * pNode - the node on which the endElement should be generated.
+ * This node must be a element type.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
rtl::OString sNodeName = getNodeQName(pNode);
-
+
if (xHandler.is())
{
xHandler->endElement(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) )));
}
-
+
xHandler2->endElement(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) )));
}
-
+
void XMLDocumentWrapper_XmlSecImpl::sendNode(
- const cssu::Reference< cssxs::XDocumentHandler >& xHandler,
- const cssu::Reference< cssxs::XDocumentHandler >& xHandler2,
+ const cssu::Reference< cssxs::XDocumentHandler >& xHandler,
+ const cssu::Reference< cssxs::XDocumentHandler >& xHandler2,
const xmlNodePtr pNode) const
throw (cssxs::SAXException)
/****** XMLDocumentWrapper_XmlSecImpl/sendNode ********************************
*
* NAME
- * sendNode -- Constructs a characters SAX event or a
- * processingInstruction SAX event
+ * sendNode -- Constructs a characters SAX event or a
+ * processingInstruction SAX event
*
* SYNOPSIS
- * sendNode(xHandler, xHandler2, pNode);
+ * sendNode(xHandler, xHandler2, pNode);
*
* FUNCTION
- * Used when converting the document into SAX event stream.
- * This method constructs a characters SAX event or a
- * processingInstructionfor SAX event based on the type of a particular
- * element, then calls the corresponding methods of the XDocumentHandlers.
+ * Used when converting the document into SAX event stream.
+ * This method constructs a characters SAX event or a
+ * processingInstructionfor SAX event based on the type of a particular
+ * element, then calls the corresponding methods of the XDocumentHandlers.
*
* INPUTS
- * xHandler - the first XDocumentHandler interface to receive the
- * SAX event. It can be NULL.
- * xHandler2 - the second XDocumentHandler interface to receive the
- * SAX event. It can't be NULL.
- * pNode - the node on which the endElement should be generated.
- * If it is a text node, then a characters SAX event is
- * generated; if it is a PI node, then a
- * processingInstructionfor SAX event is generated.
+ * xHandler - the first XDocumentHandler interface to receive the
+ * SAX event. It can be NULL.
+ * xHandler2 - the second XDocumentHandler interface to receive the
+ * SAX event. It can't be NULL.
+ * pNode - the node on which the endElement should be generated.
+ * If it is a text node, then a characters SAX event is
+ * generated; if it is a PI node, then a
+ * processingInstructionfor SAX event is generated.
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
xmlElementType type = pNode->type;
-
+
if (type == XML_TEXT_NODE)
{
if (xHandler.is())
{
xHandler->characters(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) )));
}
-
+
xHandler2->characters(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) )));
}
else if (type == XML_PI_NODE)
@@ -403,7 +403,7 @@ void XMLDocumentWrapper_XmlSecImpl::sendNode(
rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->name)) )),
rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) )));
}
-
+
xHandler2->processingInstruction(
rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->name)) )),
rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) )));
@@ -414,26 +414,26 @@ rtl::OString XMLDocumentWrapper_XmlSecImpl::getNodeQName(const xmlNodePtr pNode)
/****** XMLDocumentWrapper_XmlSecImpl/getNodeQName ****************************
*
* NAME
- * getNodeQName -- Retrives the qualified name of a node
+ * getNodeQName -- Retrives the qualified name of a node
*
* SYNOPSIS
- * name = getNodeQName(pNode);
+ * name = getNodeQName(pNode);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pNode - the node whose name will be retrived
+ * pNode - the node whose name will be retrived
*
* RESULT
- * name - the node's qualified name
+ * name - the node's qualified name
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
rtl::OString sNodeName((const sal_Char*)pNode->name);
@@ -447,7 +447,7 @@ rtl::OString XMLDocumentWrapper_XmlSecImpl::getNodeQName(const xmlNodePtr pNode)
sNodeName = sPrefix+rtl::OString(":")+sNodeName;
}
}
-
+
return sNodeName;
}
@@ -455,52 +455,52 @@ xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const cssu::Reference< c
/****** XMLDocumentWrapper_XmlSecImpl/checkElement ****************************
*
* NAME
- * checkElement -- Retrives the node wrapped by an XXMLElementWrapper
- * interface
+ * checkElement -- Retrives the node wrapped by an XXMLElementWrapper
+ * interface
*
* SYNOPSIS
- * node = checkElement(xXMLElement);
+ * node = checkElement(xXMLElement);
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * xXMLElement - the XXMLElementWrapper interface wraping a node
+ * xXMLElement - the XXMLElementWrapper interface wraping a node
*
* RESULT
- * node - the node wrapped in the XXMLElementWrapper interface
+ * node - the node wrapped in the XXMLElementWrapper interface
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
xmlNodePtr rc = NULL;
-
+
if (xXMLElement.is())
{
cssu::Reference< cssl::XUnoTunnel > xNodTunnel( xXMLElement, cssu::UNO_QUERY ) ;
- if( !xNodTunnel.is() )
+ if( !xNodTunnel.is() )
{
throw cssu::RuntimeException() ;
}
-
- XMLElementWrapper_XmlSecImpl* pElement
+
+ XMLElementWrapper_XmlSecImpl* pElement
= reinterpret_cast<XMLElementWrapper_XmlSecImpl*>(
sal::static_int_cast<sal_uIntPtr>(
xNodTunnel->getSomething(
XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))) ;
-
+
if( pElement == NULL ) {
throw cssu::RuntimeException() ;
}
-
+
rc = pElement->getNativeElement();
}
-
+
return rc;
}
@@ -509,64 +509,64 @@ sal_Int32 XMLDocumentWrapper_XmlSecImpl::recursiveDelete(
/****** XMLDocumentWrapper_XmlSecImpl/recursiveDelete *************************
*
* NAME
- * recursiveDelete -- Deletes a paticular node with its branch.
+ * recursiveDelete -- Deletes a paticular node with its branch.
*
* SYNOPSIS
- * result = recursiveDelete(pNode);
+ * result = recursiveDelete(pNode);
*
* FUNCTION
- * Deletes a paticular node with its branch, while reserving the nodes
- * (and their brance) listed in the m_aReservedNodes.
- * The deletion process is preformed in the tree order, that is, a node
- * is deleted after its previous sibling node is deleted, a parent node
- * is deleted after its branch is deleted.
- * During the deletion process when the m_pStopAtNode is reached, the
- * progress is interrupted at once.
+ * Deletes a paticular node with its branch, while reserving the nodes
+ * (and their brance) listed in the m_aReservedNodes.
+ * The deletion process is preformed in the tree order, that is, a node
+ * is deleted after its previous sibling node is deleted, a parent node
+ * is deleted after its branch is deleted.
+ * During the deletion process when the m_pStopAtNode is reached, the
+ * progress is interrupted at once.
*
* INPUTS
- * pNode - the node to be deleted
+ * pNode - the node to be deleted
*
* RESULT
- * result - the result of the deletion process, can be one of following
- * values:
- * NODE_STOPED - the process is interrupted by meeting the
- * m_pStopAtNode
- * NODE_NOTREMOVED - the pNode is not completely removed
- * because there is its descendant in the
- * m_aReservedNodes list
- * NODE_REMOVED - the pNode and its branch are completely
- * removed
+ * result - the result of the deletion process, can be one of following
+ * values:
+ * NODE_STOPED - the process is interrupted by meeting the
+ * m_pStopAtNode
+ * NODE_NOTREMOVED - the pNode is not completely removed
+ * because there is its descendant in the
+ * m_aReservedNodes list
+ * NODE_REMOVED - the pNode and its branch are completely
+ * removed
*
* NOTES
- * The node in the m_aReservedNodes list must be in the tree order, otherwise
- * the result is unpredictable.
+ * The node in the m_aReservedNodes list must be in the tree order, otherwise
+ * the result is unpredictable.
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (pNode == m_pStopAtNode)
{
return NODE_STOPED;
}
-
+
if (pNode != m_pCurrentReservedNode)
{
xmlNodePtr pChild = pNode->children;
-
+
xmlNodePtr pNextSibling;
bool bIsRemoved = true;
sal_Int32 nResult;
-
+
while( pChild != NULL )
{
pNextSibling = pChild->next;
nResult = recursiveDelete(pChild);
-
+
switch (nResult)
{
case NODE_STOPED:
@@ -580,15 +580,15 @@ sal_Int32 XMLDocumentWrapper_XmlSecImpl::recursiveDelete(
default:
throw cssu::RuntimeException();
}
-
+
pChild = pNextSibling;
}
-
+
if (pNode == m_pCurrentElement)
{
bIsRemoved = false;
}
-
+
return bIsRemoved?NODE_REMOVED:NODE_NOTREMOVED;
}
else
@@ -602,31 +602,31 @@ void XMLDocumentWrapper_XmlSecImpl::getNextReservedNode()
/****** XMLDocumentWrapper_XmlSecImpl/getNextReservedNode *********************
*
* NAME
- * getNextReservedNode -- Highlights the next reserved node in the
- * reserved node list
+ * getNextReservedNode -- Highlights the next reserved node in the
+ * reserved node list
*
* SYNOPSIS
- * getNextReservedNode();
+ * getNextReservedNode();
*
* FUNCTION
- * The m_aReservedNodes array holds a node list, while the
- * m_pCurrentReservedNode points to the one currently highlighted.
- * This method is used to highlight the next node in the node list.
- * This method is called at the time when the current highlighted node
- * has been already processed, and the next node should be ready.
+ * The m_aReservedNodes array holds a node list, while the
+ * m_pCurrentReservedNode points to the one currently highlighted.
+ * This method is used to highlight the next node in the node list.
+ * This method is called at the time when the current highlighted node
+ * has been already processed, and the next node should be ready.
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (m_nReservedNodeIndex < m_aReservedNodes.getLength())
@@ -644,71 +644,71 @@ void XMLDocumentWrapper_XmlSecImpl::removeNode(const xmlNodePtr pNode) const
/****** XMLDocumentWrapper_XmlSecImpl/removeNode ******************************
*
* NAME
- * removeNode -- Deletes a node with its branch unconditionaly
+ * removeNode -- Deletes a node with its branch unconditionaly
*
* SYNOPSIS
- * removeNode( pNode );
+ * removeNode( pNode );
*
* FUNCTION
- * Delete the node along with its branch from the document.
+ * Delete the node along with its branch from the document.
*
* INPUTS
- * pNode - the node to be deleted
+ * pNode - the node to be deleted
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
/* you can't remove the current node */
OSL_ASSERT( m_pCurrentElement != pNode );
xmlAttrPtr pAttr = pNode->properties;
-
+
while (pAttr != NULL)
{
- if (!stricmp((sal_Char*)pAttr->name,"id"))
+ if (!stricmp((sal_Char*)pAttr->name,"id"))
{
xmlRemoveID(m_pDocument, pAttr);
}
-
+
pAttr = pAttr->next;
}
-
+
xmlUnlinkNode(pNode);
xmlFreeNode(pNode);
-}
+}
void XMLDocumentWrapper_XmlSecImpl::buildIDAttr(xmlNodePtr pNode) const
/****** XMLDocumentWrapper_XmlSecImpl/buildIDAttr *****************************
*
* NAME
- * buildIDAttr -- build the ID attribute of a node
+ * buildIDAttr -- build the ID attribute of a node
*
* SYNOPSIS
- * buildIDAttr( pNode );
+ * buildIDAttr( pNode );
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pNode - the node whose id attribute will be built
+ * pNode - the node whose id attribute will be built
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 14.06.2004 - implemented
+ * 14.06.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
xmlAttrPtr idAttr = xmlHasProp( pNode, (const unsigned char *)"id" );
@@ -716,7 +716,7 @@ void XMLDocumentWrapper_XmlSecImpl::buildIDAttr(xmlNodePtr pNode) const
{
idAttr = xmlHasProp( pNode, (const unsigned char *)"Id" );
}
-
+
if (idAttr != NULL)
{
xmlChar* idValue = xmlNodeListGetString( m_pDocument, idAttr->children, 1 ) ;
@@ -728,32 +728,32 @@ void XMLDocumentWrapper_XmlSecImpl::rebuildIDLink(xmlNodePtr pNode) const
/****** XMLDocumentWrapper_XmlSecImpl/rebuildIDLink ***************************
*
* NAME
- * rebuildIDLink -- rebuild the ID link for the branch
+ * rebuildIDLink -- rebuild the ID link for the branch
*
* SYNOPSIS
- * rebuildIDLink( pNode );
+ * rebuildIDLink( pNode );
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pNode - the node, from which the branch will be rebuilt
+ * pNode - the node, from which the branch will be rebuilt
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 14.06.2004 - implemented
+ * 14.06.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
if (pNode != NULL && pNode->type == XML_ELEMENT_NODE)
{
buildIDAttr( pNode );
-
+
xmlNodePtr child = pNode->children;
while (child != NULL)
{
@@ -782,9 +782,9 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::removeCurrentElement( )
throw (cssu::RuntimeException)
{
OSL_ASSERT( m_pCurrentElement != NULL );
-
+
xmlNodePtr pOldCurrentElement = m_pCurrentElement;
-
+
/*
* pop the top node in the parser context's
* nodeTab stack, then the parent of that node will
@@ -797,13 +797,13 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::removeCurrentElement( )
(sal_Char*)(pOldCurrentElement->name)
)));
m_pCurrentElement = saxHelper.getCurrentNode();
-
+
/*
* remove the node
*/
removeNode(pOldCurrentElement);
-}
-
+}
+
sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrent( const cssu::Reference< cssxw::XXMLElementWrapper >& node )
throw (cssu::RuntimeException)
{
@@ -815,12 +815,12 @@ sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrentElementEmpty( )
throw (cssu::RuntimeException)
{
sal_Bool rc = sal_False;
-
+
if (m_pCurrentElement->children == NULL)
{
rc = sal_True;
}
-
+
return rc;
}
@@ -831,20 +831,20 @@ rtl::OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getNodeName( const cssu::R
return rtl::OUString(RTL_UTF8_USTRINGPARAM ( (sal_Char*)pNode->name ));
}
-void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData(
- const cssu::Reference< cssxw::XXMLElementWrapper >& node,
- const cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >& reservedDescendants,
+void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData(
+ const cssu::Reference< cssxw::XXMLElementWrapper >& node,
+ const cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >& reservedDescendants,
const cssu::Reference< cssxw::XXMLElementWrapper >& stopAtNode )
throw (cssu::RuntimeException)
{
xmlNodePtr pTargetNode = checkElement(node);
-
+
m_pStopAtNode = checkElement(stopAtNode);
m_aReservedNodes = reservedDescendants;
m_nReservedNodeIndex = 0;
-
+
getNextReservedNode();
-
+
recursiveDelete(pTargetNode);
}
@@ -853,14 +853,14 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::collapse( const cssu::Reference< cs
{
xmlNodePtr pTargetNode = checkElement(node);
xmlNodePtr pParent;
-
+
while (pTargetNode != NULL)
{
if (pTargetNode->children != NULL || pTargetNode == m_pCurrentElement)
{
break;
}
-
+
pParent = pTargetNode->parent;
removeNode(pTargetNode);
pTargetNode = pParent;
@@ -874,12 +874,12 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const cssu::Reference< css
{
xmlNodePtr pTempCurrentElement = m_pCurrentElement;
sal_Int32 nTempCurrentPosition = m_nCurrentPosition;
-
+
m_pCurrentElement = m_pRootElement;
-
+
m_nCurrentPosition = NODEPOSITION_STARTELEMENT;
cssu::Reference< cssxs::XDocumentHandler > xHandler = handler;
-
+
while(true)
{
switch (m_nCurrentPosition)
@@ -894,24 +894,24 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const cssu::Reference< css
sendNode(NULL, xHandler, m_pCurrentElement);
break;
}
-
+
if ( (m_pCurrentElement == m_pRootElement) && (m_nCurrentPosition == NODEPOSITION_ENDELEMENT ))
{
break;
}
-
+
getNextSAXEvent();
}
-
+
m_pCurrentElement = pTempCurrentElement;
m_nCurrentPosition = nTempCurrentPosition;
}
}
-
+
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents(
const cssu::Reference< cssxs::XDocumentHandler >& handler,
const cssu::Reference< cssxs::XDocumentHandler >& xEventKeeperHandler,
- const cssu::Reference< cssxw::XXMLElementWrapper >& startNode,
+ const cssu::Reference< cssxw::XXMLElementWrapper >& startNode,
const cssu::Reference< cssxw::XXMLElementWrapper >& endNode )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -920,11 +920,11 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents(
* element.
*/
bool bHasCurrentElementChild = (m_pCurrentElement->children != NULL);
-
+
xmlNodePtr pTempCurrentElement = m_pCurrentElement;
-
+
m_pCurrentElement = checkElement(startNode);
-
+
if (m_pCurrentElement->type == XML_ELEMENT_NODE)
{
m_nCurrentPosition = NODEPOSITION_STARTELEMENT;
@@ -933,13 +933,13 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents(
{
m_nCurrentPosition = NODEPOSITION_NORMAL;
}
-
+
xmlNodePtr pEndNode = checkElement(endNode);
-
+
cssu::Reference < cssxc::sax::XSAXEventKeeper > xSAXEventKeeper( xEventKeeperHandler, cssu::UNO_QUERY );
-
+
cssu::Reference< cssxs::XDocumentHandler > xHandler = handler;
-
+
while(true)
{
switch (m_nCurrentPosition)
@@ -956,13 +956,13 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents(
default:
throw cssu::RuntimeException();
}
-
+
if (xSAXEventKeeper->isBlocking())
{
xHandler = NULL;
}
-
- if (pEndNode == NULL &&
+
+ if (pEndNode == NULL &&
((bHasCurrentElementChild && m_pCurrentElement == xmlGetLastChild(pTempCurrentElement) && m_nCurrentPosition != NODEPOSITION_STARTELEMENT) ||
(!bHasCurrentElementChild && m_pCurrentElement == pTempCurrentElement && m_nCurrentPosition == NODEPOSITION_STARTELEMENT)))
{
@@ -970,7 +970,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents(
}
getNextSAXEvent();
-
+
/*
* If there is an end point specified, then check whether
* the current node equals to the end point. If so, stop
@@ -981,7 +981,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents(
break;
}
}
-
+
m_pCurrentElement = pTempCurrentElement;
}
@@ -992,14 +992,14 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::rebuildIDLink(
xmlNodePtr pNode = checkElement( node );
rebuildIDLink(pNode);
}
-
+
/* cssxs::XDocumentHandler */
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startDocument( )
throw (cssxs::SAXException, cssu::RuntimeException)
{
}
-
+
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::endDocument( )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -1010,41 +1010,41 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startElement( const rtl::OUString&
{
sal_Int32 nLength = xAttribs->getLength();
cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength);
-
- for (int i = 0; i < nLength; ++i)
+
+ for (int i = 0; i < nLength; ++i)
{
aAttributes[i].sName = xAttribs->getNameByIndex((short)i);
aAttributes[i].sValue =xAttribs->getValueByIndex((short)i);
}
-
+
_startElement(aName, aAttributes);
}
-void SAL_CALL XMLDocumentWrapper_XmlSecImpl::endElement( const rtl::OUString& aName )
+void SAL_CALL XMLDocumentWrapper_XmlSecImpl::endElement( const rtl::OUString& aName )
throw (cssxs::SAXException, cssu::RuntimeException)
{
saxHelper.endElement(aName);
m_pCurrentElement = saxHelper.getCurrentNode();
}
-
+
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::characters( const rtl::OUString& aChars )
throw (cssxs::SAXException, cssu::RuntimeException)
{
saxHelper.characters(aChars);
}
-
+
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (cssxs::SAXException, cssu::RuntimeException)
{
saxHelper.ignorableWhitespace(aWhitespaces);
}
-
+
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (cssxs::SAXException, cssu::RuntimeException)
{
saxHelper.processingInstruction(aTarget, aData);
}
-
+
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator )
throw (cssxs::SAXException, cssu::RuntimeException)
{
@@ -1067,7 +1067,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_startElement( const rtl::OUString&
{
saxHelper.startElement(aName, aAttributes);
m_pCurrentElement = saxHelper.getCurrentNode();
-
+
buildIDAttr( m_pCurrentElement );
}
@@ -1106,13 +1106,13 @@ rtl::OUString XMLDocumentWrapper_XmlSecImpl_getImplementationName ()
return rtl::OUString ( RTL_ASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -1130,17 +1130,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL XMLDocumentWrapper_XmlSecImpl_creat
}
/* XServiceInfo */
-rtl::OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getImplementationName( )
+rtl::OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return XMLDocumentWrapper_XmlSecImpl_getImplementationName();
}
-sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return XMLDocumentWrapper_XmlSecImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames();
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx
index 3ec30d51a3e8..5fcf9be6fd18 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,8 +43,8 @@
#include <libxml/tree.h>
-class XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper4
-<
+class XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper4
+<
com::sun::star::xml::wrapper::XXMLDocumentWrapper,
com::sun::star::xml::sax::XDocumentHandler,
com::sun::star::xml::csax::XCompressedDocumentHandler,
@@ -53,21 +53,21 @@ class XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper4
/****** XMLDocumentWrapper_XmlSecImpl.hxx/CLASS XMLDocumentWrapper_XmlSecImpl *
*
* NAME
- * XMLDocumentWrapper_XmlSecImpl -- Class to manipulate a libxml2
- * document
+ * XMLDocumentWrapper_XmlSecImpl -- Class to manipulate a libxml2
+ * document
*
* FUNCTION
- * Converts SAX events into a libxml2 document, converts the document back
- * into SAX event stream, and manipulate nodes in the document.
+ * Converts SAX events into a libxml2 document, converts the document back
+ * into SAX event stream, and manipulate nodes in the document.
*
* HISTORY
- * 05.01.2004 - Interface supported: XXMLDocumentWrapper,
- * XDocumentHandler, XCompressedDocumentHandler,
- * XServiceInfo
+ * 05.01.2004 - Interface supported: XXMLDocumentWrapper,
+ * XDocumentHandler, XCompressedDocumentHandler,
+ * XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
@@ -76,22 +76,22 @@ private:
/* the document used to convert SAX events to */
xmlDocPtr m_pDocument;
-
+
/* the root element */
xmlNodePtr m_pRootElement;
-
+
/*
* the current active element. The next incoming SAX event will be
* appended to this element
*/
xmlNodePtr m_pCurrentElement;
-
- /*
+
+ /*
* This variable is used when converting the document or part of it into
* SAX events. See getNextSAXEvent method.
- */
+ */
sal_Int32 m_nCurrentPosition;
-
+
/*
* used for recursive deletion. See recursiveDelete method
*/
@@ -100,182 +100,182 @@ private:
com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper > > m_aReservedNodes;
sal_Int32 m_nReservedNodeIndex;
-
+
private:
void getNextSAXEvent();
-
+
void sendStartElement(
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2,
const xmlNodePtr pNode) const
throw (com::sun::star::xml::sax::SAXException);
-
+
void sendEndElement(
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2,
const xmlNodePtr pNode) const
throw (com::sun::star::xml::sax::SAXException);
-
+
void sendNode(
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2,
const xmlNodePtr pNode) const
throw (com::sun::star::xml::sax::SAXException);
-
+
rtl::OString getNodeQName(const xmlNodePtr pNode) const;
-
+
sal_Int32 recursiveDelete( const xmlNodePtr pNode);
-
+
void getNextReservedNode();
-
+
void removeNode( const xmlNodePtr pNode) const;
-
+
xmlNodePtr checkElement(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& xXMLElement) const;
-
+
void buildIDAttr( xmlNodePtr pNode ) const;
void rebuildIDLink( xmlNodePtr pNode ) const;
-
+
public:
XMLDocumentWrapper_XmlSecImpl();
virtual ~XMLDocumentWrapper_XmlSecImpl();
-
+
/* com::sun::star::xml::wrapper::XXMLDocumentWrapper */
virtual com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getCurrentElement( )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setCurrentElement( const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& element )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL removeCurrentElement( )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual sal_Bool SAL_CALL isCurrent( const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& node )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual sal_Bool SAL_CALL isCurrentElementEmpty( )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual rtl::OUString SAL_CALL getNodeName( const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& node )
throw (com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL clearUselessData(
+
+ virtual void SAL_CALL clearUselessData(
const com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper >& node,
+ com::sun::star::xml::wrapper::XXMLElementWrapper >& node,
const com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper > >& reservedDescendants,
+ com::sun::star::xml::wrapper::XXMLElementWrapper > >& reservedDescendants,
const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& stopAtNode )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL collapse( const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& node )
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL generateSAXEvents(
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& handler,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xEventKeeperHandler,
const com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLElementWrapper >& startNode,
+ com::sun::star::xml::wrapper::XXMLElementWrapper >& startNode,
const com::sun::star::uno::Reference<
com::sun::star::xml::wrapper::XXMLElementWrapper >& endNode )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL getTree(
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& handler )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL rebuildIDLink(
const com::sun::star::uno::Reference< com::sun::star::xml::wrapper::XXMLElementWrapper >& node )
throw (com::sun::star::uno::RuntimeException);
- /* com::sun::star::xml::sax::XDocumentHandler */
+ /* com::sun::star::xml::sax::XDocumentHandler */
virtual void SAL_CALL startDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL endDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL startElement(
const rtl::OUString& aName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL endElement( const rtl::OUString& aName )
+
+ virtual void SAL_CALL endElement( const rtl::OUString& aName )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL characters( const rtl::OUString& aChars )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
/* com::sun::star::xml::csax::XCompressedDocumentHandler */
virtual void SAL_CALL _startDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL _endDocument( )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL _startElement(
const rtl::OUString& aName,
- const com::sun::star::uno::Sequence<
+ const com::sun::star::uno::Sequence<
com::sun::star::xml::csax::XMLAttribute >& aAttributes )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL _endElement( const rtl::OUString& aName )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL _characters( const rtl::OUString& aChars )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL _ignorableWhitespace( const rtl::OUString& aWhitespaces )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL _processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL _setDocumentLocator(
+
+ virtual void SAL_CALL _setDocumentLocator(
sal_Int32 columnNumber,
sal_Int32 lineNumber,
const rtl::OUString& publicId,
const rtl::OUString& systemId )
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
-
+
/* com::sun::star::lang::XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
-
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
};
rtl::OUString XMLDocumentWrapper_XmlSecImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
- XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance(
+SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance(
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr)
throw ( com::sun::star::uno::Exception );
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
index 72c498e939fd..c51993226ed8 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -47,7 +47,7 @@ XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNod
/* XUnoTunnel */
-cssu::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId( void )
+cssu::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId( void )
throw (cssu::RuntimeException)
{
static ::cppu::OImplementationId* pId = 0;
@@ -87,13 +87,13 @@ rtl::OUString XMLElementWrapper_XmlSecImpl_getImplementationName ()
return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
-sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
throw (cssu::RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ));
}
-cssu::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < rtl::OUString > aRet(1);
@@ -112,17 +112,17 @@ cssu::Reference< cssu::XInterface > SAL_CALL
}
/* XServiceInfo */
-rtl::OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName( )
+rtl::OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName( )
throw (cssu::RuntimeException)
{
return XMLElementWrapper_XmlSecImpl_getImplementationName();
}
-sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl::supportsService( const rtl::OUString& rServiceName )
+sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl::supportsService( const rtl::OUString& rServiceName )
throw (cssu::RuntimeException)
{
return XMLElementWrapper_XmlSecImpl_supportsService( rServiceName );
}
-cssu::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl::getSupportedServiceNames( )
+cssu::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
return XMLElementWrapper_XmlSecImpl_getSupportedServiceNames();
@@ -132,26 +132,26 @@ xmlNodePtr XMLElementWrapper_XmlSecImpl::getNativeElement( ) const
/****** XMLElementWrapper_XmlSecImpl/getNativeElement *************************
*
* NAME
- * getNativeElement -- Retrieves the libxml2 node wrapped by this object
+ * getNativeElement -- Retrieves the libxml2 node wrapped by this object
*
* SYNOPSIS
- * pNode = getNativeElement();
+ * pNode = getNativeElement();
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * empty
+ * empty
*
* RESULT
- * pNode - the libxml2 node wrapped by this object
+ * pNode - the libxml2 node wrapped by this object
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
return m_pElement;
@@ -161,26 +161,26 @@ void XMLElementWrapper_XmlSecImpl::setNativeElement(const xmlNodePtr pNode)
/****** XMLElementWrapper_XmlSecImpl/setNativeElement *************************
*
* NAME
- * setNativeElement -- Configures the libxml2 node wrapped by this object
+ * setNativeElement -- Configures the libxml2 node wrapped by this object
*
* SYNOPSIS
- * setNativeElement( pNode );
+ * setNativeElement( pNode );
*
* FUNCTION
- * see NAME
+ * see NAME
*
* INPUTS
- * pNode - the new libxml2 node to be wrapped by this object
+ * pNode - the new libxml2 node to be wrapped by this object
*
* RESULT
- * empty
+ * empty
*
* HISTORY
- * 05.01.2004 - implemented
+ * 05.01.2004 - implemented
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
m_pElement = pNode;
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
index dbd7ff941ca2..764620f4d756 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,8 +37,8 @@
#include <libxml/tree.h>
-class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper3
-<
+class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper3
+<
com::sun::star::xml::wrapper::XXMLElementWrapper,
com::sun::star::lang::XUnoTunnel,
com::sun::star::lang::XServiceInfo
@@ -46,43 +46,43 @@ class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper3
/****** XMLElementWrapper_XmlSecImpl.hxx/CLASS XMLElementWrapper_XmlSecImpl ***
*
* NAME
- * XMLElementWrapper_XmlSecImpl -- Class to wrap a libxml2 node
+ * XMLElementWrapper_XmlSecImpl -- Class to wrap a libxml2 node
*
* FUNCTION
- * Used as a wrapper class to transfer a libxml2 node structure
- * between different UNO components.
+ * Used as a wrapper class to transfer a libxml2 node structure
+ * between different UNO components.
*
* HISTORY
- * 05.01.2004 - Interface supported: XXMLElementWrapper, XUnoTunnel
- * XServiceInfo
+ * 05.01.2004 - Interface supported: XXMLElementWrapper, XUnoTunnel
+ * XServiceInfo
*
* AUTHOR
- * Michael Mi
- * Email: michael.mi@sun.com
+ * Michael Mi
+ * Email: michael.mi@sun.com
******************************************************************************/
{
private:
/* the libxml2 node wrapped by this object */
xmlNodePtr m_pElement;
-
+
public:
explicit XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode);
virtual ~XMLElementWrapper_XmlSecImpl() {};
/* XXMLElementWrapper */
-
+
/* com::sun::star::lang::XUnoTunnel */
virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
throw (com::sun::star::uno::RuntimeException);
- static com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void )
+ static com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void )
throw(com::sun::star::uno::RuntimeException);
-
+
/* com::sun::star::lang::XServiceInfo */
- virtual rtl::OUString SAL_CALL getImplementationName( )
+ virtual rtl::OUString SAL_CALL getImplementationName( )
throw (com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
throw (com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (com::sun::star::uno::RuntimeException);
public:
@@ -93,10 +93,10 @@ public:
rtl::OUString XMLElementWrapper_XmlSecImpl_getImplementationName()
throw ( com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
throw ( com::sun::star::uno::RuntimeException );
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( )
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( )
throw ( com::sun::star::uno::RuntimeException );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
index 739af895c849..8785cc6ab42f 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -64,20 +64,20 @@ int xmlStreamMatch( const char* uri )
( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) {
if( uri == NULL || !m_xUriBinding.is() )
return 0 ;
- //XMLSec first unescapes the uri and calls this function. For example, we pass the Uri
- //ObjectReplacements/Object%201 then XMLSec passes ObjectReplacements/Object 1
- //first. If this failed it would try this
+ //XMLSec first unescapes the uri and calls this function. For example, we pass the Uri
+ //ObjectReplacements/Object%201 then XMLSec passes ObjectReplacements/Object 1
+ //first. If this failed it would try this
//again with the original escaped string. However, it does not get this far, because there
//is another callback registered by libxml which claims to be able to handle this uri.
::rtl::OUString sUri =
- ::rtl::Uri::encode( ::rtl::OUString::createFromAscii( uri ),
- rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
+ ::rtl::Uri::encode( ::rtl::OUString::createFromAscii( uri ),
+ rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
xInputStream = m_xUriBinding->getUriBinding( sUri ) ;
if (!xInputStream.is())
{
//Try the the passed in uri directly.
- //For old documents prior OOo 3.0. We did not use URIs then.
- xInputStream = m_xUriBinding->getUriBinding(
+ //For old documents prior OOo 3.0. We did not use URIs then.
+ xInputStream = m_xUriBinding->getUriBinding(
::rtl::OUString::createFromAscii(uri));
}
}
@@ -100,17 +100,17 @@ void* xmlStreamOpen( const char* uri )
//see xmlStreamMatch
::rtl::OUString sUri =
- ::rtl::Uri::encode( ::rtl::OUString::createFromAscii( uri ),
- rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
+ ::rtl::Uri::encode( ::rtl::OUString::createFromAscii( uri ),
+ rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
xInputStream = m_xUriBinding->getUriBinding( sUri ) ;
if (!xInputStream.is())
{
//For old documents.
//try the the passed in uri directly.
- xInputStream = m_xUriBinding->getUriBinding(
+ xInputStream = m_xUriBinding->getUriBinding(
::rtl::OUString::createFromAscii(uri));
}
-
+
if( xInputStream.is() ) {
pInputStream = xInputStream.get() ;
pInputStream->acquire() ;
@@ -169,12 +169,12 @@ int xmlEnableStreamInputCallbacks()
if( !( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) ) {
//Register the callbacks into libxml2
//cbs = xmlRegisterInputCallbacks(
- // xmlStreamMatch,
- // xmlStreamOpen,
- // xmlStreamRead,
- // xmlStreamClose ) ;
+ // xmlStreamMatch,
+ // xmlStreamOpen,
+ // xmlStreamRead,
+ // xmlStreamClose ) ;
//if( cbs < 0 ) {
- // return -1 ;
+ // return -1 ;
//}
//Register the callbacks into xmlSec
diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.hxx b/xmlsecurity/source/xmlsec/xmlstreamio.hxx
index eb61e9897606..188db15c9a1a 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.hxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,7 +35,7 @@
int xmlEnableStreamInputCallbacks( void ) ;
void xmlDisableStreamInputCallbacks( void ) ;
-int xmlRegisterStreamInputCallbacks(
+int xmlRegisterStreamInputCallbacks(
::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding >& aUriBinding
) ;
diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
index f8b12075f639..cd31bcb6b211 100644
--- a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
+++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -54,7 +54,7 @@ namespace
class SerialNumberAdapterImpl : public WeakImplHelper1<
::com::sun::star::security::XSerialNumberAdapter >
{
- virtual OUString SAL_CALL toString( const Sequence< sal_Int8 >& rSerialNumber )
+ virtual OUString SAL_CALL toString( const Sequence< sal_Int8 >& rSerialNumber )
throw (RuntimeException)
{
return bigIntegerToNumericString(rSerialNumber);
@@ -121,7 +121,7 @@ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager , void* pRegistryKe
Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ;
if( xKey.is() ) {
- // try {
+ // try {
// XMLElementWrapper_XmlSecImpl
sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ;
sKeyName += XMLElementWrapper_XmlSecImpl_getImplementationName() ;
@@ -163,7 +163,7 @@ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager , void* pRegistryKe
if( !result )
return sal_False ;
#endif
-
+
#if defined( XMLSEC_CRYPTO_MSCRYPTO )
result = mscrypt_component_writeInfo( pServiceManager, pRegistryKey ) ;
if( !result )
@@ -171,8 +171,8 @@ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager , void* pRegistryKe
#endif
//} catch( InvalidRegistryException & ) {
- // //we should not ignore exceptions
- // return sal_False ;
+ // //we should not ignore exceptions
+ // return sal_False ;
//}
}
@@ -185,21 +185,21 @@ void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceM
Reference< XInterface > xFactory ;
if( pImplName != NULL && pServiceManager != NULL ) {
- if( XMLElementWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
+ if( XMLElementWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
{
xFactory = Reference< XSingleServiceFactory >( createSingleFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
XMLElementWrapper_XmlSecImpl_createInstance, XMLElementWrapper_XmlSecImpl_getSupportedServiceNames() ) );
}
- else if( XMLDocumentWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
+ else if( XMLDocumentWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
{
xFactory = Reference< XSingleServiceFactory >( createSingleFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
XMLDocumentWrapper_XmlSecImpl_createInstance, XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames() ) );
}
- else if( SerialNumberAdapterImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
+ else if( SerialNumberAdapterImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
{
xFactory = ::cppu::createSingleComponentFactory(
SerialNumberAdapterImpl_createInstance,
@@ -217,7 +217,7 @@ void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceM
if( pRet != NULL )
return pRet ;
#endif
-
+
#if defined( XMLSEC_CRYPTO_MSCRYPTO )
pRet = mscrypt_component_getFactory( pImplName, pServiceManager, pRegistryKey ) ;
if( pRet != NULL )
diff --git a/xmlsecurity/test_docs/tools/httpserv/build.xml b/xmlsecurity/test_docs/tools/httpserv/build.xml
index 831e963bce65..092141f01440 100755
--- a/xmlsecurity/test_docs/tools/httpserv/build.xml
+++ b/xmlsecurity/test_docs/tools/httpserv/build.xml
@@ -12,9 +12,9 @@
<import file="nbproject/build-impl.xml"/>
<!--
- There exist several targets which are by default empty and which can be
- used for execution of your tasks. These targets are usually executed
- before and after some main targets. They are:
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
@@ -40,12 +40,12 @@
</obfuscate>
</target>
- For list of available properties check the imported
- nbproject/build-impl.xml file.
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
- The targets of interest are:
+ The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
@@ -53,7 +53,7 @@
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
- run: execution of project
+ run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
@@ -65,10 +65,10 @@
</exec>
</target>
- Notice that the overridden target depends on the jar target and not only on
- the compile target as the regular run target does. Again, for a list of available
+ Notice that the overridden target depends on the jar target and not only on
+ the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
- nbproject/build-impl.xml file.
+ nbproject/build-impl.xml file.
-->
</project>
diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml b/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml
index 9064a3305e2d..ed83ec2db418 100755
--- a/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml
+++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml
@@ -28,9 +28,9 @@ is divided into following sections:
</condition>
</fail>
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
- <!--
+ <!--
======================
- INITIALIZATION SECTION
+ INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
diff --git a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
index c67e41549c5f..4466a430549d 100755
--- a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
+++ b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -114,7 +114,7 @@ public class Main {
}
break;
}
- }
+ }
}
}
diff --git a/xmlsecurity/tools/demo/JavaFlatFilter.java b/xmlsecurity/tools/demo/JavaFlatFilter.java
index 331ace804072..5df9027e9a0c 100644
--- a/xmlsecurity/tools/demo/JavaFlatFilter.java
+++ b/xmlsecurity/tools/demo/JavaFlatFilter.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,92 +53,92 @@ public class JavaFlatFilter extends Object
implements XDocumentHandler, XParser, XTypeProvider, XServiceInfo
{
XDocumentHandler m_xDocumentHandler;
-
+
/* XDocumentHandler */
- public void startDocument()
- throws com.sun.star.xml.sax.SAXException
+ public void startDocument()
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.startDocument();
}
-
+
public void endDocument()
- throws com.sun.star.xml.sax.SAXException
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.endDocument();
}
-
- public void startElement (String aName, com.sun.star.xml.sax.XAttributeList xAttribs )
- throws com.sun.star.xml.sax.SAXException
+
+ public void startElement (String aName, com.sun.star.xml.sax.XAttributeList xAttribs )
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.startElement(aName, xAttribs);
}
-
- public void endElement ( String aName )
- throws com.sun.star.xml.sax.SAXException
+
+ public void endElement ( String aName )
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.endElement(aName);
}
-
- public void characters ( String aChars )
- throws com.sun.star.xml.sax.SAXException
+
+ public void characters ( String aChars )
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.characters(aChars);
}
-
- public void ignorableWhitespace ( String aWhitespaces )
- throws com.sun.star.xml.sax.SAXException
+
+ public void ignorableWhitespace ( String aWhitespaces )
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.ignorableWhitespace(aWhitespaces);
}
-
- public void processingInstruction ( String aTarget, String aData )
- throws com.sun.star.xml.sax.SAXException
+
+ public void processingInstruction ( String aTarget, String aData )
+ throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.processingInstruction(aTarget, aData);
}
-
- public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
+
+ public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
throws com.sun.star.xml.sax.SAXException
{
m_xDocumentHandler.setDocumentLocator(xLocator);
}
-
+
/* XParser */
public void parseStream(InputSource strucInputSource)
{
}
-
+
public void setDocumentHandler(XDocumentHandler xDocumentHandler)
{
m_xDocumentHandler = xDocumentHandler;
}
-
+
public void setDTDHandler(XDTDHandler xHandler)
{
}
-
+
public void setEntityResolver(XEntityResolver xResolver)
{
}
-
+
public void setErrorHandler(XErrorHandler xHandler)
{
}
-
+
public void setLocale(Locale locale)
{
}
-
+
/*
* XTypeProvider implementation
* maintain a static implementation id for all instances of JavaFlatFilter
* initialized by the first call to getImplementationId()
*/
protected static byte[] _implementationId;
- public com.sun.star.uno.Type[] getTypes()
+ public com.sun.star.uno.Type[] getTypes()
{
com.sun.star.uno.Type[] retValue = new com.sun.star.uno.Type[4];
-
+
/*
* instantiate Type instances for each interface you support and add them to Type[] array
* this object implements XServiceInfo, XTypeProvider and XSignFilter
@@ -147,15 +147,15 @@ public class JavaFlatFilter extends Object
retValue[1]= new com.sun.star.uno.Type( XTypeProvider.class);
retValue[2]= new com.sun.star.uno.Type( XDocumentHandler.class);
retValue[3]= new com.sun.star.uno.Type( XParser.class);
-
+
/*
* XInterface is not needed for Java components, the UnoRuntime does its job
*/
-
+
return retValue;
}
-
- synchronized public byte[] getImplementationId()
+
+ synchronized public byte[] getImplementationId()
{
if (_implementationId == null) {
_implementationId= new byte[16];
@@ -166,42 +166,42 @@ public class JavaFlatFilter extends Object
_implementationId[3] = (byte)((hash >>>24) & 0xff);
}
return _implementationId;
- }
-
-
+ }
+
+
/*
* XServiceInfo implementation
* hold the service name in a private static member variable of the class
*/
protected static final String __serviceName = "com.sun.star.xml.crypto.eval.JavaFlatFilter";
- public String getImplementationName( )
+ public String getImplementationName( )
{
return getClass().getName();
}
-
- public boolean supportsService(String serviceName)
+
+ public boolean supportsService(String serviceName)
{
boolean rc = false;
-
+
if ( serviceName.equals( __serviceName))
{
rc = true;
}
-
+
return rc;
}
-
- public String[] getSupportedServiceNames( )
+
+ public String[] getSupportedServiceNames( )
{
String[] retValue= new String[0];
retValue[0]= __serviceName;
return retValue;
}
-
+
/* static __getServiceFactory() implementation */
public static XSingleServiceFactory __getServiceFactory(String implName,
XMultiServiceFactory multiFactory,
- com.sun.star.registry.XRegistryKey regKey)
+ com.sun.star.registry.XRegistryKey regKey)
{
com.sun.star.lang.XSingleServiceFactory xSingleServiceFactory = null;
if (implName.equals( JavaFlatFilter.class.getName()) )
@@ -211,15 +211,15 @@ public class JavaFlatFilter extends Object
multiFactory,
regKey);
}
-
+
return xSingleServiceFactory;
- }
-
+ }
+
/* static __writeRegistryServiceInfo implementation */
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
+ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
{
return FactoryHelper.writeRegistryServiceInfo( JavaFlatFilter.class.getName(),
__serviceName,
regKey);
- }
+ }
}
diff --git a/xmlsecurity/tools/demo/mozprofile.cxx b/xmlsecurity/tools/demo/mozprofile.cxx
index 4c08e3a82e5a..a6326018ff80 100644
--- a/xmlsecurity/tools/demo/mozprofile.cxx
+++ b/xmlsecurity/tools/demo/mozprofile.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,14 +52,14 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stdout, "\n\nERROR: Can't create Service Factory\n" );
exit (-1);
}
-
+
uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap( xMSF->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap" ) ) ), uno::UNO_QUERY );
if ( !xMozillaBootstrap.is() )
{
fprintf( stdout, "\n\nERROR: Can't create Mozilla Bootstrap Service\n" );
exit (-1);
}
-
+
int nProducts = 4;
mozilla::MozillaProductType productTypes[4] = { mozilla::MozillaProductType_Thunderbird, mozilla::MozillaProductType_Mozilla, mozilla::MozillaProductType_Firefox, mozilla::MozillaProductType_Default };
for ( int i = 0; i < nProducts; i++)
@@ -84,12 +84,12 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stdout, "NOT FOUND" );
}
}
-
+
/*
* creates a signature helper
*/
XMLSignatureHelper aSignatureHelper( xMSF );
-
+
/*
* creates a security context.
*/
@@ -102,7 +102,7 @@ int SAL_CALL main( int argc, char **argv )
else
{
fprintf( stdout, "\n\nSecurity environment can be initialized successfully.\n\n" );
- }
+ }
return 0;
}
diff --git a/xmlsecurity/tools/demo/multisigdemo.cxx b/xmlsecurity/tools/demo/multisigdemo.cxx
index 356616451ed6..f5d2b95650ca 100644
--- a/xmlsecurity/tools/demo/multisigdemo.cxx
+++ b/xmlsecurity/tools/demo/multisigdemo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -55,7 +55,7 @@ long startVerifyHandler( void *, void * )
int SAL_CALL main( int argc, char **argv )
{
- if( argc < 5 )
+ if( argc < 5 )
{
fprintf( stderr, "Usage: %s <signature file 1> <signature file 2> <xml stream file> <binary stream file> [<cryptoken>]\n" , argv[0] ) ;
return -1 ;
@@ -77,7 +77,7 @@ int SAL_CALL main( int argc, char **argv )
bool bDone;
SignatureInformations signatureInformations;
uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler;
-
+
// -------- START -------
XMLSignatureHelper aSignatureHelper( xMSF );
@@ -88,11 +88,11 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stderr, "Error initializing security context!\n" );
return -1;
}
-
+
fprintf( stdout, "\n\nTEST MISSION 1: Create the first signature file\n");
-
+
aSignatureHelper.StartMission();
-
+
/*
* select a private key certificate
*/
@@ -127,14 +127,14 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stdout, "\nSTATUS MISSION 1: Signature successfully created!\n" );
aSignatureHelper.EndMission();
-
-
+
+
fprintf( stdout, "\n\nTEST MISSION 2: Transfer the second signature to a new signature file\n");
-
+
/*
* You can use an uninitialized SignatureHelper to perform this mission.
*/
-
+
/*
* configures the start-verify handler. Don't need to verify for transfering...
*/
@@ -149,16 +149,16 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stderr, "\nSTATUS MISSION 2: Error in reading Signature!\n" );
else
fprintf( stdout, "\nSTATUS MISSION 2: Signature successfully transfered!\n" );
-
+
/*
* get all signature information
*/
signatureInformations = aSignatureHelper.GetSignatureInformations();
-
+
/*
* write the first signature into the second signature file.
- */
-
+ */
+
xOutputStream = OpenOutputStream( aSIGFileName2 );
xDocumentHandler = aSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream);
aSignatureHelper.ExportSignature( xDocumentHandler, signatureInformations[1]);
@@ -168,7 +168,7 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stdout, "\n\nTEST MISSION 3: Insert a new signature to the first signature file\n");
aSignatureHelper.StartMission();
-
+
nSecurityId = aSignatureHelper.GetNewSecurityId();
// Select certificate...
@@ -181,10 +181,10 @@ int SAL_CALL main( int argc, char **argv )
aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True );
aSignatureHelper.SetDateTime( nSecurityId, Date(), Time() );
-
+
xOutputStream = OpenOutputStream( aSIGFileName );
xDocumentHandler = aSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream);
-
+
aSignatureHelper.ExportSignature( xDocumentHandler, signatureInformations[0]);
bDone = aSignatureHelper.CreateAndWriteSignature( xDocumentHandler );
aSignatureHelper.ExportSignature( xDocumentHandler, signatureInformations[1]);
@@ -198,7 +198,7 @@ int SAL_CALL main( int argc, char **argv )
aSignatureHelper.EndMission();
fprintf( stdout, "\n\nTEST MISSION 4 : Verify the first signature file\n");
-
+
aSignatureHelper.SetStartVerifySignatureHdl( Link( NULL, startVerifyHandler ) );
aSignatureHelper.StartMission();
@@ -206,7 +206,7 @@ int SAL_CALL main( int argc, char **argv )
xInputStream = OpenInputStream( aSIGFileName );
bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream );
xInputStream->closeInput();
-
+
if ( !bDone )
fprintf( stderr, "\nSTATUS MISSION 4: Error verifying Signatures!\n" );
else
@@ -217,13 +217,13 @@ int SAL_CALL main( int argc, char **argv )
QueryPrintSignatureDetails( aSignatureHelper.GetSignatureInformations(), aSignatureHelper.GetSecurityEnvironment() );
fprintf( stdout, "\n\nTEST MISSION 5: Verify the second signature file\n");
-
+
aSignatureHelper.StartMission();
xInputStream = OpenInputStream( aSIGFileName2 );
bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream );
xInputStream->closeInput();
-
+
if ( !bDone )
fprintf( stderr, "\nSTATUS MISSION 5: Error verifying Signatures!\n" );
else
diff --git a/xmlsecurity/tools/demo/performance.cxx b/xmlsecurity/tools/demo/performance.cxx
index bcf0d203bfad..374e85428a17 100644
--- a/xmlsecurity/tools/demo/performance.cxx
+++ b/xmlsecurity/tools/demo/performance.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -151,7 +151,7 @@ class XSecTester;
* The XSecTester class is a C++ version of SecurityFramworkController.java
*
*/
-
+
class SecurityEntity
{
private:
@@ -159,58 +159,58 @@ private:
rtl::OUString m_ouKeyURI;
protected:
- com::sun::star::uno::Reference<
+ com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory > mxMSF;
-
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
+
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
m_xReferenceListener;
-
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >
+
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >
m_xSAXEventKeeper;
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::XXMLSecurityContext >
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::XXMLSecurityContext >
m_xXMLSecurityContext;
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::XXMLSignature >
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::XXMLSignature >
m_xXMLSignature;
-
+
int m_nSecurityId;
-private:
+private:
int getNextSecurityId() const;
protected:
SecurityEntity(
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >&
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >&
xSAXEventKeeper,
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::XXMLSecurityContext >&
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::XXMLSecurityContext >&
xXMLSecurityContext,
- const com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::XXMLSignature >&
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::XXMLSignature >&
xXMLSignature,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >&
rsMSF);
-
+
public:
void setKeyId(int nId);
-
+
int getSecurityId() const;
-
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
+
+ com::sun::star::uno::Reference<
+ com::sun::star::xml::crypto::sax::XReferenceResolvedListener >
getReferenceListener() const;
-
+
bool setKey( const rtl::OUString& ouUri, bool bIsExporting );
-
+
void setKeyURI(const rtl::OUString& ouUri);
-
+
bool endMission();
};
@@ -225,12 +225,12 @@ private:
public:
SignatureEntity(
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >&
xSAXEventKeeper,
- bool bIsExporting,
+ bool bIsExporting,
XSecTester* pListener,
- const com::sun::star::uno::Reference<
+ const com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext >&
xXMLSecurityContext,
const com::sun::star::uno::Reference<
@@ -240,7 +240,7 @@ public:
com::sun::star::lang::XMultiServiceFactory >&
rsMSF);
~SignatureEntity(){};
-
+
void setReferenceNumber() const;
bool setReference( const rtl::OUString& ouUri, bool bIsExporting ) const;
void addReferenceURI( const rtl::OUString& ouUri );
@@ -249,17 +249,17 @@ public:
struct AncestorEvent
{
AncestorEvent( sal_Int32 nAttrNum ):aAttributeList(nAttrNum){};
-
+
bool bIsStartElement;
rtl::OUString ouName;
-
- com::sun::star::uno::Sequence<
+
+ com::sun::star::uno::Sequence<
com::sun::star::xml::csax::XMLAttribute >
aAttributeList;
};
-
+
class XSecTester : public cppu::WeakImplHelper4
-<
+<
com::sun::star::xml::crypto::sax::XSignatureCreationResultListener,
com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener,
com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener,
@@ -268,160 +268,160 @@ class XSecTester : public cppu::WeakImplHelper4
{
private:
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
-
+
sal_Int32 m_nTotalSignatureNumber;
sal_Int32 m_nSuccessfulSignatureNumber;
com::sun::star::uno::Reference<
- com::sun::star::xml::sax::XDocumentHandler >
+ com::sun::star::xml::sax::XDocumentHandler >
m_xExportHandler;
-
+
com::sun::star::uno::Reference<
com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >
m_xSAXEventKeeper;
-
+
com::sun::star::uno::Reference<
- com::sun::star::xml::wrapper::XXMLDocumentWrapper >
+ com::sun::star::xml::wrapper::XXMLDocumentWrapper >
m_xXMLDocumentWrapper;
-
+
com::sun::star::uno::Reference<
- com::sun::star::xml::sax::XDocumentHandler >
+ com::sun::star::xml::sax::XDocumentHandler >
m_xOutputHandler;
-
- com::sun::star::uno::Reference<
+
+ com::sun::star::uno::Reference<
com::sun::star::xml::sax::XParser >
m_xSaxParser;
std::stack< void* > m_stCurrentPath;
std::stack< bool > m_stCurrentPathType;
-
+
std::vector< AncestorEvent* > m_vAncestorEvents;
std::vector< SignatureEntity* > m_vSignatureList;
-
+
std::vector< rtl::OUString > m_vUnsolvedReferenceURIs;
std::vector< int > m_vUnsolvedReferenceKeeperIds;
std::vector< int > m_vUnsolvedReferenceRefNums;
-
+
bool m_bIsExporting;
bool m_bIsBlocking;
-
+
bool m_bIsInsideCollectedElement;
bool m_bIsSAXEventKeeperOnTheSAXChain;
-
+
com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::XXMLSecurityContext >
+ com::sun::star::xml::crypto::XXMLSecurityContext >
m_xXMLSecurityContext;
-
+
com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::XXMLSignature >
+ com::sun::star::xml::crypto::XXMLSignature >
m_xXMLSignature;
-
+
rtl::OUString m_ouJavaCryptokenDir;
rtl::OUString m_ouCCryptokenDir;
rtl::OUString m_ouXMLDocumentWrapperComponentName;
-
+
private:
- com::sun::star::uno::Reference<
- com::sun::star::io::XOutputStream >
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream >
createOutputStream( const rtl::OUString& ouFile );
-
+
rtl::OUString parseFile(
- const rtl::OUString& ouInputFileName,
- const rtl::OUString& ouOutputFileName,
+ const rtl::OUString& ouInputFileName,
+ const rtl::OUString& ouOutputFileName,
bool bIsExporting,
bool bIsJavaBased);
-
+
void changeOutput();
-
+
bool foundSecurityRelated();
-
+
void findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::OUString& ouUri, bool bIsFindKey);
-
+
bool checkSecurityElement(
const rtl::OUString& ouLocalName,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XAttributeList>& xAttribs);
-
+
void checkReference(
const rtl::OUString& ouLocalName,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XAttributeList>& xAttribs,
const rtl::OUString& ouId);
-
+
void endMission();
-
+
void addStartAncestorEvent(
const rtl::OUString& ouName,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XAttributeList>& xAttribs);
-
+
void addEndAncestorEvent( const rtl::OUString& ouName );
-
+
void flushAncestorEvents(
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler);
-
+
void XSecTester::sendAncestorStartElementEvent(
- const rtl::OUString& ouName,
+ const rtl::OUString& ouName,
const com::sun::star::uno::Sequence<
com::sun::star::xml::csax::XMLAttribute >& xAttrList,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const;
-
+
void XSecTester::sendAncestorEndElementEvent(
const rtl::OUString& ouName,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const;
-
- std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent(
+
+ std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent(
const std::vector< AncestorEvent* >::const_iterator& ii,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const;
-
+
public:
XSecTester(const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxMSF)
:mxMSF( rxMSF ){};
virtual ~XSecTester(){};
-
+
/* XSignatureCreationResultListener */
- virtual void SAL_CALL signatureCreated(
- sal_Int32 securityId,
+ virtual void SAL_CALL signatureCreated(
+ sal_Int32 securityId,
com::sun::star::xml::crypto::SecurityOperationStatus creationResult )
throw (com::sun::star::uno::RuntimeException);
/* XSignatureVerifyResultListener */
- virtual void SAL_CALL signatureVerified(
- sal_Int32 securityId,
+ virtual void SAL_CALL signatureVerified(
+ sal_Int32 securityId,
com::sun::star::xml::crypto::SecurityOperationStatus verifyResult )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XSAXEventKeeperStatusChangeListener */
virtual void SAL_CALL blockingStatusChanged( sal_Bool isBlocking )
throw (com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL collectionStatusChanged(
+ virtual void SAL_CALL collectionStatusChanged(
sal_Bool isInsideCollectedElement )
throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL bufferStatusChanged( sal_Bool isBufferEmpty )
throw (com::sun::star::uno::RuntimeException);
-
+
/* XXMLSecTester */
- virtual rtl::OUString SAL_CALL transfer_without_sec(
- const rtl::OUString& inputFileName,
+ virtual rtl::OUString SAL_CALL transfer_without_sec(
+ const rtl::OUString& inputFileName,
const rtl::OUString& outputFileName,
sal_Bool isBridgeInvolved)
throw (com::sun::star::uno::RuntimeException);
virtual rtl::OUString SAL_CALL export_xml(
- const rtl::OUString& inputFileName,
+ const rtl::OUString& inputFileName,
const rtl::OUString& outputFileName,
sal_Bool isJavaBased)
throw (com::sun::star::uno::RuntimeException);
virtual rtl::OUString SAL_CALL import_xml(
- const rtl::OUString& inputFileName,
+ const rtl::OUString& inputFileName,
const rtl::OUString& outputFileName,
sal_Bool isJavaBased)
throw (com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL setCryptoDir(
const rtl::OUString & javaDirName,
const rtl::OUString & cDirName)
@@ -439,7 +439,7 @@ public:
virtual void SAL_CALL ignorableWhitespace(const rtl::OUString&)
throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL startElement(
- const rtl::OUString&,
+ const rtl::OUString&,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >&)
throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL endElement(const rtl::OUString&)
@@ -450,23 +450,23 @@ public:
};
rtl::OUString XSecTester::parseFile(
- const rtl::OUString& ouInputFileName,
- const rtl::OUString& ouOutputFileName,
+ const rtl::OUString& ouInputFileName,
+ const rtl::OUString& ouOutputFileName,
bool bIsExporting,
bool bIsJavaBased)
{
rtl::OUString ouMessage;
-
+
cssu::Reference<cssi::XInputStream> xInputStream = OpenInputStream(ouInputFileName);
-
- if (xInputStream != NULL )
+
+ if (xInputStream != NULL )
{
/* initialization */
rtl::OUString SEInitializer_comp;
rtl::OUString XMLSignature_comp;
rtl::OUString tokenPath;
cssu::Reference < cssxc::XSEInitializer > xSEInitializer;
-
+
if (bIsJavaBased)
{
SEInitializer_comp = rtl::OUString::createFromAscii( SEINITIALIZER_JAVA_COMPONENT );
@@ -481,51 +481,51 @@ rtl::OUString XSecTester::parseFile(
m_ouXMLDocumentWrapperComponentName = rtl::OUString::createFromAscii( XMLDOCUMENT_C_COMPONENT );
tokenPath = m_ouCCryptokenDir;
}
-
+
xSEInitializer = cssu::Reference < cssxc::XSEInitializer > (
mxMSF->createInstance( SEInitializer_comp ),
- cssu::UNO_QUERY );
-
+ cssu::UNO_QUERY );
+
m_xXMLSignature = cssu::Reference<cssxc::XXMLSignature> (
mxMSF->createInstance( XMLSignature_comp ),
cssu::UNO_QUERY );
-
+
if ( xSEInitializer.is() && m_xXMLSignature.is())
{
/* create SAX Parser */
- const rtl::OUString sSaxParser (
+ const rtl::OUString sSaxParser (
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser") );
m_xSaxParser = cssu::Reference < cssxs::XParser > ( mxMSF->createInstance( sSaxParser ), cssu::UNO_QUERY );
-
+
/* create SAX Writer */
- const rtl::OUString sSaxWriter (
+ const rtl::OUString sSaxWriter (
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer") );
cssu::Reference < cssi::XActiveDataSource > xSaxWriter
( mxMSF->createInstance( sSaxWriter ), cssu::UNO_QUERY );
-
+
cssu::Reference< cssi::XOutputStream > xOutputStream = OpenOutputStream(ouOutputFileName);
xSaxWriter->setOutputStream( xOutputStream );
-
+
cssxs::InputSource aInput;
aInput.sSystemId = ouInputFileName;
aInput.aInputStream = xInputStream;
-
+
cssu::Reference < cssxs::XDocumentHandler > xSaxWriterHandler( xSaxWriter, cssu::UNO_QUERY);
-
- m_xXMLSecurityContext =
+
+ m_xXMLSecurityContext =
xSEInitializer->createSecurityContext(tokenPath);
-
+
m_bIsExporting = bIsExporting;
m_xExportHandler = xSaxWriterHandler;
m_xOutputHandler = xSaxWriterHandler;
-
+
m_xXMLDocumentWrapper = NULL;
m_xSAXEventKeeper = NULL;
m_bIsSAXEventKeeperOnTheSAXChain = false;
-
+
m_bIsBlocking = false;
m_bIsInsideCollectedElement = false;
-
+
OSL_ASSERT(m_vSignatureList.size() == 0);
OSL_ASSERT(m_vUnsolvedReferenceURIs.size() == 0);
OSL_ASSERT(m_vUnsolvedReferenceKeeperIds.size() == 0);
@@ -533,51 +533,51 @@ rtl::OUString XSecTester::parseFile(
OSL_ASSERT(m_stCurrentPath.empty());
OSL_ASSERT(m_stCurrentPathType.empty());
OSL_ASSERT(m_vAncestorEvents.empty());
-
+
changeOutput();
-
+
/* foundSecurityRelated(); */
-
+
/* Begin to parse */
TimeValue startTime, endTime;
osl_getSystemTime( &startTime );
-
+
xSaxWriterHandler->startDocument();
-
- if (m_bIsExporting)
+
+ if (m_bIsExporting)
{
m_xSaxParser->setDocumentHandler(this);
m_xSaxParser->parseStream(aInput);
}
- else
+ else
{
m_xSaxParser->setDocumentHandler(this);
m_xSaxParser->parseStream(aInput);
}
-
+
endMission();
xSaxWriterHandler->endDocument();
-
+
osl_getSystemTime( &endTime );
-
+
flushAncestorEvents( NULL );
-
+
// Bug in SAXWriter, done in endDocument()
// xOutputStream->closeOutput();
xInputStream->closeInput();
-
-
+
+
/*
* Free the security context
*/
xSEInitializer->freeSecurityContext(m_xXMLSecurityContext);
m_xXMLSecurityContext = NULL;
-
+
/* Calculate the time */
double diff = ((double)((endTime.Nanosec + endTime.Seconds*1000000000.0)
- - (startTime.Nanosec + startTime.Seconds*1000000000.0))) /
+ - (startTime.Nanosec + startTime.Seconds*1000000000.0))) /
((double)1000000000.0);
-
+
char buf[32];
sprintf(buf, "%.2f", diff);
ouMessage += rtl::OUString(RTL_ASCII_USTRINGPARAM(buf));
@@ -586,24 +586,24 @@ rtl::OUString XSecTester::parseFile(
{
ouMessage += rtl::OUString::createFromAscii( "N/A" );
}
-
+
}
else
{
ouMessage += rtl::OUString::createFromAscii( "-" );
}
-
+
return ouMessage;
}
/* XSignatureCreationResultListener */
void SAL_CALL XSecTester::signatureCreated(
- sal_Int32 securityId,
+ sal_Int32 securityId,
cssxc::SecurityOperationStatus creationResult )
throw (cssu::RuntimeException)
{
m_nTotalSignatureNumber++;
- if (creationResult == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
+ if (creationResult == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
{
m_nSuccessfulSignatureNumber++;
}
@@ -611,29 +611,29 @@ void SAL_CALL XSecTester::signatureCreated(
/* XSignatureVerifyResultListener */
void SAL_CALL XSecTester::signatureVerified(
- sal_Int32 securityId,
+ sal_Int32 securityId,
cssxc::SecurityOperationStatus verifyResult )
throw (cssu::RuntimeException)
{
m_nTotalSignatureNumber++;
- if (verifyResult == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
+ if (verifyResult == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
{
m_nSuccessfulSignatureNumber++;
}
}
-
+
/* XSAXEventKeeperStatusChangeListener */
void SAL_CALL XSecTester::blockingStatusChanged( sal_Bool isBlocking )
throw (cssu::RuntimeException)
{
this->m_bIsBlocking = isBlocking;
}
-
+
void SAL_CALL XSecTester::collectionStatusChanged( sal_Bool isInsideCollectedElement )
throw (cssu::RuntimeException)
{
this->m_bIsInsideCollectedElement = isInsideCollectedElement;
-
+
if ( !m_bIsInsideCollectedElement && !m_bIsBlocking)
{
m_bIsSAXEventKeeperOnTheSAXChain = false;
@@ -644,14 +644,14 @@ void SAL_CALL XSecTester::collectionStatusChanged( sal_Bool isInsideCollectedEle
}
changeOutput();
}
-
+
void SAL_CALL XSecTester::bufferStatusChanged( sal_Bool isBufferEmpty )
throw (cssu::RuntimeException)
{
if (isBufferEmpty)
{
m_xXMLDocumentWrapper = NULL;
-
+
m_xSAXEventKeeper = NULL;
m_bIsSAXEventKeeperOnTheSAXChain = false;
changeOutput();
@@ -663,12 +663,12 @@ rtl::OUString SAL_CALL XSecTester::export_xml( const rtl::OUString& inputFileNam
throw (cssu::RuntimeException)
{
rtl::OUString ouMessage;
-
+
m_nTotalSignatureNumber = 0;
m_nSuccessfulSignatureNumber = 0;
-
+
ouMessage += parseFile(inputFileName, outputFileName, sal_True, isJavaBased);
-
+
rtl::OUString ouRemark = rtl::OUString::valueOf(m_nSuccessfulSignatureNumber) +
rtl::OUString(RTL_ASCII_USTRINGPARAM( "/" ))
+ rtl::OUString::valueOf(m_nTotalSignatureNumber);
@@ -676,7 +676,7 @@ rtl::OUString SAL_CALL XSecTester::export_xml( const rtl::OUString& inputFileNam
return ouMessage;
}
-
+
rtl::OUString SAL_CALL XSecTester::import_xml( const rtl::OUString& inputFileName, const rtl::OUString& outputFileName, sal_Bool isJavaBased)
throw (cssu::RuntimeException)
{
@@ -695,31 +695,31 @@ rtl::OUString SAL_CALL XSecTester::import_xml( const rtl::OUString& inputFileNam
return ouMessage;
}
-rtl::OUString SAL_CALL XSecTester::transfer_without_sec(
- const rtl::OUString& inputFileName,
+rtl::OUString SAL_CALL XSecTester::transfer_without_sec(
+ const rtl::OUString& inputFileName,
const rtl::OUString& outputFileName,
sal_Bool isBridgeInvolved)
throw (cssu::RuntimeException)
{
rtl::OUString ouMessage;
-
+
cssu::Reference< cssi::XInputStream > xInputStream = OpenInputStream(inputFileName);
-
- if (xInputStream != NULL )
+
+ if (xInputStream != NULL )
{
/* create SAX Parser */
- const rtl::OUString sSaxParser (
+ const rtl::OUString sSaxParser (
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser") );
m_xSaxParser = cssu::Reference < cssxs::XParser > ( mxMSF->createInstance( sSaxParser ), cssu::UNO_QUERY );
/* create SAX Writer */
- const rtl::OUString sSaxWriter (
+ const rtl::OUString sSaxWriter (
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer") );
cssu::Reference < cssi::XActiveDataSource > xSaxWriter
( mxMSF->createInstance( sSaxWriter ), cssu::UNO_QUERY );
- cssu::Reference < cssxs::XDocumentHandler > xSaxWriterHandler(
+ cssu::Reference < cssxs::XDocumentHandler > xSaxWriterHandler(
xSaxWriter, cssu::UNO_QUERY);
-
+
if (!isBridgeInvolved)
{
/* connect the SAX Parser and the SAX Writer */
@@ -728,7 +728,7 @@ rtl::OUString SAL_CALL XSecTester::transfer_without_sec(
else
{
/* create Java Flat Filter */
- const rtl::OUString sJavaFlatFilter(
+ const rtl::OUString sJavaFlatFilter(
RTL_CONSTASCII_USTRINGPARAM( JAVAFLATFILTER_COMPONENT ) );
cssu::Reference < cssxs::XParser > xJavaFilterParser
( mxMSF->createInstance( sJavaFlatFilter ), cssu::UNO_QUERY );
@@ -742,7 +742,7 @@ rtl::OUString SAL_CALL XSecTester::transfer_without_sec(
xJavaFilterParser->setDocumentHandler( xSaxWriterHandler );
m_xSaxParser->setDocumentHandler ( xJavaFilterHandler );
}
-
+
/* set output stream */
cssu::Reference< cssi::XOutputStream > xOutputStream =
@@ -753,17 +753,17 @@ rtl::OUString SAL_CALL XSecTester::transfer_without_sec(
cssxs::InputSource aInput;
aInput.sSystemId = inputFileName;
aInput.aInputStream = xInputStream;
-
+
TimeValue startTime, endTime;
osl_getSystemTime( &startTime );
m_xSaxParser->parseStream ( aInput );
-
+
// xOutputStream->closeOutput();
xInputStream->closeInput();
-
+
osl_getSystemTime( &endTime );
-
+
double diff = ((double)((endTime.Nanosec + endTime.Seconds*1000000000.0)
- (startTime.Nanosec + startTime.Seconds*1000000000.0)))/((double)1000000000.0);
char buf[32];
@@ -782,7 +782,7 @@ void SAL_CALL XSecTester::setCryptoDir(const rtl::OUString & javaDirName, const
}
-cssu::Reference< cssu::XInterface > SAL_CALL XSecTester_createInstance(
+cssu::Reference< cssu::XInterface > SAL_CALL XSecTester_createInstance(
const cssu::Reference< cssl::XMultiServiceFactory > & rSMgr)
throw( cssu::Exception )
{
@@ -804,7 +804,7 @@ SecurityEntity::SecurityEntity(
{
m_nSecurityId = getNextSecurityId();
}
-
+
int SecurityEntity::getNextSecurityId() const
{
int nId = m_nNextSecurityId++;
@@ -836,16 +836,16 @@ int SecurityEntity::getSecurityId() const
bool SecurityEntity::setKey(const rtl::OUString& ouUri, bool bIsExporting)
{
bool rc = false;
-
+
if (m_ouKeyURI != rtl::OUString(RTL_ASCII_USTRINGPARAM("")) &&
m_ouKeyURI == ouUri)
{
int nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
bIsExporting ?
(cssxc::sax::ElementMarkPriority_BEFOREMODIFY):
- (cssxc::sax::ElementMarkPriority_AFTERMODIFY),
+ (cssxc::sax::ElementMarkPriority_AFTERMODIFY),
true);
-
+
setKeyId(nKeeperId);
m_xSAXEventKeeper->setSecurityId(nKeeperId, m_nSecurityId);
@@ -853,24 +853,24 @@ bool SecurityEntity::setKey(const rtl::OUString& ouUri, bool bIsExporting)
(m_xSAXEventKeeper, cssu::UNO_QUERY);
xReferenceResolvedBroadcaster->addReferenceResolvedListener(nKeeperId,
m_xReferenceListener);
-
+
rc = true;
}
-
+
return rc;
}
bool SecurityEntity::endMission()
{
- cssu::Reference<cssxc::sax::XMissionTaker> xMissionTaker
+ cssu::Reference<cssxc::sax::XMissionTaker> xMissionTaker
(m_xReferenceListener, cssu::UNO_QUERY);
-
+
return xMissionTaker->endMission();
}
SignatureEntity::SignatureEntity(
const cssu::Reference<cssxc::sax::XSecuritySAXEventKeeper>& xSAXEventKeeper,
- bool bIsExporting,
+ bool bIsExporting,
XSecTester* pListener,
const cssu::Reference<cssxc::XXMLSecurityContext>& xXMLSecurityContext,
const cssu::Reference<cssxc::XXMLSignature>& xXMLSignature,
@@ -880,9 +880,9 @@ SignatureEntity::SignatureEntity(
xXMLSignature,
rsMSF)
{
- if (bIsExporting)
+ if (bIsExporting)
{
- m_nSignatureElementCollectorId =
+ m_nSignatureElementCollectorId =
m_xSAXEventKeeper->addSecurityElementCollector(
cssxc::sax::ElementMarkPriority_AFTERMODIFY,
true);
@@ -894,59 +894,59 @@ SignatureEntity::SignatureEntity(
cssu::UNO_QUERY);
cssu::Reference<cssl::XInitialization> xInitialization(m_xReferenceListener, cssu::UNO_QUERY);
-
+
cssu::Sequence<cssu::Any> args(5);
char buf[16];
-
+
sprintf(buf, "%d", m_nSecurityId);
args[0] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf)));
args[1] = cssu::makeAny(m_xSAXEventKeeper);
-
+
sprintf(buf, "%d", m_nSignatureElementCollectorId);
args[2] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf)));
args[3] = cssu::makeAny(m_xXMLSecurityContext->getSecurityEnvironment());
args[4] = cssu::makeAny(m_xXMLSignature);
-
+
xInitialization->initialize(args);
-
+
int nBlockerId = m_xSAXEventKeeper->addBlocker();
m_xSAXEventKeeper->setSecurityId(nBlockerId, m_nSecurityId);
-
+
cssu::Reference<cssxc::sax::XBlockerMonitor> xBlockerMonitor(m_xReferenceListener, cssu::UNO_QUERY);
xBlockerMonitor->setBlockerId(nBlockerId);
-
+
cssu::Reference< cssxc::sax::XSignatureCreationResultBroadcaster > xSignatureCreationResultBroadcaster
(m_xReferenceListener, cssu::UNO_QUERY);
xSignatureCreationResultBroadcaster->addSignatureCreationResultListener(pListener);
}
- else
+ else
{
- m_nSignatureElementCollectorId =
+ m_nSignatureElementCollectorId =
m_xSAXEventKeeper->addSecurityElementCollector(
cssxc::sax::ElementMarkPriority_BEFOREMODIFY,
false);
-
+
m_xSAXEventKeeper->setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId);
m_xReferenceListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >(
mxMSF->createInstance( rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT )),
- cssu::UNO_QUERY);
-
+ cssu::UNO_QUERY);
+
cssu::Reference<cssl::XInitialization> xInitialization(m_xReferenceListener, cssu::UNO_QUERY);
-
+
cssu::Sequence<cssu::Any> args(5);
char buf[16];
-
+
sprintf(buf, "%d", m_nSecurityId);
args[0] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf)));
args[1] = cssu::makeAny(m_xSAXEventKeeper);
-
+
sprintf(buf, "%d", m_nSignatureElementCollectorId);
args[2] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf)));
args[3] = cssu::makeAny(m_xXMLSecurityContext);
args[4] = cssu::makeAny(m_xXMLSignature);
xInitialization->initialize(args);
-
+
cssu::Reference< cssxc::sax::XSignatureVerifyResultBroadcaster > xSignatureVerifyResultBroadcaster
(m_xReferenceListener, cssu::UNO_QUERY);
xSignatureVerifyResultBroadcaster->addSignatureVerifyResultListener(pListener);
@@ -962,56 +962,56 @@ void SignatureEntity::addReferenceURI(const rtl::OUString& ouUri)
{
m_vReferenceIds.push_back(ouUri);
}
-
+
void SignatureEntity::setReferenceNumber() const
{
cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
(m_xReferenceListener, cssu::UNO_QUERY);
xReferenceCollector->setReferenceCount(m_vReferenceIds.size());
}
-
+
bool SignatureEntity::hasReference(const rtl::OUString& ouUri) const
{
bool rc = false;
-
+
std::vector<const rtl::OUString>::const_iterator ii;
- for (ii = m_vReferenceIds.begin(); ii != m_vReferenceIds.end(); ++ii)
+ for (ii = m_vReferenceIds.begin(); ii != m_vReferenceIds.end(); ++ii)
{
- if (ouUri == *ii)
+ if (ouUri == *ii)
{
rc = true;
break;
}
}
-
+
return rc;
}
-
+
bool SignatureEntity::setReference(const rtl::OUString& ouUri, bool bIsExporting) const
{
bool rc = false;
-
- if (hasReference(ouUri))
+
+ if (hasReference(ouUri))
{
int nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
bIsExporting ?
(cssxc::sax::ElementMarkPriority_AFTERMODIFY):
(cssxc::sax::ElementMarkPriority_BEFOREMODIFY),
false);
-
+
m_xSAXEventKeeper->setSecurityId(nKeeperId, m_nSecurityId);
- cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster
+ cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster
(m_xSAXEventKeeper, cssu::UNO_QUERY);
xReferenceResolvedBroadcaster->addReferenceResolvedListener(nKeeperId, m_xReferenceListener);
-
+
cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
(m_xReferenceListener, cssu::UNO_QUERY);
xReferenceCollector->setReferenceId(nKeeperId);
-
+
rc = true;
}
-
+
return rc;
}
@@ -1049,45 +1049,45 @@ void SAL_CALL XSecTester::startElement(const rtl::OUString & name, const cssu::R
{
rtl::OUString ouIdAttr = xAttribs->getValueByName(
rtl::OUString(RTL_ASCII_USTRINGPARAM("id")));
-
- if (ouIdAttr == NULL)
+
+ if (ouIdAttr == NULL)
{
ouIdAttr = xAttribs->getValueByName(
rtl::OUString(RTL_ASCII_USTRINGPARAM("Id")));
}
-
+
bool bHasIdAttr = (ouIdAttr != NULL && ouIdAttr.getLength() > 0 );
bool needResend = false;
-
- if (bHasIdAttr || name.equalsAscii( SIGNATURE_STR ))
+
+ if (bHasIdAttr || name.equalsAscii( SIGNATURE_STR ))
{
- if (foundSecurityRelated() && ! m_bIsExporting)
+ if (foundSecurityRelated() && ! m_bIsExporting)
{
needResend = true;
}
}
-
+
if ( !m_bIsSAXEventKeeperOnTheSAXChain )
{
addStartAncestorEvent(name, xAttribs);
}
-
+
bool bSuppressingForwarding = checkSecurityElement(name, xAttribs);
-
+
checkReference(name, xAttribs, ouIdAttr);
-
- if (needResend)
+
+ if (needResend)
{
m_xSAXEventKeeper->setNextHandler(NULL);
-
- cssu::Reference<cssxs::XDocumentHandler> xSAXEventKeeperHandler
+
+ cssu::Reference<cssxs::XDocumentHandler> xSAXEventKeeperHandler
(m_xSAXEventKeeper, cssu::UNO_QUERY);
-
+
xSAXEventKeeperHandler->startElement(name, xAttribs);
m_xSAXEventKeeper->setNextHandler(this);
}
-
- if (!bSuppressingForwarding)
+
+ if (!bSuppressingForwarding)
{
m_xExportHandler->startElement(name, xAttribs);
}
@@ -1096,21 +1096,21 @@ void SAL_CALL XSecTester::startElement(const rtl::OUString & name, const cssu::R
void SAL_CALL XSecTester::endElement(const rtl::OUString& name)
throw (cssu::RuntimeException)
{
- if (!m_stCurrentPath.empty())
+ if (!m_stCurrentPath.empty())
{
void* pSignedInfo = m_stCurrentPath.top();
bool bIsStringType = m_stCurrentPathType.top();
-
+
m_stCurrentPath.pop();
m_stCurrentPathType.pop();
-
+
if (bIsStringType && !strcmp((const char *)pSignedInfo, SIGNEDINFO_STR))
{
- if (!m_stCurrentPath.empty())
+ if (!m_stCurrentPath.empty())
{
void* pSignature = m_stCurrentPath.top();
bIsStringType = m_stCurrentPathType.top();
-
+
if (!bIsStringType && pSignature != NULL)
{
((SignatureEntity *) pSignature)->setReferenceNumber();
@@ -1118,12 +1118,12 @@ void SAL_CALL XSecTester::endElement(const rtl::OUString& name)
}
}
}
-
+
if ( !m_bIsSAXEventKeeperOnTheSAXChain )
{
addEndAncestorEvent(name);
}
-
+
m_xExportHandler->endElement(name);
}
@@ -1134,39 +1134,39 @@ void SAL_CALL XSecTester::setDocumentLocator( const cssu::Reference<cssxs::XLoca
void XSecTester::changeOutput()
{
- if (m_bIsExporting)
+ if (m_bIsExporting)
{
- if (m_bIsSAXEventKeeperOnTheSAXChain)
+ if (m_bIsSAXEventKeeperOnTheSAXChain)
{
m_xExportHandler = cssu::Reference<cssxs::XDocumentHandler>
(m_xSAXEventKeeper, cssu::UNO_QUERY);
-
+
m_xSAXEventKeeper->setNextHandler(NULL);
-
+
flushAncestorEvents(m_xExportHandler);
m_xSAXEventKeeper->setNextHandler(m_xOutputHandler);
}
- else
+ else
{
m_xExportHandler = m_xOutputHandler;
}
}
- else
+ else
{
- if (m_bIsSAXEventKeeperOnTheSAXChain)
+ if (m_bIsSAXEventKeeperOnTheSAXChain)
{
cssu::Reference<cssxs::XDocumentHandler> xSAXEventKeeperHandler
(m_xSAXEventKeeper, cssu::UNO_QUERY);
-
+
m_xSAXEventKeeper->setNextHandler(NULL);
-
+
flushAncestorEvents(xSAXEventKeeperHandler);
m_xSaxParser->setDocumentHandler(xSAXEventKeeperHandler);
m_xSAXEventKeeper->setNextHandler(this);
}
- else
+ else
{
m_xSaxParser->setDocumentHandler(this);
}
@@ -1176,7 +1176,7 @@ void XSecTester::changeOutput()
bool XSecTester::foundSecurityRelated()
{
- if (m_xSAXEventKeeper == NULL)
+ if (m_xSAXEventKeeper == NULL)
{
m_bIsBlocking = false;
m_bIsInsideCollectedElement = false;
@@ -1194,19 +1194,19 @@ bool XSecTester::foundSecurityRelated()
cssu::Sequence <cssu::Any> arg(1);
arg[0] = cssu::makeAny(m_xXMLDocumentWrapper);
xInitialization->initialize(arg);
-
+
cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster>
- xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
+ xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
xSAXEventKeeperStatusChangeBroadcaster->addSAXEventKeeperStatusChangeListener(this);
}
-
+
bool rc = false;
-
- if (!m_bIsSAXEventKeeperOnTheSAXChain)
+
+ if (!m_bIsSAXEventKeeperOnTheSAXChain)
{
rc = true;
}
-
+
m_bIsSAXEventKeeperOnTheSAXChain=true;
changeOutput();
@@ -1222,15 +1222,15 @@ void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::
for (ii_referenceURIs = m_vUnsolvedReferenceURIs.begin(),
ii_referenceKeeperIds = m_vUnsolvedReferenceKeeperIds.begin(),
ii_referenceRefNums = m_vUnsolvedReferenceRefNums.begin();
- ii_referenceURIs != m_vUnsolvedReferenceURIs.end(); )
+ ii_referenceURIs != m_vUnsolvedReferenceURIs.end(); )
{
rtl::OUString ouReferenceUri = *ii_referenceURIs;
-
- if (ouReferenceUri == ouUri)
+
+ if (ouReferenceUri == ouUri)
{
int nKeeperId = *ii_referenceKeeperIds;
int nRefNum = *ii_referenceRefNums;
-
+
if ( bIsFindingKey )
{
int nClonedKeeperId = m_xSAXEventKeeper->cloneElementCollector(
@@ -1238,11 +1238,11 @@ void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::
m_bIsExporting?
(cssxc::sax::ElementMarkPriority_BEFOREMODIFY):
(cssxc::sax::ElementMarkPriority_AFTERMODIFY));
-
+
pSecurityEntity->setKeyId(nClonedKeeperId);
-
+
m_xSAXEventKeeper->setSecurityId(nClonedKeeperId, pSecurityEntity->getSecurityId());
-
+
cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster>
xReferenceResolvedBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY);
xReferenceResolvedBroadcaster->addReferenceResolvedListener(
@@ -1252,35 +1252,35 @@ void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::
else
{
int nClonedKeeperId = m_xSAXEventKeeper->cloneElementCollector(
- nKeeperId,
+ nKeeperId,
m_bIsExporting?
(cssxc::sax::ElementMarkPriority_AFTERMODIFY):
(cssxc::sax::ElementMarkPriority_BEFOREMODIFY));
-
+
m_xSAXEventKeeper->setSecurityId(nClonedKeeperId, pSecurityEntity->getSecurityId());
-
+
cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster>
- xReferenceResolvedBroadcaster
+ xReferenceResolvedBroadcaster
(m_xSAXEventKeeper, cssu::UNO_QUERY);
xReferenceResolvedBroadcaster->addReferenceResolvedListener(
nClonedKeeperId,
pSecurityEntity->getReferenceListener());
-
- cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
+
+ cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
(pSecurityEntity->getReferenceListener(), cssu::UNO_QUERY);
xReferenceCollector->setReferenceId(nClonedKeeperId);
}
nRefNum--;
- if (nRefNum == 0)
+ if (nRefNum == 0)
{
m_xSAXEventKeeper->removeElementCollector(nKeeperId);
-
+
ii_referenceURIs = m_vUnsolvedReferenceURIs.erase(ii_referenceURIs);
ii_referenceKeeperIds = m_vUnsolvedReferenceKeeperIds.erase(ii_referenceKeeperIds);
ii_referenceRefNums = m_vUnsolvedReferenceRefNums.erase(ii_referenceRefNums);
}
- else
+ else
{
(*ii_referenceRefNums) = nRefNum;
@@ -1288,13 +1288,13 @@ void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::
ii_referenceKeeperIds++;
ii_referenceRefNums++;
}
-
+
if (bIsFindingKey)
{
break;
}
}
- else
+ else
{
ii_referenceURIs++;
ii_referenceKeeperIds++;
@@ -1308,7 +1308,7 @@ bool XSecTester::checkSecurityElement(
const cssu::Reference<cssxs::XAttributeList>& xAttribs)
{
bool rc = false;
-
+
if (ouLocalName.equalsAscii(SIGNATURE_STR))
{
SignatureEntity* pSignatureEntity = new SignatureEntity(
@@ -1318,23 +1318,23 @@ bool XSecTester::checkSecurityElement(
m_xXMLSecurityContext,
m_xXMLSignature,
mxMSF);
-
+
m_vSignatureList.push_back(pSignatureEntity);
-
+
m_stCurrentPath.push(pSignatureEntity);
m_stCurrentPathType.push(false);
}
else if (ouLocalName.equalsAscii(REFERENCE_STR))
{
- if (!m_stCurrentPath.empty())
+ if (!m_stCurrentPath.empty())
{
void* pSignedInfo = m_stCurrentPath.top();
bool bIsStringType = m_stCurrentPathType.top();
-
+
m_stCurrentPath.pop();
m_stCurrentPathType.pop();
-
- if (bIsStringType && !m_stCurrentPath.empty())
+
+ if (bIsStringType && !m_stCurrentPath.empty())
{
void* pSignature = m_stCurrentPath.top();
bool bIsStringType2 = m_stCurrentPathType.top();
@@ -1343,13 +1343,13 @@ bool XSecTester::checkSecurityElement(
{
rtl::OUString ouUri = xAttribs->getValueByName
(rtl::OUString(RTL_ASCII_USTRINGPARAM( URI_ATTR_STR )));
-
+
if (ouUri.matchAsciiL("#", 1, 0))
{
rtl::OUString uri = ouUri.copy(1);
SignatureEntity* pSignatureEntity = (SignatureEntity *)pSignature;
-
- if (uri != NULL && uri.getLength()>0)
+
+ if (uri != NULL && uri.getLength()>0)
{
pSignatureEntity->addReferenceURI(uri);
findKeyOrReference(pSignatureEntity, uri, true);
@@ -1363,82 +1363,82 @@ bool XSecTester::checkSecurityElement(
m_stCurrentPath.push( (void *)REFERENCE_STR);
m_stCurrentPathType.push(true);
}
- else if(ouLocalName.equalsAscii(KEYVALUE_STR) ||
- ouLocalName.equalsAscii(KEYNAME_STR) ||
- ouLocalName.equalsAscii(X509DATA_STR) ||
- ouLocalName.equalsAscii(ENCRYPTEDKEY_STR))
+ else if(ouLocalName.equalsAscii(KEYVALUE_STR) ||
+ ouLocalName.equalsAscii(KEYNAME_STR) ||
+ ouLocalName.equalsAscii(X509DATA_STR) ||
+ ouLocalName.equalsAscii(ENCRYPTEDKEY_STR))
{
- if (!m_stCurrentPath.empty())
+ if (!m_stCurrentPath.empty())
{
void* pKeyInfo = m_stCurrentPath.top();
bool bIsStringType = m_stCurrentPathType.top();
-
+
m_stCurrentPath.pop();
m_stCurrentPathType.pop();
-
- if (bIsStringType && !m_stCurrentPath.empty())
+
+ if (bIsStringType && !m_stCurrentPath.empty())
{
bool bIsStringType2 = m_stCurrentPathType.top();
-
+
if (!bIsStringType2)
{
- SecurityEntity *pSecurityEntity =
+ SecurityEntity *pSecurityEntity =
(SecurityEntity *) (m_stCurrentPath.top());
pSecurityEntity->setKeyId(0);
}
}
-
+
m_stCurrentPath.push(pKeyInfo);
m_stCurrentPathType.push(bIsStringType);
}
-
+
m_stCurrentPath.push((void *)KEYVALUE_STR);
m_stCurrentPathType.push(true);
}
- else if(ouLocalName.equalsAscii(RETRIEVALMETHOD_STR))
+ else if(ouLocalName.equalsAscii(RETRIEVALMETHOD_STR))
{
- if (!m_stCurrentPath.empty())
+ if (!m_stCurrentPath.empty())
{
void* pKeyInfo = m_stCurrentPath.top();
bool bIsStringType = m_stCurrentPathType.top();
-
+
m_stCurrentPath.pop();
m_stCurrentPathType.pop();
-
- if (bIsStringType && !m_stCurrentPath.empty())
+
+ if (bIsStringType && !m_stCurrentPath.empty())
{
bool bIsStringType2 = m_stCurrentPathType.top();
-
+
if (!bIsStringType2)
{
- SecurityEntity *pSecurityEntity =
+ SecurityEntity *pSecurityEntity =
(SecurityEntity *) m_stCurrentPath.top();
rtl::OUString ouUri = xAttribs->getValueByName(
rtl::OUString(RTL_ASCII_USTRINGPARAM( URI_ATTR_STR )));
-
- if (!strcmp((const char *)pKeyInfo, KEYINFO_STR) &&
- ouUri != NULL && ouUri.getLength()>0)
+
+ if (!strcmp((const char *)pKeyInfo, KEYINFO_STR) &&
+ ouUri != NULL && ouUri.getLength()>0)
{
pSecurityEntity->setKeyURI(ouUri);
findKeyOrReference(pSecurityEntity, ouUri, true);
}
}
-
+
}
-
+
m_stCurrentPath.push(pKeyInfo);
m_stCurrentPathType.push(bIsStringType);
}
-
+
m_stCurrentPath.push((void *)RETRIEVALMETHOD_STR);
m_stCurrentPathType.push(true);
}
- else if(ouLocalName.equalsAscii(KEYINFO_STR))
+ else if(ouLocalName.equalsAscii(KEYINFO_STR))
{
m_stCurrentPath.push((void *)KEYINFO_STR);
m_stCurrentPathType.push(true);
}
- else if(ouLocalName.equalsAscii(SIGNEDINFO_STR))
+ else if(ouLocalName.equalsAscii(SIGNEDINFO_STR))
{
m_stCurrentPath.push((void *)SIGNEDINFO_STR);
m_stCurrentPathType.push(true);
@@ -1448,7 +1448,7 @@ bool XSecTester::checkSecurityElement(
m_stCurrentPath.push((void *)OTHER_ELEMENT_STR);
m_stCurrentPathType.push(true);
}
-
+
return rc;
}
@@ -1457,38 +1457,38 @@ void XSecTester::checkReference(
const cssu::Reference<cssxs::XAttributeList>& xAttribs,
const rtl::OUString& ouId)
{
- rtl::OUString refNumStr =
+ rtl::OUString refNumStr =
xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(REFNUM_ATTR_STR)));
-
- if (ouId != NULL && ouId.getLength()>0 )
+
+ if (ouId != NULL && ouId.getLength()>0 )
{
int nRefNum = 999;
- if (refNumStr != NULL && refNumStr.getLength()>0 )
+ if (refNumStr != NULL && refNumStr.getLength()>0 )
{
nRefNum = refNumStr.toInt32();
}
-
+
int nLength = m_vSignatureList.size();
- for (int i = 0; i<nLength; ++i)
+ for (int i = 0; i<nLength; ++i)
{
SignatureEntity* pSignatureEntity = m_vSignatureList.at(i);
-
- if (pSignatureEntity->setReference(ouId, m_bIsExporting))
+
+ if (pSignatureEntity->setReference(ouId, m_bIsExporting))
{
nRefNum--;
}
-
- if (pSignatureEntity->setKey(ouId, m_bIsExporting))
+
+ if (pSignatureEntity->setKey(ouId, m_bIsExporting))
{
nRefNum--;
}
}
-
- if (nRefNum>0)
+
+ if (nRefNum>0)
{
int nKeeperId;
-
- if (ouLocalName.equalsAscii(ENCRYPTEDKEY_STR))
+
+ if (ouLocalName.equalsAscii(ENCRYPTEDKEY_STR))
{
nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
m_bIsExporting ?
@@ -1496,7 +1496,7 @@ void XSecTester::checkReference(
(cssxc::sax::ElementMarkPriority_AFTERMODIFY),
true);
}
- else
+ else
{
nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
m_bIsExporting?
@@ -1504,7 +1504,7 @@ void XSecTester::checkReference(
(cssxc::sax::ElementMarkPriority_BEFOREMODIFY),
false);
}
-
+
m_vUnsolvedReferenceURIs.push_back(ouId);
m_vUnsolvedReferenceKeeperIds.push_back(nKeeperId);
m_vUnsolvedReferenceRefNums.push_back(nRefNum);
@@ -1516,7 +1516,7 @@ void XSecTester::endMission()
{
while (m_vSignatureList.size() > 0)
{
- if (m_vSignatureList.size()>0)
+ if (m_vSignatureList.size()>0)
{
SignatureEntity * pSignatureEntity = m_vSignatureList.at(0);
m_vSignatureList.erase(m_vSignatureList.begin());
@@ -1524,8 +1524,8 @@ void XSecTester::endMission()
delete pSignatureEntity;
}
}
-
- while (m_vUnsolvedReferenceURIs.size()>0)
+
+ while (m_vUnsolvedReferenceURIs.size()>0)
{
int nKeeperId = m_vUnsolvedReferenceKeeperIds.at(0);
m_xSAXEventKeeper->removeElementCollector(nKeeperId);
@@ -1541,31 +1541,31 @@ void XSecTester::addStartAncestorEvent(
{
sal_Int32 nLength = xAttribs->getLength();
AncestorEvent* ancestorEvent = new AncestorEvent( nLength );
-
+
ancestorEvent->bIsStartElement = true;
ancestorEvent->ouName = ouName;
-
- for (int i = 0; i<nLength; ++i)
+
+ for (int i = 0; i<nLength; ++i)
{
(ancestorEvent->aAttributeList[i]).sName = xAttribs->getNameByIndex((short)i);
(ancestorEvent->aAttributeList[i]).sValue =xAttribs->getValueByIndex((short)i);
}
-
+
m_vAncestorEvents.push_back(ancestorEvent);
}
void XSecTester::addEndAncestorEvent(const rtl::OUString& ouName)
{
AncestorEvent* ancestorEvent = new AncestorEvent(0);
-
+
ancestorEvent->bIsStartElement = false;
ancestorEvent->ouName = ouName;
-
+
m_vAncestorEvents.push_back(ancestorEvent);
}
void XSecTester::sendAncestorStartElementEvent(
- const rtl::OUString& ouName,
+ const rtl::OUString& ouName,
const cssu::Sequence< cssxcsax::XMLAttribute >& attrList,
const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler) const
{
@@ -1574,12 +1574,12 @@ void XSecTester::sendAncestorStartElementEvent(
= cssu::Reference< cssxs::XAttributeList > (pAttributeList);
sal_Int32 nLength = attrList.getLength();
-
- for (int i = 0; i<nLength; ++i)
+
+ for (int i = 0; i<nLength; ++i)
{
pAttributeList->AddAttribute( attrList[i].sName, attrList[i].sValue);
}
-
+
xDocumentHandler->startElement(ouName, xAttrList);
}
@@ -1590,12 +1590,12 @@ void XSecTester::sendAncestorEndElementEvent(
xDocumentHandler->endElement(ouName);
}
-std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent(
+std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent(
const std::vector< AncestorEvent* >::const_iterator& ii,
const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler) const
{
std::vector< AncestorEvent* >::const_iterator next = ii+1;
-
+
if (next == m_vAncestorEvents.end())
{
sendAncestorStartElementEvent(
@@ -1607,29 +1607,29 @@ std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElem
{
next = checkAncestorStartElementEvent(next, xDocumentHandler);
}
-
+
if (next != m_vAncestorEvents.end())
{
next++;
}
}
-
+
return next;
}
-
+
void XSecTester::flushAncestorEvents(
const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler)
{
std::vector< AncestorEvent* >::const_iterator ii;
-
+
if (xDocumentHandler != NULL)
{
ii = m_vAncestorEvents.begin();
-
+
while (ii != m_vAncestorEvents.end())
{
AncestorEvent* ancestorEvent = *ii;
-
+
if (ancestorEvent->bIsStartElement)
{
ii = checkAncestorStartElementEvent(ii, xDocumentHandler);
@@ -1641,11 +1641,11 @@ void XSecTester::flushAncestorEvents(
}
}
}
-
+
/* free the ancestor events list */
std::vector< AncestorEvent* >::iterator jj;
-
- while (m_vAncestorEvents.size()>0)
+
+ while (m_vAncestorEvents.size()>0)
{
jj = m_vAncestorEvents.begin();
delete *jj;
@@ -1676,8 +1676,8 @@ void outputHeader()
/*
* print the output on the screen as well as in the GNUPlot data file
*/
-void output(const rtl::OUString& ouInputFileName,
- const rtl::OUString& ouTime_C,
+void output(const rtl::OUString& ouInputFileName,
+ const rtl::OUString& ouTime_C,
const rtl::OUString& ouTime_Java,
const rtl::OUString& ouTime_NoSecurity,
const rtl::OUString& ouTime_JavaForwardOnly,
@@ -1696,16 +1696,16 @@ void output(const rtl::OUString& ouInputFileName,
fprintf(stderr, "%4s", bIsExporting?"E":"I");
fprintf(stderr, "%7dK", nSize/1024);
- fprintf(stderr, "%8s %3s",
+ fprintf(stderr, "%8s %3s",
rtl::OString(ouTime_C, ouTime_C.getLength(), RTL_TEXTENCODING_ASCII_US).getStr(),
rtl::OString(ouRemark_C, ouRemark_C.getLength(), RTL_TEXTENCODING_ASCII_US).getStr());
- fprintf(stderr, "%8s %3s",
+ fprintf(stderr, "%8s %3s",
rtl::OString(ouTime_Java, ouTime_Java.getLength(), RTL_TEXTENCODING_ASCII_US).getStr(),
rtl::OString(ouRemark_Java, ouRemark_Java.getLength(), RTL_TEXTENCODING_ASCII_US).getStr());
fprintf(stderr, "%12s", rtl::OString(ouTime_JavaForwardOnly, ouTime_JavaForwardOnly.getLength(), RTL_TEXTENCODING_ASCII_US).getStr());
fprintf(stderr, "%12s", rtl::OString(ouTime_NoSecurity, ouTime_NoSecurity.getLength(), RTL_TEXTENCODING_ASCII_US).getStr());
fprintf(stderr, "\n");
-
+
/* output the data as GNUPlot data file */
/*
char str[32];
@@ -1723,7 +1723,7 @@ void output(const rtl::OUString& ouInputFileName,
int main( int argc, char **argv )
{
- if (argc < 3)
+ if (argc < 3)
{
fprintf(stderr, "Usage: testtool <exportbatchfile> <importbatchfile> [<cppcryptotoken>] [<javacryptotoken>]\n");
exit (-1);
@@ -1738,15 +1738,15 @@ int main( int argc, char **argv )
if ( argc > 4 )
aJavaCryptoToken = rtl::OUString::createFromAscii(argv[4]);
- try
+ try
{
uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory();
XSecTester* pTester = new XSecTester( xMSF );
uno::Reference< xml::sax::XDocumentHandler > xKeepARef = pTester;
-
+
pTester->setCryptoDir( aJavaCryptoToken, aCPPCryptoToken );
-
+
rtl::OUString ouTime_C, ouTime_Java, ouTime_NoSecurity, ouTime_JavaForwardOnly;
rtl::OUString ouInputFileName;
rtl::OUString outputFileName1;
@@ -1761,17 +1761,17 @@ int main( int argc, char **argv )
const int MAX_LINE = 80;
char line[MAX_LINE + 1];
-
- while (batch_export.getline(line, MAX_LINE))
+
+ while (batch_export.getline(line, MAX_LINE))
{
ouInputFileName = rtl::OUString::createFromAscii(line);
int nPosition = ouInputFileName.lastIndexOf('.');
int nPosition1;
-
+
/*
* export the file with signautre/encryption (C++)
*/
- outputFileName1 = ouInputFileName.copy(0, nPosition) +
+ outputFileName1 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-ex.xml");
ouTime_C = pTester->export_xml(ouInputFileName, outputFileName1, sal_False);
nPosition1 = ouTime_C.lastIndexOf('\t');
@@ -1781,27 +1781,27 @@ int main( int argc, char **argv )
/*
* export the file with signautre/encryption (Java)
*/
- outputFileName1 = ouInputFileName.copy(0, nPosition) +
+ outputFileName1 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-ex2.xml");
ouTime_Java = pTester->export_xml(ouInputFileName, outputFileName1, sal_True);
nPosition1 = ouTime_Java.lastIndexOf('\t');
ouRemark_Java = ouTime_Java.copy(nPosition1 + 1);
ouTime_Java = ouTime_Java.copy(0, nPosition1);
-
+
/*
* export the file without signautre/encryption
*/
- outputFileName2 = ouInputFileName.copy(0, nPosition) +
+ outputFileName2 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-ex-no.xml");
ouTime_NoSecurity = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_False);
/*
* export the file with Java Flat Filter
*/
- outputFileName2 = ouInputFileName.copy(0, nPosition) +
+ outputFileName2 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-ex-jf.xml");
ouTime_JavaForwardOnly = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_True);
-
+
/*
* print output
*/
@@ -1812,16 +1812,16 @@ int main( int argc, char **argv )
batch_import.open(OUStringToOString( aImportBatchFile, RTL_TEXTENCODING_ASCII_US ).getStr());
- while (batch_import.getline(line, MAX_LINE))
+ while (batch_import.getline(line, MAX_LINE))
{
ouInputFileName = rtl::OUString::createFromAscii(line);
int nPosition = ouInputFileName.lastIndexOf('.');
int nPosition1;
-
+
/*
* import the file with signautre/encryption (C++)
*/
- outputFileName1 = ouInputFileName.copy(0, nPosition) +
+ outputFileName1 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-im.xml");
ouTime_C = pTester->import_xml(ouInputFileName, outputFileName1, sal_False);
nPosition1 = ouTime_C.lastIndexOf('\t');
@@ -1831,7 +1831,7 @@ int main( int argc, char **argv )
/*
* import the file with signautre/encryption (Java)
*/
- outputFileName1 = ouInputFileName.copy(0, nPosition) +
+ outputFileName1 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-im2.xml");
ouTime_Java = pTester->import_xml(ouInputFileName, outputFileName1, sal_True);
nPosition1 = ouTime_Java.lastIndexOf('\t');
@@ -1841,7 +1841,7 @@ int main( int argc, char **argv )
/*
* import the file without signautre/encryption
*/
- outputFileName2 = ouInputFileName.copy(0, nPosition) +
+ outputFileName2 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-im-no.xml");
ouTime_NoSecurity = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_False);
@@ -1849,10 +1849,10 @@ int main( int argc, char **argv )
* import the file without signautre/encryption
*/
- outputFileName2 = ouInputFileName.copy(0, nPosition) +
+ outputFileName2 = ouInputFileName.copy(0, nPosition) +
rtl::OUString::createFromAscii("-im-jf.xml");
ouTime_JavaForwardOnly = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_True);
-
+
/*
* print output
*/
@@ -1863,9 +1863,9 @@ int main( int argc, char **argv )
fprintf(stderr, "\n");
}
- catch( cssu::Exception& e )
+ catch( cssu::Exception& e )
{
- fprintf( stderr , "\nEXCEPTION! Error Message: %s\n" ,
+ fprintf( stderr , "\nEXCEPTION! Error Message: %s\n" ,
rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
}
diff --git a/xmlsecurity/tools/demo/signdemo.cxx b/xmlsecurity/tools/demo/signdemo.cxx
index a3c59345cfba..723a8df0bfe1 100644
--- a/xmlsecurity/tools/demo/signdemo.cxx
+++ b/xmlsecurity/tools/demo/signdemo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -44,7 +44,7 @@ using namespace ::com::sun::star;
int SAL_CALL main( int argc, char **argv )
{
- if( argc < 4 )
+ if( argc < 4 )
{
fprintf( stderr, "Usage: %s <signature file> <xml stream file> <binary stream file> [<cryptoken>]\n" , argv[0] ) ;
return -1 ;
@@ -56,14 +56,14 @@ int SAL_CALL main( int argc, char **argv )
rtl::OUString aCryptoToken;
if ( argc >= 5 )
aCryptoToken = rtl::OUString::createFromAscii(argv[4]);
-
+
uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory();
-
+
/*
* creates a signature helper
*/
XMLSignatureHelper aSignatureHelper( xMSF );
-
+
/*
* creates a security context.
*/
@@ -73,30 +73,30 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stderr, "Error initializing security context!\n" );
return -1;
}
-
+
aSignatureHelper.StartMission();
-
+
/*
* select a private key certificate
*/
sal_Int32 i;
sal_Int32 nEnvCount = aSignatureHelper.GetSecurityEnvironmentNumber();
- if( nEnvCount == 0 )
+ if( nEnvCount == 0 )
{
fprintf( stdout, "\nNo SecurityEnvironment found!\n" ) ;
return -1;
}
-
+
uno::Sequence< uno::Reference< xml::crypto::XSecurityEnvironment > > xSecurityEnvironments(nEnvCount) ;
for( i=0; i < nEnvCount; i++ )
xSecurityEnvironments[i] = aSignatureHelper.GetSecurityEnvironmentByIndex(i);
fprintf( stdout, "\nSelect a SecurityEnvironment:\n" ) ;
- for( i = 0; i < nEnvCount; i ++ )
+ for( i = 0; i < nEnvCount; i ++ )
fprintf( stdout, "\n[%d] %s", i+1, rtl::OUStringToOString( xSecurityEnvironments[i]->getSecurityEnvironmentInformation() ,RTL_TEXTENCODING_ASCII_US ).getStr());
sal_Int32 nEnvIndex = QuerySelectNumber( 1, nEnvCount ) -1;
-
+
uno::Reference< ::com::sun::star::security::XCertificate > xPersonalCert = getCertificateFromEnvironment(xSecurityEnvironments[nEnvIndex], true);
if ( !xPersonalCert.is() )
@@ -109,7 +109,7 @@ int SAL_CALL main( int argc, char **argv )
* creates a new signature id
*/
sal_Int32 nSecurityId = aSignatureHelper.GetNewSecurityId();
-
+
/*
* configures the X509 certificate
*/
@@ -123,23 +123,23 @@ int SAL_CALL main( int argc, char **argv )
* configures date/time
*/
aSignatureHelper.SetDateTime( nSecurityId, Date(), Time());
-
+
/*
* signs the xml stream
*/
aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False );
-
+
/*
* signs the binary stream
*/
aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True );
-
+
/*
* creates signature
*/
uno::Reference< io::XOutputStream > xOutputStream = OpenOutputStream( aSIGFileName );
bool bDone = aSignatureHelper.CreateAndWriteSignature( xOutputStream );
-
+
if ( !bDone )
{
fprintf( stderr, "\nSTATUS: Error creating Signature!\n" );
diff --git a/xmlsecurity/tools/demo/util.cxx b/xmlsecurity/tools/demo/util.cxx
index b81724f15c4e..f495db978512 100644
--- a/xmlsecurity/tools/demo/util.cxx
+++ b/xmlsecurity/tools/demo/util.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,13 +50,13 @@ cssu::Reference< cssl::XMultiServiceFactory > CreateDemoServiceFactory()
{
cssu::Reference< cssl::XMultiServiceFactory > xMSF;
- try
+ try
{
cssu::Reference< cssl::XMultiComponentFactory > xLocalServiceManager = NULL ;
cssu::Reference< cssu::XComponentContext > xLocalComponentContext = NULL ;
- cssu::Reference< ::com::sun::star::registry::XSimpleRegistry > xSimpleRegistry
- = ::cppu::createSimpleRegistry();
+ cssu::Reference< ::com::sun::star::registry::XSimpleRegistry > xSimpleRegistry
+ = ::cppu::createSimpleRegistry();
OSL_ENSURE( xSimpleRegistry.is(),
"serviceManager - "
"Cannot create simple registry" ) ;
@@ -77,7 +77,7 @@ cssu::Reference< cssl::XMultiServiceFactory > CreateDemoServiceFactory()
"Cannot create intial service manager" ) ;
xMSF = cssu::Reference< cssl::XMultiServiceFactory >(xLocalServiceManager, cssu::UNO_QUERY) ;
-
+
::comphelper::setProcessServiceFactory( xMSF );
}
catch( cssu::Exception& e )
diff --git a/xmlsecurity/tools/demo/util.hxx b/xmlsecurity/tools/demo/util.hxx
index 080f62458fc5..48916a11275a 100644
--- a/xmlsecurity/tools/demo/util.hxx
+++ b/xmlsecurity/tools/demo/util.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,6 +48,6 @@ long QueryVerifySignature();
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > OpenOutputStream( const ::rtl::OUString& rStreamName );
::rtl::OUString getSignatureInformations( const SignatureInformations& SignatureInformations, ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment );
-::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > getCertificateFromEnvironment( ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment, BOOL nType);
+::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > getCertificateFromEnvironment( ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment, BOOL nType);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/tools/demo/util2.cxx b/xmlsecurity/tools/demo/util2.cxx
index d40506bc498e..b5a44ce67e51 100644
--- a/xmlsecurity/tools/demo/util2.cxx
+++ b/xmlsecurity/tools/demo/util2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,7 +30,7 @@
#include "precompiled_xmlsecurity.hxx"
#include <rtl/locale.h>
-#include <osl/nlsupport.h>
+#include <osl/nlsupport.h>
#include <osl/process.h>
#include <util.hxx>
@@ -100,20 +100,20 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
{
int length = data.getLength();
::rtl::OUString result;
-
+
char number[4];
for (int j=0; j<length; j++)
{
sprintf(number, "%02X ", (unsigned char)data[j]);
result += rtl::OUString::createFromAscii( number );
}
-
+
return result;
}
-::rtl::OUString getSignatureInformation(
- const SignatureInformation& infor,
+::rtl::OUString getSignatureInformation(
+ const SignatureInformation& infor,
cssu::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& xSecurityEnvironment )
{
char* status[50] = {
@@ -167,9 +167,9 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
"DSIG_NO_REFERENCES",
"DSIG_INVALID_REFERENCE",
"ASSERTION"};
-
+
rtl::OUString result;
-
+
result += rtl::OUString::createFromAscii( "Security Id : " )
+rtl::OUString::valueOf(infor.nSecurityId)
+rtl::OUString::createFromAscii( "\n" );
@@ -178,11 +178,11 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
+rtl::OUString::createFromAscii( "] " )
+rtl::OUString::createFromAscii(status[infor.nStatus])
+rtl::OUString::createFromAscii( "\n" );
-
+
const SignatureReferenceInformations& rInfors = infor.vSignatureReferenceInfors;
int i;
int size = rInfors.size();
-
+
result += rtl::OUString::createFromAscii( "--References :\n" );
for (i=0; i<size; i++)
{
@@ -207,7 +207,7 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
result += infor.ouX509SerialNumber;
result += rtl::OUString::createFromAscii( "\n" );
}
-
+
if (infor.ouX509Certificate.getLength()>0)
{
result += rtl::OUString::createFromAscii( "--X509Certificate :\n" );
@@ -223,7 +223,7 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
}
result += rtl::OUString::createFromAscii( "--Date :\n" );
-
+
::rtl::OUStringBuffer buffer;
convertDateTime( buffer, infor.stDateTime );
result += buffer.makeStringAndClear();
@@ -234,7 +234,7 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
result += rtl::OUString::createFromAscii( "--Certificate Path :\n" );
cssu::Reference< ::com::sun::star::security::XCertificate > xCert = xSecurityEnvironment->getCertificate( infor.ouX509IssuerName, numericStringToBigInteger(infor.ouX509SerialNumber) );
cssu::Sequence < cssu::Reference< ::com::sun::star::security::XCertificate > > xCertPath;
- if(! xCert.is() )
+ if(! xCert.is() )
{
fprintf(stdout , " xCert is NULL , so can not buildCertificatePath\n");
return result ;
@@ -243,8 +243,8 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
{
xCertPath = xSecurityEnvironment->buildCertificatePath( xCert ) ;
}
-
- for( int i = 0; i < xCertPath.getLength(); i++ )
+
+ for( int i = 0; i < xCertPath.getLength(); i++ )
{
result += xCertPath[i]->getSubjectName();
result += rtl::OUString::createFromAscii( "\n Subject public key algorithm : " );
@@ -266,10 +266,10 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
result += rtl::OUString::createFromAscii( "\n <<\n" );
}
-
+
result += rtl::OUString::createFromAscii( "\n Key Usage : " );
sal_Int32 usage = xCert->getCertificateUsage();
-
+
if (usage & ::com::sun::star::security::KeyUsage::DIGITAL_SIGNATURE)
{
result += rtl::OUString::createFromAscii( "DIGITAL_SIGNATURE " );
@@ -279,27 +279,27 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
{
result += rtl::OUString::createFromAscii( "NON_REPUDIATION " );
}
-
+
if (usage & ::com::sun::star::security::KeyUsage::KEY_ENCIPHERMENT)
{
result += rtl::OUString::createFromAscii( "KEY_ENCIPHERMENT " );
}
-
+
if (usage & ::com::sun::star::security::KeyUsage::DATA_ENCIPHERMENT)
{
result += rtl::OUString::createFromAscii( "DATA_ENCIPHERMENT " );
}
-
+
if (usage & ::com::sun::star::security::KeyUsage::KEY_AGREEMENT)
{
result += rtl::OUString::createFromAscii( "KEY_AGREEMENT " );
}
-
+
if (usage & ::com::sun::star::security::KeyUsage::KEY_CERT_SIGN)
{
result += rtl::OUString::createFromAscii( "KEY_CERT_SIGN " );
}
-
+
if (usage & ::com::sun::star::security::KeyUsage::CRL_SIGN)
{
result += rtl::OUString::createFromAscii( "CRL_SIGN " );
@@ -307,32 +307,32 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
result += rtl::OUString::createFromAscii( "\n" );
}
-
+
result += rtl::OUString::createFromAscii( "\n" );
return result;
}
-::rtl::OUString getSignatureInformations(
+::rtl::OUString getSignatureInformations(
const SignatureInformations& SignatureInformations,
- cssu::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment )
+ cssu::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment )
{
rtl::OUString result;
int i;
int size = SignatureInformations.size();
-
+
for (i=0; i<size; i++)
{
const SignatureInformation& infor = SignatureInformations[i];
result += getSignatureInformation( infor, xSecurityEnvironment );
}
-
+
result += rtl::OUString::createFromAscii( "\n" );
-
+
return result;
}
-::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >
- getCertificateFromEnvironment( ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment , BOOL nType)
+::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >
+ getCertificateFromEnvironment( ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment , BOOL nType)
{
cssu::Sequence< cssu::Reference< ::com::sun::star::security::XCertificate > > xPersonalCerts ;
int length = 0;
@@ -347,18 +347,18 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
if( nType != FALSE )
xPersonalCerts = xSecurityEnvironment->getPersonalCertificates() ;
- else
+ else
return NULL; // not support then;
length = xPersonalCerts.getLength();
- if(length == 0)
+ if(length == 0)
{
fprintf( stdout, "\nNo certificate found!\n" ) ;
return NULL;
}
fprintf( stdout, "\nSelect a certificate:\n" ) ;
- for( i = 0; i < length; i ++ )
+ for( i = 0; i < length; i ++ )
{
rtl::OUString xxxIssuer;
rtl::OUString xxxSubject;
@@ -376,7 +376,7 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer,
yyySubject.getStr(),
yyyIssuer.getStr());
}
-
+
int sel = QuerySelectNumber( 1, length ) -1;
return xPersonalCerts[sel] ;
}
@@ -394,13 +394,13 @@ void QueryPrintSignatureDetails( const SignatureInformations& SignatureInformati
sal_uInt16 encoding = osl_getTextEncodingFromLocale( pLocale ) ;
fprintf( stdout, "------------- Signature details START -------------\n" );
- fprintf( stdout, "%s",
+ fprintf( stdout, "%s",
rtl::OUStringToOString(
getSignatureInformations( SignatureInformations, rSecEnv),
encoding).getStr());
fprintf( stdout, "------------- Signature details END -------------\n" );
- }
+ }
}
int QuerySelectNumber( int nMin, int nMax )
diff --git a/xmlsecurity/tools/demo/verifydemo.cxx b/xmlsecurity/tools/demo/verifydemo.cxx
index d96d539cee10..f4af57ab70aa 100644
--- a/xmlsecurity/tools/demo/verifydemo.cxx
+++ b/xmlsecurity/tools/demo/verifydemo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -45,7 +45,7 @@ long startVerifyHandler( void *, void * )
int SAL_CALL main( int argc, char **argv )
{
- if( argc < 2 )
+ if( argc < 2 )
{
fprintf( stderr, "Usage: %s <signature file> [<cryptoken>]\n" , argv[0] ) ;
return -1 ;
@@ -58,7 +58,7 @@ int SAL_CALL main( int argc, char **argv )
uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory();
-
+
/*
* creates a signature helper
*/
@@ -86,12 +86,12 @@ int SAL_CALL main( int argc, char **argv )
*/
uno::Reference< io::XInputStream > xInputStream = OpenInputStream( aSIGFileName );
bool bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream );
-
+
/*
* closes the signature stream
*/
xInputStream->closeInput();
-
+
if ( !bDone )
{
fprintf( stderr, "\nSTATUS: Error verifying Signature!\n" );
diff --git a/xmlsecurity/tools/examples/enc-1.xml b/xmlsecurity/tools/examples/enc-1.xml
index bfd2f11195e8..8d6551421d33 100644
--- a/xmlsecurity/tools/examples/enc-1.xml
+++ b/xmlsecurity/tools/examples/enc-1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<!--
-XML Security Library example: Simple encryption template file for encrypt1 example.
+<!--
+XML Security Library example: Simple encryption template file for encrypt1 example.
-->
<Envelope xmlns="urn:envelope">
The encrypted data is <Data>Hello, World!</Data>
@@ -16,12 +16,12 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
<X509SerialNumber>123450001</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
</EncryptedKey>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue></CipherValue>
</CipherData>
diff --git a/xmlsecurity/tools/examples/enc-2.xml b/xmlsecurity/tools/examples/enc-2.xml
index 98fc553c0c08..e56d2300ab51 100644
--- a/xmlsecurity/tools/examples/enc-2.xml
+++ b/xmlsecurity/tools/examples/enc-2.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<!--
-XML Security Library example: Simple encryption template file for encrypt1 example.
+<!--
+XML Security Library example: Simple encryption template file for encrypt1 example.
-->
<Envelope xmlns="urn:envelope">
The encrypted data is <Data>Hello, World!</Data>
@@ -16,12 +16,12 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
<X509SerialNumber>123450001</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
</EncryptedKey>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
@@ -40,19 +40,19 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
<X509SerialNumber>123450001</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
</EncryptedKey>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue></CipherValue>
</CipherData>
</EncryptedData>
<Data>
This is an embeded encryption!
- </Data>
- </Data>
+ </Data>
+ </Data>
</Envelope>
diff --git a/xmlsecurity/tools/examples/s-in-e-1.xml b/xmlsecurity/tools/examples/s-in-e-1.xml
index d4c0c0eba80c..c08839a1b717 100644
--- a/xmlsecurity/tools/examples/s-in-e-1.xml
+++ b/xmlsecurity/tools/examples/s-in-e-1.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<!--
-XML Security Library example: Simple encryption template file for encrypt1 example.
+<!--
+XML Security Library example: Simple encryption template file for encrypt1 example.
-->
<Envelope xmlns="urn:envelope">
a signature in an encryption.
@@ -16,12 +16,12 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
<X509SerialNumber>123450001</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
</EncryptedKey>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
@@ -48,6 +48,6 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
</KeyInfo>
</Signature>
<Data id="target" refNum="1">Signed Data</Data>
- </Data>
+ </Data>
</Envelope>
diff --git a/xmlsecurity/tools/examples/s-in-e-2.xml b/xmlsecurity/tools/examples/s-in-e-2.xml
index fd3ba0cb5f9c..29e3e45df754 100644
--- a/xmlsecurity/tools/examples/s-in-e-2.xml
+++ b/xmlsecurity/tools/examples/s-in-e-2.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<!--
-XML Security Library example: Simple encryption template file for encrypt1 example.
+<!--
+XML Security Library example: Simple encryption template file for encrypt1 example.
-->
<Envelope xmlns="urn:envelope">
a signature in an encryption.
@@ -16,12 +16,12 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
<X509SerialNumber>123450001</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
</EncryptedKey>
- </KeyInfo>
+ </KeyInfo>
<CipherData>
<CipherValue/>
</CipherData>
@@ -47,7 +47,7 @@ XML Security Library example: Simple encryption template file for encrypt1 examp
</X509Data>
</KeyInfo>
</Signature>
- </Data>
+ </Data>
<SignData id="target" refNum="1">Signed Data</SignData>
</Envelope>
diff --git a/xmlsecurity/tools/standalone/csfit/certmngr.cxx b/xmlsecurity/tools/standalone/csfit/certmngr.cxx
index 5c6d78c89d9a..b5763e6079e1 100644
--- a/xmlsecurity/tools/standalone/csfit/certmngr.cxx
+++ b/xmlsecurity/tools/standalone/csfit/certmngr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -71,8 +71,8 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- CERTCertDBHandle* certHandle ;
- PK11SlotInfo* slot ;
+ CERTCertDBHandle* certHandle ;
+ PK11SlotInfo* slot ;
if( argc != 3 ) {
fprintf( stderr, "Usage: %s < CertDir > <rdb file>\n\n" , argv[0] ) ;
@@ -148,7 +148,7 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stdout, "\tCertificate Serial Number[%s]\n", OUStringToOString( bigIntegerToNumericString( xPersonalCerts[i]->getSerialNumber() ), RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
fprintf( stdout, "\tCertificate Subject[%s]\n", OUStringToOString( xPersonalCerts[i]->getSubjectName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
- //build the certificate path
+ //build the certificate path
xCertPath = pSecEnv->buildCertificatePath( xPersonalCerts[i] ) ;
//Print the certificate path.
fprintf( stdout, "\tCertificate Path\n" ) ;
diff --git a/xmlsecurity/tools/standalone/csfit/decrypter.cxx b/xmlsecurity/tools/standalone/csfit/decrypter.cxx
index b1177efe58d1..b196e2625ca0 100644
--- a/xmlsecurity/tools/standalone/csfit/decrypter.cxx
+++ b/xmlsecurity/tools/standalone/csfit/decrypter.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,7 +38,7 @@
#include "libxslt/xslt.h"
#endif
-
+
#include "securityenvironment_nssimpl.hxx"
#include "xmlelementwrapper_xmlsecimpl.hxx"
@@ -82,12 +82,12 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- CERTCertDBHandle* certHandle = NULL ;
- PK11SlotInfo* slot = NULL ;
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- FILE* dstFile = NULL ;
+ CERTCertDBHandle* certHandle = NULL ;
+ PK11SlotInfo* slot = NULL ;
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ FILE* dstFile = NULL ;
if( argc != 5 ) {
@@ -102,7 +102,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
@@ -264,7 +264,7 @@ done:
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/csfit/encrypter.cxx b/xmlsecurity/tools/standalone/csfit/encrypter.cxx
index ce6e4c15ccdf..34e2dafa0d09 100644
--- a/xmlsecurity/tools/standalone/csfit/encrypter.cxx
+++ b/xmlsecurity/tools/standalone/csfit/encrypter.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -79,13 +79,13 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- CERTCertDBHandle* certHandle ;
- PK11SlotInfo* slot = NULL ;
- PK11SymKey* symKey = NULL ;
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- FILE* dstFile = NULL ;
+ CERTCertDBHandle* certHandle ;
+ PK11SlotInfo* slot = NULL ;
+ PK11SymKey* symKey = NULL ;
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ FILE* dstFile = NULL ;
if( argc != 7 ) {
fprintf( stderr, "Usage: %s < CertDir > <file_url of template> <file_url of result> <target element name> <target element namespace> <rdb file>\n\n" , argv[0] ) ;
@@ -99,7 +99,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
//Initialize NSPR and NSS
@@ -301,7 +301,7 @@ done:
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/csfit/helper.cxx b/xmlsecurity/tools/standalone/csfit/helper.cxx
index fb2b6b0933c5..62f44cf9dff1 100644
--- a/xmlsecurity/tools/standalone/csfit/helper.cxx
+++ b/xmlsecurity/tools/standalone/csfit/helper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,7 +48,7 @@ Reference< XInputStream > createStreamFromFile( const OUString sFile )
if( pcFile != NULL ) {
FILE *f = fopen( pcFile , "rb" );
Reference< XInputStream > r;
-
+
if( f ) {
fseek( f , 0 , SEEK_END );
int nLength = ftell( f );
@@ -58,7 +58,7 @@ Reference< XInputStream > createStreamFromFile( const OUString sFile )
fread( seqIn.getArray() , nLength , 1 , f );
r = Reference< XInputStream > ( new OInputStream( seqIn ) );
- fclose( f );
+ fclose( f );
}
return r;
} else {
@@ -103,7 +103,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext
"No rdb URI specified" ) ;
if( sUnoUrl.equalsAscii( "local" ) ) {
- Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry();
+ Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry();
OSL_ENSURE( xSimpleRegistry.is() ,
"serviceManager - "
"Cannot create simple registry" ) ;
diff --git a/xmlsecurity/tools/standalone/csfit/helper.hxx b/xmlsecurity/tools/standalone/csfit/helper.hxx
index 108ebf73358a..79e8b48f895f 100644
--- a/xmlsecurity/tools/standalone/csfit/helper.hxx
+++ b/xmlsecurity/tools/standalone/csfit/helper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -88,7 +88,7 @@ class OInputStream : public WeakImplHelper1 < XInputStream >
{
public:
OInputStream( const Sequence< sal_Int8 >&seq ) : m_seq( seq ), nPos( 0 ) {}
-
+
virtual sal_Int32 SAL_CALL readBytes(
Sequence< sal_Int8 >& aData ,
sal_Int32 nBytesToRead
@@ -199,7 +199,7 @@ class OUriBinding : public WeakImplHelper1 < ::com::sun::star::xml::crypto::XUri
virtual void SAL_CALL setUriBinding(
const ::rtl::OUString& aUri ,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aInputStream
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aInputStream
) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) {
m_vUris.push_back( aUri ) ;
m_vStreams.push_back( aInputStream ) ;
@@ -215,7 +215,7 @@ class OUriBinding : public WeakImplHelper1 < ::com::sun::star::xml::crypto::XUri
break;
}
}
-
+
return xInputStream;
}
diff --git a/xmlsecurity/tools/standalone/csfit/signer.cxx b/xmlsecurity/tools/standalone/csfit/signer.cxx
index 40e6a64a2b78..4e3a2cf37991 100644
--- a/xmlsecurity/tools/standalone/csfit/signer.cxx
+++ b/xmlsecurity/tools/standalone/csfit/signer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -77,18 +77,18 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- CERTCertDBHandle* certHandle ;
- PK11SlotInfo* slot ;
- xmlDocPtr doc ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- xmlAttrPtr idAttr ;
- xmlChar* idValue ;
- xmlAttrPtr uriAttr ;
- xmlChar* uriValue ;
- OUString* uri ;
- Reference< XUriBinding > xUriBinding ;
- FILE* dstFile ;
+ CERTCertDBHandle* certHandle ;
+ PK11SlotInfo* slot ;
+ xmlDocPtr doc ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ xmlAttrPtr idAttr ;
+ xmlChar* idValue ;
+ xmlAttrPtr uriAttr ;
+ xmlChar* uriValue ;
+ OUString* uri ;
+ Reference< XUriBinding > xUriBinding ;
+ FILE* dstFile ;
if( argc != 5 ) {
fprintf( stderr, "Usage: %s < CertDir > <file_url of template> <file_url of result> <rdb file>\n\n" , argv[0] ) ;
@@ -109,7 +109,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
@@ -202,7 +202,7 @@ int SAL_CALL main( int argc, char **argv )
if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) {
fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ;
- // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
+ // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ;
}
@@ -360,7 +360,7 @@ done:
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/csfit/verifier.cxx b/xmlsecurity/tools/standalone/csfit/verifier.cxx
index a109b63931fe..ca97fcdca9cf 100644
--- a/xmlsecurity/tools/standalone/csfit/verifier.cxx
+++ b/xmlsecurity/tools/standalone/csfit/verifier.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -80,17 +80,17 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- CERTCertDBHandle* certHandle = NULL ;
- PK11SlotInfo* slot = NULL ;
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- xmlAttrPtr idAttr ;
- xmlChar* idValue ;
- xmlAttrPtr uriAttr ;
- xmlChar* uriValue ;
- OUString* uri = NULL ;
- Reference< XUriBinding > xUriBinding ;
+ CERTCertDBHandle* certHandle = NULL ;
+ PK11SlotInfo* slot = NULL ;
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ xmlAttrPtr idAttr ;
+ xmlChar* idValue ;
+ xmlAttrPtr uriAttr ;
+ xmlChar* uriValue ;
+ OUString* uri = NULL ;
+ Reference< XUriBinding > xUriBinding ;
if( argc != 4 ) {
fprintf( stderr, "Usage: %s < CertDir > <file_url> <rdb file>\n" , argv[0] ) ;
@@ -104,7 +104,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
@@ -138,7 +138,7 @@ int SAL_CALL main( int argc, char **argv )
if( tarNode == NULL ) {
tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", NULL ) ;
}
-
+
//Find the "id" attrbute in the element
if( tarNode != NULL ) {
if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"id" ) ) != NULL ) {
@@ -149,7 +149,7 @@ int SAL_CALL main( int argc, char **argv )
idAttr = NULL ;
}
}
-
+
//Add ID to DOM
if( idAttr != NULL ) {
idValue = xmlNodeListGetString( tarNode->doc, idAttr->children, 1 ) ;
@@ -157,7 +157,7 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stderr , "### the ID value is NULL!\n" ) ;
goto done ;
}
-
+
if( xmlAddID( NULL, doc, idValue, idAttr ) == NULL ) {
fprintf( stderr , "### Can not add the ID value!\n" ) ;
goto done ;
@@ -188,7 +188,7 @@ int SAL_CALL main( int argc, char **argv )
if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) {
fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ;
- // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
+ // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ;
}
@@ -332,7 +332,7 @@ done :
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx b/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx
index 2856967cbd26..c9fa5261a00e 100644
--- a/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx
@@ -113,7 +113,7 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stdout, "\tCertificate Serial Number[%s]\n", OUStringToOString( bigIntegerToNumericString( xPersonalCerts[i]->getSerialNumber() ), RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
fprintf( stdout, "\tCertificate Subject[%s]\n", OUStringToOString( xPersonalCerts[i]->getSubjectName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
- //build the certificate path
+ //build the certificate path
xCertPath = pSecEnv->buildCertificatePath( xPersonalCerts[i] ) ;
//Print the certificate path.
fprintf( stdout, "\tCertificate Path\n" ) ;
diff --git a/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx
index 1b0015c6d92e..a36f6a30b628 100644
--- a/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx
@@ -12,7 +12,7 @@
#include "libxslt/xslt.h"
#endif
-
+
#include "securityenvironment_mscryptimpl.hxx"
#include "xmlelementwrapper_xmlsecimpl.hxx"
@@ -56,12 +56,12 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- CERTCertDBHandle* certHandle = NULL ;
- PK11SlotInfo* slot = NULL ;
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- FILE* dstFile = NULL ;
+ CERTCertDBHandle* certHandle = NULL ;
+ PK11SlotInfo* slot = NULL ;
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ FILE* dstFile = NULL ;
if( argc != 5 ) {
@@ -76,7 +76,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
@@ -238,7 +238,7 @@ done:
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
index d580649ed0e6..3bf6831459a5 100644
--- a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
@@ -45,16 +45,16 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- const char* n_pCertStore ;
- HCERTSTORE n_hStoreHandle ;
+ const char* n_pCertStore ;
+ HCERTSTORE n_hStoreHandle ;
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- FILE* dstFile = NULL ;
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ FILE* dstFile = NULL ;
- HCRYPTPROV hCryptProv = NULL ;
- HCRYPTKEY symKey = NULL ;
+ HCRYPTPROV hCryptProv = NULL ;
+ HCRYPTKEY symKey = NULL ;
if( argc != 6 && argc != 7 ) {
fprintf( stderr, "Usage: %s <file_url of template> <file_url of result> <target element name> <target element namespace> <rdb file>\n\n" , argv[0] ) ;
@@ -69,7 +69,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
//Initialize the crypto engine
@@ -258,8 +258,8 @@ int SAL_CALL main( int argc, char **argv )
OSL_ENSURE( xTemplate.is() ,
"Encryptor - "
"Cannot encrypt the xml document" ) ;
-
-
+
+
com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus = xTemplate->getStatus();
if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED)
{
@@ -300,7 +300,7 @@ done:
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/mscsfit/helper.cxx b/xmlsecurity/tools/standalone/mscsfit/helper.cxx
index 631ae1c397b7..e4c497558514 100644
--- a/xmlsecurity/tools/standalone/mscsfit/helper.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/helper.cxx
@@ -16,7 +16,7 @@ Reference< XInputStream > createStreamFromFile( const OUString sFile )
if( pcFile != NULL ) {
FILE *f = fopen( pcFile , "rb" );
Reference< XInputStream > r;
-
+
if( f ) {
fseek( f , 0 , SEEK_END );
int nLength = ftell( f );
@@ -26,7 +26,7 @@ Reference< XInputStream > createStreamFromFile( const OUString sFile )
fread( seqIn.getArray() , nLength , 1 , f );
r = Reference< XInputStream > ( new OInputStream( seqIn ) );
- fclose( f );
+ fclose( f );
}
return r;
} else {
@@ -71,7 +71,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext
"No rdb URI specified" ) ;
if( sUnoUrl.equalsAscii( "local" ) ) {
- Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry();
+ Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry();
OSL_ENSURE( xSimpleRegistry.is() ,
"serviceManager - "
"Cannot create simple registry" ) ;
diff --git a/xmlsecurity/tools/standalone/mscsfit/helper.hxx b/xmlsecurity/tools/standalone/mscsfit/helper.hxx
index 928c9415e997..fa782b387707 100644
--- a/xmlsecurity/tools/standalone/mscsfit/helper.hxx
+++ b/xmlsecurity/tools/standalone/mscsfit/helper.hxx
@@ -57,7 +57,7 @@ class OInputStream : public WeakImplHelper1 < XInputStream >
{
public:
OInputStream( const Sequence< sal_Int8 >&seq ) : m_seq( seq ), nPos( 0 ) {}
-
+
virtual sal_Int32 SAL_CALL readBytes(
Sequence< sal_Int8 >& aData ,
sal_Int32 nBytesToRead
@@ -168,7 +168,7 @@ class OUriBinding : public WeakImplHelper1 < ::com::sun::star::xml::crypto::XUri
virtual void SAL_CALL setUriBinding(
const ::rtl::OUString& aUri ,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aInputStream
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aInputStream
) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) {
m_vUris.push_back( aUri ) ;
m_vStreams.push_back( aInputStream ) ;
@@ -184,7 +184,7 @@ class OUriBinding : public WeakImplHelper1 < ::com::sun::star::xml::crypto::XUri
break;
}
}
-
+
return xInputStream;
}
diff --git a/xmlsecurity/tools/standalone/mscsfit/signer.cxx b/xmlsecurity/tools/standalone/mscsfit/signer.cxx
index ffa88577444a..84fa6aa93ce2 100644
--- a/xmlsecurity/tools/standalone/mscsfit/signer.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/signer.cxx
@@ -43,19 +43,19 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- const char* n_pCertStore ;
- HCERTSTORE n_hStoreHandle ;
-
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- xmlAttrPtr idAttr ;
- xmlChar* idValue ;
- xmlAttrPtr uriAttr ;
- xmlChar* uriValue ;
- OUString* uri = NULL ;
- Reference< XUriBinding > xUriBinding ;
- FILE* dstFile = NULL ;
+ const char* n_pCertStore ;
+ HCERTSTORE n_hStoreHandle ;
+
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ xmlAttrPtr idAttr ;
+ xmlChar* idValue ;
+ xmlAttrPtr uriAttr ;
+ xmlChar* uriValue ;
+ OUString* uri = NULL ;
+ Reference< XUriBinding > xUriBinding ;
+ FILE* dstFile = NULL ;
if( argc !=4 && argc != 5 ) {
fprintf( stderr, "Usage: %s <file_url of template> <file_url of result> <rdb file>\n" , argv[0] ) ;
@@ -72,7 +72,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
//Initialize the crypto engine
@@ -159,7 +159,7 @@ int SAL_CALL main( int argc, char **argv )
if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) {
fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ;
- // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
+ // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ;
}
@@ -289,10 +289,10 @@ int SAL_CALL main( int argc, char **argv )
xTemplate = xSigner->generate( xTemplate , xSecEnv ) ;
OSL_ENSURE( xTemplate.is() ,
"Signer - "
- "Cannot generate the xml signature" ) ;
-
+ "Cannot generate the xml signature" ) ;
+
SecurityOperationStatus m_nStatus = xTemplate->getStatus();
-
+
if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED)
{
fprintf( stdout, "Operation succeeds.\n") ;
@@ -332,7 +332,7 @@ done:
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/standalone/mscsfit/verifier.cxx b/xmlsecurity/tools/standalone/mscsfit/verifier.cxx
index c66233eebdf6..d7eac01a6e2c 100644
--- a/xmlsecurity/tools/standalone/mscsfit/verifier.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/verifier.cxx
@@ -46,19 +46,19 @@ using namespace ::com::sun::star::xml::crypto ;
int SAL_CALL main( int argc, char **argv )
{
- const char* n_pCertStore ;
- HCERTSTORE n_hStoreHandle ;
-
- xmlDocPtr doc = NULL ;
- xmlNodePtr tplNode ;
- xmlNodePtr tarNode ;
- xmlAttrPtr idAttr ;
- xmlChar* idValue ;
- xmlAttrPtr uriAttr ;
- xmlChar* uriValue ;
- OUString* uri = NULL ;
- Reference< XUriBinding > xUriBinding ;
- FILE* dstFile = NULL ;
+ const char* n_pCertStore ;
+ HCERTSTORE n_hStoreHandle ;
+
+ xmlDocPtr doc = NULL ;
+ xmlNodePtr tplNode ;
+ xmlNodePtr tarNode ;
+ xmlAttrPtr idAttr ;
+ xmlChar* idValue ;
+ xmlAttrPtr uriAttr ;
+ xmlChar* uriValue ;
+ OUString* uri = NULL ;
+ Reference< XUriBinding > xUriBinding ;
+ FILE* dstFile = NULL ;
if( argc !=3 && argc != 4 ) {
fprintf( stderr, "Usage: %s <file_url> <rdb file>\n" , argv[0] ) ;
@@ -75,7 +75,7 @@ int SAL_CALL main( int argc, char **argv )
xmlSubstituteEntitiesDefault(1);
#ifndef XMLSEC_NO_XSLT
- xmlIndentTreeOutput = 1;
+ xmlIndentTreeOutput = 1;
#endif // XMLSEC_NO_XSLT
//Initialize the crypto engine
@@ -111,7 +111,7 @@ int SAL_CALL main( int argc, char **argv )
if( tarNode == NULL ) {
tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", NULL ) ;
}
-
+
//Find the "id" attrbute in the element
if( tarNode != NULL ) {
if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"id" ) ) != NULL ) {
@@ -122,7 +122,7 @@ int SAL_CALL main( int argc, char **argv )
idAttr = NULL ;
}
}
-
+
//Add ID to DOM
if( idAttr != NULL ) {
idValue = xmlNodeListGetString( tarNode->doc, idAttr->children, 1 ) ;
@@ -130,7 +130,7 @@ int SAL_CALL main( int argc, char **argv )
fprintf( stderr , "### the ID value is NULL!\n" ) ;
goto done ;
}
-
+
if( xmlAddID( NULL, doc, idValue, idAttr ) == NULL ) {
fprintf( stderr , "### Can not add the ID value!\n" ) ;
goto done ;
@@ -161,7 +161,7 @@ int SAL_CALL main( int argc, char **argv )
if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) {
fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ;
- // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
+ // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ;
uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ;
}
@@ -288,9 +288,9 @@ int SAL_CALL main( int argc, char **argv )
//perform validation
xTemplate = xSigner->validate( xTemplate , xSecCtx ) ;
-
+
com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus = xTemplate->getStatus();
-
+
if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED)
{
fprintf( stdout, "Operation succeeds.\n") ;
@@ -318,7 +318,7 @@ done :
/* Shutdown libxslt/libxml */
#ifndef XMLSEC_NO_XSLT
- xsltCleanupGlobals();
+ xsltCleanupGlobals();
#endif /* XMLSEC_NO_XSLT */
xmlCleanupParser();
diff --git a/xmlsecurity/tools/uno/AdapterNode.java b/xmlsecurity/tools/uno/AdapterNode.java
index bed8e2a3631c..b42b7a3b32ef 100644
--- a/xmlsecurity/tools/uno/AdapterNode.java
+++ b/xmlsecurity/tools/uno/AdapterNode.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,11 +37,11 @@ import org.w3c.dom.NamedNodeMap;
* display in the tree. It also returns children, index values,
* and child counts.
*/
-class AdapterNode
-{
+class AdapterNode
+{
private Node m_domNode;
static final int ELEMENT_TYPE = Node.ELEMENT_NODE;
-
+
/*
* An array of names for DOM node-types
*/
@@ -60,105 +60,105 @@ class AdapterNode
"DocFragment",
"Notation",
};
-
+
protected Node getNode()
{
return m_domNode;
}
-
+
/*
* Construct an Adapter node from a DOM node
*/
- protected AdapterNode(org.w3c.dom.Node node)
+ protected AdapterNode(org.w3c.dom.Node node)
{
m_domNode = node;
}
-
+
/*
* Return children, index, and count values
*/
- protected int index(AdapterNode child)
+ protected int index(AdapterNode child)
{
int count = childCount();
- for (int i=0; i<count; ++i)
+ for (int i=0; i<count; ++i)
{
AdapterNode n = this.child(i);
if (child.m_domNode == n.m_domNode) return i;
}
return -1;
}
-
- protected AdapterNode child(int searchIndex)
+
+ protected AdapterNode child(int searchIndex)
{
if (m_domNode == null) return null;
-
+
/*
- * Note: JTree index is zero-based.
+ * Note: JTree index is zero-based.
*/
- org.w3c.dom.Node node =
+ org.w3c.dom.Node node =
m_domNode.getChildNodes().item(searchIndex);
-
- return new AdapterNode(node);
+
+ return new AdapterNode(node);
}
-
- protected int childCount()
+
+ protected int childCount()
{
int rc = 0;
-
+
if (m_domNode != null)
{
rc = m_domNode.getChildNodes().getLength();
}
-
+
return rc;
}
-
+
/*
* Return a string that identifies this node in the tree
*/
- public String toString()
+ public String toString()
{
String rc = null;
-
+
if (m_domNode != null)
{
String s = typeName[m_domNode.getNodeType()];
String nodeName = m_domNode.getNodeName();
-
- if (! nodeName.startsWith("#"))
+
+ if (! nodeName.startsWith("#"))
{
s += ": " + nodeName;
}
-
- if (m_domNode.getNodeValue() != null)
+
+ if (m_domNode.getNodeValue() != null)
{
- if (s.startsWith("ProcInstr"))
+ if (s.startsWith("ProcInstr"))
{
- s += ", ";
+ s += ", ";
}
- else
+ else
{
s += ": ";
}
-
+
String t = m_domNode.getNodeValue();
s += t;
}
-
+
if (m_domNode.getNodeType() == ELEMENT_TYPE)
{
NamedNodeMap attrs = m_domNode.getAttributes();
-
+
int length = attrs.getLength();
for (int i=0; i<length; ++i)
{
Attr attr = (Attr)(attrs.item(i));
- s += " "+ attr.getName()+"='"+attr.getValue() + "'";
+ s += " "+ attr.getName()+"='"+attr.getValue() + "'";
}
}
rc = s;
}
-
+
return rc;
}
}
diff --git a/xmlsecurity/tools/uno/AttributeListHelper.java b/xmlsecurity/tools/uno/AttributeListHelper.java
index c95067bcecb6..7eb92b647201 100644
--- a/xmlsecurity/tools/uno/AttributeListHelper.java
+++ b/xmlsecurity/tools/uno/AttributeListHelper.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,7 +40,7 @@ import com.sun.star.xml.sax.XAttributeList;
public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList
{
private Vector m_AttributeList;
-
+
public AttributeListHelper()
{
m_AttributeList = new Vector();
@@ -55,7 +55,7 @@ public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList
{
int nLength = m_AttributeList.size();
boolean bFound = false;
-
+
for (int i=0; i<nLength; ++i)
{
if (getNameByIndex((short)i).equals(name))
@@ -67,7 +67,7 @@ public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList
break;
}
}
-
+
if (!bFound)
{
Vector attribute = new Vector();
@@ -81,22 +81,22 @@ public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList
public String getAttributeItem(short index, int itemIndex)
{
String item = null;
-
+
if (index>=0 && index<getLength())
{
Vector attribute = (Vector)m_AttributeList.get(index);
item = (String)(attribute.get(itemIndex));
}
-
+
return item;
}
-
+
/* XAttributeList */
public short getLength()
{
return (short)m_AttributeList.size();
}
-
+
public String getNameByIndex(short i)
{
return getAttributeItem(i, 0);
@@ -111,12 +111,12 @@ public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList
{
return getAttributeItem(i, 2);
}
-
+
public String getTypeByName(String aName)
{
int nLength = m_AttributeList.size();
String type = null;
-
+
for (int i=0; i<nLength; ++i)
{
if (getNameByIndex((short)i).equals(aName))
@@ -125,15 +125,15 @@ public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList
break;
}
}
-
+
return type;
}
-
+
public String getValueByName(String aName)
{
int nLength = m_AttributeList.size();
String value = null;
-
+
for (int i=0; i<nLength; ++i)
{
if (getNameByIndex((short)i).equals(aName))
diff --git a/xmlsecurity/tools/uno/DomToTreeModelAdapter.java b/xmlsecurity/tools/uno/DomToTreeModelAdapter.java
index 709d0efa9515..9ca44256ad12 100644
--- a/xmlsecurity/tools/uno/DomToTreeModelAdapter.java
+++ b/xmlsecurity/tools/uno/DomToTreeModelAdapter.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,11 +35,11 @@ import java.util.Enumeration;
import java.util.Vector;
/*
- * This adapter converts the current Document (a DOM) into
- * a JTree model.
+ * This adapter converts the current Document (a DOM) into
+ * a JTree model.
*/
-class DomToTreeModelAdapter
- implements javax.swing.tree.TreeModel
+class DomToTreeModelAdapter
+ implements javax.swing.tree.TreeModel
{
private Document m_document;
private Vector m_listenerList = new Vector();
@@ -50,50 +50,50 @@ class DomToTreeModelAdapter
}
/*
- * Basic TreeModel operations
+ * Basic TreeModel operations
*/
- public Object getRoot()
+ public Object getRoot()
{
return new AdapterNode(m_document);
}
- public boolean isLeaf(Object aNode)
+ public boolean isLeaf(Object aNode)
{
boolean rc = true;
-
+
/*
* Determines whether the icon shows up to the left.
* Return true for any node with no children.
*/
AdapterNode node = (AdapterNode) aNode;
-
+
if (node.childCount() > 0)
{
rc = false;
}
-
+
return rc;
}
-
- public int getChildCount(Object parent)
+
+ public int getChildCount(Object parent)
{
AdapterNode node = (AdapterNode) parent;
return node.childCount();
}
-
- public Object getChild(Object parent, int index)
+
+ public Object getChild(Object parent, int index)
{
AdapterNode node = (AdapterNode) parent;
return node.child(index);
}
-
- public int getIndexOfChild(Object parent, Object child)
+
+ public int getIndexOfChild(Object parent, Object child)
{
AdapterNode node = (AdapterNode) parent;
return node.index((AdapterNode) child);
}
-
- public void valueForPathChanged(TreePath path, Object newValue)
+
+ public void valueForPathChanged(TreePath path, Object newValue)
{
/*
* Null. We won't be making changes in the GUI
@@ -102,60 +102,60 @@ class DomToTreeModelAdapter
*/
}
- public void addTreeModelListener(TreeModelListener listener)
+ public void addTreeModelListener(TreeModelListener listener)
{
- if ( listener != null
- && ! m_listenerList.contains( listener ) )
+ if ( listener != null
+ && ! m_listenerList.contains( listener ) )
{
m_listenerList.addElement( listener );
}
}
-
- public void removeTreeModelListener(TreeModelListener listener)
+
+ public void removeTreeModelListener(TreeModelListener listener)
{
- if ( listener != null )
+ if ( listener != null )
{
m_listenerList.removeElement( listener );
}
}
-
- public void fireTreeNodesChanged( TreeModelEvent e )
+
+ public void fireTreeNodesChanged( TreeModelEvent e )
{
Enumeration listeners = m_listenerList.elements();
- while ( listeners.hasMoreElements() )
+ while ( listeners.hasMoreElements() )
{
- TreeModelListener listener =
+ TreeModelListener listener =
(TreeModelListener) listeners.nextElement();
listener.treeNodesChanged( e );
}
- }
+ }
- public void fireTreeNodesInserted( TreeModelEvent e )
+ public void fireTreeNodesInserted( TreeModelEvent e )
{
Enumeration listeners = m_listenerList.elements();
- while ( listeners.hasMoreElements() )
+ while ( listeners.hasMoreElements() )
{
TreeModelListener listener =
(TreeModelListener) listeners.nextElement();
listener.treeNodesInserted( e );
}
- }
+ }
- public void fireTreeNodesRemoved( TreeModelEvent e )
+ public void fireTreeNodesRemoved( TreeModelEvent e )
{
Enumeration listeners = m_listenerList.elements();
- while ( listeners.hasMoreElements() )
+ while ( listeners.hasMoreElements() )
{
- TreeModelListener listener =
+ TreeModelListener listener =
(TreeModelListener) listeners.nextElement();
listener.treeNodesRemoved( e );
}
- }
+ }
- public void fireTreeStructureChanged( TreeModelEvent e )
+ public void fireTreeStructureChanged( TreeModelEvent e )
{
Enumeration listeners = m_listenerList.elements();
- while ( listeners.hasMoreElements() )
+ while ( listeners.hasMoreElements() )
{
TreeModelListener listener =
(TreeModelListener) listeners.nextElement();
diff --git a/xmlsecurity/tools/uno/EncryptionEntity.java b/xmlsecurity/tools/uno/EncryptionEntity.java
index 51f14b2bbf6b..49e1c8630618 100644
--- a/xmlsecurity/tools/uno/EncryptionEntity.java
+++ b/xmlsecurity/tools/uno/EncryptionEntity.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ import com.sun.star.xml.crypto.sax.*;
class EncryptionEntity extends SecurityEntity
{
private int m_nEncryptionElementCollectorId;
-
+
EncryptionEntity(
XSecuritySAXEventKeeper xSAXEventKeeper,
boolean isExporting,
@@ -55,13 +55,13 @@ class EncryptionEntity extends SecurityEntity
{
super(xSAXEventKeeper, xXMLSecurityContext, xXMLSignature,
xXMLEncryption, xRemoteServiceManager, xRemoteContext);
-
+
m_nEncryptionElementCollectorId = m_xSAXEventKeeper.addSecurityElementCollector(
ElementMarkPriority.AFTERMODIFY,
true);
-
+
m_xSAXEventKeeper.setSecurityId(m_nEncryptionElementCollectorId, m_nSecurityId);
-
+
if (isExporting)
{
try
@@ -71,11 +71,11 @@ class EncryptionEntity extends SecurityEntity
*/
Object encryptor = m_xRemoteServiceManager.createInstanceWithContext(
TestTool.ENCRYPTOR_COMPONENT, m_xRemoteContext);
-
- m_xReferenceResolvedListener =
+
+ m_xReferenceResolvedListener =
(XReferenceResolvedListener)UnoRuntime.queryInterface(
- XReferenceResolvedListener.class, encryptor);
-
+ XReferenceResolvedListener.class, encryptor);
+
/*
* initializes the Encryptor.
*/
@@ -89,11 +89,11 @@ class EncryptionEntity extends SecurityEntity
args[3] = m_xXMLSecurityContext.getSecurityEnvironment();
args[4] = m_xXMLEncryption;
xInitialization.initialize(args);
-
+
/*
* sets encryption result listener.
*/
- XEncryptionResultBroadcaster m_xEncryptionResultBroadcaster =
+ XEncryptionResultBroadcaster m_xEncryptionResultBroadcaster =
(XEncryptionResultBroadcaster)UnoRuntime.queryInterface(
XEncryptionResultBroadcaster.class, m_xReferenceResolvedListener);
m_xEncryptionResultBroadcaster.addEncryptionResultListener(
@@ -113,11 +113,11 @@ class EncryptionEntity extends SecurityEntity
*/
Object decryptor = m_xRemoteServiceManager.createInstanceWithContext(
TestTool.DECRYPTOR_COMPONENT, m_xRemoteContext);
-
- m_xReferenceResolvedListener =
+
+ m_xReferenceResolvedListener =
(XReferenceResolvedListener)UnoRuntime.queryInterface(
- XReferenceResolvedListener.class, decryptor);
-
+ XReferenceResolvedListener.class, decryptor);
+
/*
* initializes the Decryptor.
*/
@@ -129,11 +129,11 @@ class EncryptionEntity extends SecurityEntity
args[3] = m_xXMLSecurityContext;
args[4] = m_xXMLEncryption;
xInitialization.initialize(args);
-
+
/*
* sets decryption result listener.
*/
- XDecryptionResultBroadcaster m_xDecryptionResultBroadcaster =
+ XDecryptionResultBroadcaster m_xDecryptionResultBroadcaster =
(XDecryptionResultBroadcaster)UnoRuntime.queryInterface(
XDecryptionResultBroadcaster.class, m_xReferenceResolvedListener);
m_xDecryptionResultBroadcaster.addDecryptionResultListener(
@@ -145,13 +145,13 @@ class EncryptionEntity extends SecurityEntity
e.printStackTrace();
}
}
-
+
/*
* creates a Blocker.
*/
int blockerId = m_xSAXEventKeeper.addBlocker();
m_xSAXEventKeeper.setSecurityId(blockerId, m_nSecurityId);
-
+
try
{
XBlockerMonitor xBlockerMonitor = (XBlockerMonitor)UnoRuntime.queryInterface(
@@ -166,12 +166,12 @@ class EncryptionEntity extends SecurityEntity
/*
* configures the resolve listener for the encryption template.
*/
- XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
+ XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
(XReferenceResolvedBroadcaster)UnoRuntime.queryInterface(
XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper);
xReferenceResolvedBroadcaster.addReferenceResolvedListener(m_nEncryptionElementCollectorId, m_xReferenceResolvedListener);
}
-
+
/*
* add the reference to this encryption.
*
@@ -185,23 +185,23 @@ class EncryptionEntity extends SecurityEntity
protected boolean setReference(boolean isExporting)
{
boolean rc = false;
-
+
int referenceId = m_xSAXEventKeeper.addSecurityElementCollector(
isExporting?
(ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY),
true);
-
+
m_xSAXEventKeeper.setSecurityId(referenceId, m_nSecurityId);
- XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
+ XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
(XReferenceResolvedBroadcaster)UnoRuntime.queryInterface(
XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper);
xReferenceResolvedBroadcaster.addReferenceResolvedListener(
referenceId, m_xReferenceResolvedListener);
-
+
try
{
- XReferenceCollector xReferenceCollector =
+ XReferenceCollector xReferenceCollector =
(XReferenceCollector)UnoRuntime.queryInterface(
XReferenceCollector.class, m_xReferenceResolvedListener);
xReferenceCollector.setReferenceId(referenceId);
@@ -211,7 +211,7 @@ class EncryptionEntity extends SecurityEntity
e.printStackTrace();
rc = false;
}
-
+
return rc;
}
}
diff --git a/xmlsecurity/tools/uno/ParsingThread.java b/xmlsecurity/tools/uno/ParsingThread.java
index f4bfea4a442e..adffbb271979 100644
--- a/xmlsecurity/tools/uno/ParsingThread.java
+++ b/xmlsecurity/tools/uno/ParsingThread.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,33 +41,33 @@ class ParsingThread
* the Node which will be handled with in the next step
*/
private Node m_node;
-
+
/*
* the event to be handled in the next step.
* true means endElement event, false otherwise.
*/
private boolean m_bIsEndEvent;
-
+
/*
* the document handler which receives generated SAX events
*/
private XDocumentHandler m_xDocumentHandler;
-
+
/*
* the TestTool which receives UI feedbacks
*/
private TestTool m_testTool;
-
-
- ParsingThread(Node node, XDocumentHandler xDocumentHandler, TestTool testTool)
+
+
+ ParsingThread(Node node, XDocumentHandler xDocumentHandler, TestTool testTool)
{
m_node = node;
m_xDocumentHandler = xDocumentHandler;
m_testTool = testTool;
-
+
m_bIsEndEvent = false;
}
-
+
/*
* changes the document handler.
*/
@@ -75,7 +75,7 @@ class ParsingThread
{
this.m_xDocumentHandler = xDocumentHandler;
}
-
+
/*
* sends the next SAX event.
* when there is no further step, then false is returned,
@@ -84,7 +84,7 @@ class ParsingThread
protected boolean nextStep()
{
boolean rc = true;
-
+
try
{
String message;
@@ -103,11 +103,11 @@ class ParsingThread
break;
case Node.ELEMENT_NODE: /* startElement */
String nodeName = m_node.getNodeName();
- message = "startElement:"+nodeName;
+ message = "startElement:"+nodeName;
NamedNodeMap attrs = m_node.getAttributes();
-
+
AttributeListHelper attributeListHelper = new AttributeListHelper();
-
+
int length = attrs.getLength();
for (int i=0; i<length; ++i)
{
@@ -115,10 +115,10 @@ class ParsingThread
attributeListHelper.setAttribute(attr.getName(), "CDATA", attr.getValue());
message += " "+attr.getName()+"='"+attr.getValue()+"'";
}
-
+
m_testTool.updatesCurrentSAXEventInformation(message);
m_xDocumentHandler.startElement(m_node.getNodeName(), attributeListHelper);
-
+
m_testTool.updatesUIs();
break;
case Node.TEXT_NODE: /* characters */
@@ -138,16 +138,16 @@ class ParsingThread
m_testTool.updatesUIs();
break;
}
-
+
/*
* figures out the event for the next step.
*/
- switch (type)
+ switch (type)
{
- case Node.DOCUMENT_NODE:
+ case Node.DOCUMENT_NODE:
case Node.ELEMENT_NODE:
- if (m_node.hasChildNodes())
- /*
+ if (m_node.hasChildNodes())
+ /*
* for a Document node or an Element node,
* if the node has children, then the next event will be for its
* first child node.
@@ -155,27 +155,27 @@ class ParsingThread
{
m_node = m_node.getFirstChild();
}
- else
+ else
/*
* otherwise, the next event will be endElement.
*/
{
- m_bIsEndEvent = true;
+ m_bIsEndEvent = true;
}
- break;
+ break;
case Node.TEXT_NODE:
case Node.PROCESSING_INSTRUCTION_NODE:
- case Node.COMMENT_NODE:
+ case Node.COMMENT_NODE:
Node nextNode = m_node.getNextSibling();
- if (nextNode != null)
+ if (nextNode != null)
/*
* for other kinds of node,
* if it has a next sibling, then the next event will be for that
* sibling.
*/
{
- m_node = nextNode;
- }
+ m_node = nextNode;
+ }
else
/*
* otherwise, the next event will be the endElement for the node's
@@ -183,9 +183,9 @@ class ParsingThread
*/
{
m_node = m_node.getParentNode();
- m_bIsEndEvent = true;
+ m_bIsEndEvent = true;
}
- break;
+ break;
}
}
else
@@ -196,20 +196,20 @@ class ParsingThread
switch (type)
{
case Node.DOCUMENT_NODE: /* endDocument */
- m_testTool.updatesCurrentSAXEventInformation("endDocument");
- m_xDocumentHandler.endDocument();
+ m_testTool.updatesCurrentSAXEventInformation("endDocument");
+ m_xDocumentHandler.endDocument();
m_testTool.updatesUIs();
-
+
/*
* no further steps.
*/
rc = false;
break;
case Node.ELEMENT_NODE: /* endElement */
- m_testTool.updatesCurrentSAXEventInformation("endElement:"+m_node.getNodeName());
- m_xDocumentHandler.endElement(m_node.getNodeName());
+ m_testTool.updatesCurrentSAXEventInformation("endElement:"+m_node.getNodeName());
+ m_xDocumentHandler.endElement(m_node.getNodeName());
m_testTool.updatesUIs();
-
+
Node nextNode = m_node.getNextSibling();
if (nextNode != null)
/*
@@ -235,13 +235,13 @@ class ParsingThread
catch( com.sun.star.xml.sax.SAXException e)
{
e.printStackTrace();
-
+
/*
* forces to end.
*/
rc = false;
}
-
+
return rc;
}
}
diff --git a/xmlsecurity/tools/uno/SAXEventCollector.java b/xmlsecurity/tools/uno/SAXEventCollector.java
index e94c55252083..cb796515bcb1 100644
--- a/xmlsecurity/tools/uno/SAXEventCollector.java
+++ b/xmlsecurity/tools/uno/SAXEventCollector.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -27,10 +27,10 @@
package com.sun.star.xml.security.uno;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -51,73 +51,73 @@ class SAXEventCollector implements XDocumentHandler
* the document which keeps received SAX events
*/
private Document m_document;
-
+
/*
* the current Element to which the next received
* SAX event will be added.
*/
private Node m_currentElement;
-
+
/*
* the TestTool which receives UI feedbacks
*/
private TestTool m_testTool;
-
+
/*
* whether displays information on console.
*/
private boolean m_systemDisplay;
-
+
SAXEventCollector(TestTool testTool)
{
this(testTool, false);
}
-
+
SAXEventCollector(TestTool testTool, boolean sysDis)
{
m_systemDisplay = sysDis;
m_testTool = testTool;
-
+
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
-
- try
+
+ try
{
DocumentBuilder builder = factory.newDocumentBuilder();
m_document = builder.newDocument();
-
+
m_currentElement = m_document;
}
catch (ParserConfigurationException pce) {
pce.printStackTrace();
}
}
-
+
protected Document getDocument()
{
return m_document;
}
-
+
protected Node getCurrentElement()
{
return m_currentElement;
}
-
+
/*
* XDocumentHandler
*/
- public void startDocument ()
+ public void startDocument ()
{
}
-
+
public void endDocument()
{
}
-
+
public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs)
{
Element newElement = m_document.createElement(str);
-
+
if (xattribs !=null)
{
int length = xattribs.getLength();
@@ -128,15 +128,15 @@ class SAXEventCollector implements XDocumentHandler
xattribs.getValueByIndex(i));
}
}
-
+
if (m_systemDisplay)
{
System.out.println("startElement:"+m_currentElement.toString());
}
-
+
m_currentElement.appendChild(newElement);
m_currentElement = newElement;
-
+
if (m_testTool != null)
{
m_testTool.updatesUIs();
@@ -149,19 +149,19 @@ class SAXEventCollector implements XDocumentHandler
{
System.out.println("endElement:"+str+" "+m_currentElement.toString());
}
-
+
m_currentElement = m_currentElement.getParentNode();
if (m_systemDisplay)
{
System.out.println("----> "+m_currentElement.toString());
}
-
+
if (m_testTool != null)
{
m_testTool.updatesUIs();
}
}
-
+
public void characters(String str)
{
Text newText = m_document.createTextNode(str);
@@ -171,14 +171,14 @@ class SAXEventCollector implements XDocumentHandler
m_testTool.updatesUIs();
}
}
-
+
public void ignorableWhitespace(String str)
{
}
-
+
public void processingInstruction(String aTarget, String aData)
{
- ProcessingInstruction newPI
+ ProcessingInstruction newPI
= m_document.createProcessingInstruction(aTarget, aData);
m_currentElement.appendChild(newPI);
if (m_testTool != null)
@@ -187,7 +187,7 @@ class SAXEventCollector implements XDocumentHandler
}
}
- public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
+ public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
throws com.sun.star.xml.sax.SAXException
{
}
diff --git a/xmlsecurity/tools/uno/SAXEventPrinter.java b/xmlsecurity/tools/uno/SAXEventPrinter.java
index d841926bdd13..7dc518a3f731 100644
--- a/xmlsecurity/tools/uno/SAXEventPrinter.java
+++ b/xmlsecurity/tools/uno/SAXEventPrinter.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,25 +48,25 @@ class SAXEventPrinter implements XDocumentHandler
* how many spaces as the indent of line
*/
private int m_nIndent;
-
+
/*
- * whether a NEW LINE character need to be appended to
+ * whether a NEW LINE character need to be appended to
* each line
*/
private boolean m_bIsFormatted;
-
+
/*
* the output stream to write
*/
private FileOutputStream m_fileOutputStream;
-
+
SAXEventPrinter(FileOutputStream fileOutputStream, boolean isFormatted)
{
m_nIndent = 0;
m_fileOutputStream = fileOutputStream;
m_bIsFormatted = isFormatted;
}
-
+
protected static void outputIndent(int m_nIndent, FileOutputStream fileOutputStream)
throws IOException
{
@@ -75,7 +75,7 @@ class SAXEventPrinter implements XDocumentHandler
fileOutputStream.write(" ".getBytes());
}
}
-
+
/*
* displays the tree of a Node.
*/
@@ -88,67 +88,67 @@ class SAXEventPrinter implements XDocumentHandler
String message;
NodeList children;
int i, length;
-
+
switch (type)
{
case Node.DOCUMENT_NODE:
children = node.getChildNodes();
- length = children.getLength();
+ length = children.getLength();
for (i=0; i<length; ++i)
{
display(children.item(i), indent+2, fileOutputStream, isFormatted);
}
-
+
break;
-
+
case Node.ELEMENT_NODE:
message = new String("<"+node.getNodeName());
NamedNodeMap attrs = node.getAttributes();
-
+
length = attrs.getLength();
for (i=0; i<length; ++i)
{
Attr attr = (Attr)attrs.item(i);
message += " "+attr.getNodeName()+"=\""+attr.getNodeValue()+"\"";
}
-
+
message += ">";
-
+
if (isFormatted)
{
outputIndent(indent, fileOutputStream);
}
-
+
fileOutputStream.write(message.getBytes("UTF-8"));
-
+
if (isFormatted)
{
fileOutputStream.write("\n".getBytes());
}
-
+
children = node.getChildNodes();
length = children.getLength();
for (i=0; i<length; ++i)
{
display(children.item(i), indent+2, fileOutputStream, isFormatted);
}
-
+
if (isFormatted)
{
outputIndent(indent, fileOutputStream);
}
-
+
fileOutputStream.write("</".getBytes());
fileOutputStream.write(node.getNodeName().getBytes("UTF-8"));
fileOutputStream.write(">".getBytes());
-
+
if (isFormatted)
{
fileOutputStream.write("\n".getBytes());
}
-
+
break;
-
+
case Node.TEXT_NODE:
message = node.getNodeValue();
if (message != null )
@@ -157,32 +157,32 @@ class SAXEventPrinter implements XDocumentHandler
{
outputIndent(indent, fileOutputStream);
}
-
+
fileOutputStream.write(node.getNodeValue().getBytes("UTF-8"));
-
+
if (isFormatted)
{
fileOutputStream.write("\n".getBytes());
}
}
break;
-
+
case Node.PROCESSING_INSTRUCTION_NODE:
if (isFormatted)
{
outputIndent(indent, fileOutputStream);
}
-
+
fileOutputStream.write("<?".getBytes());
fileOutputStream.write(node.getNodeName().getBytes("UTF-8"));
fileOutputStream.write(node.getNodeValue().getBytes("UTF-8"));
fileOutputStream.write("?>".getBytes());
-
+
if (isFormatted)
{
fileOutputStream.write("\n".getBytes());
}
-
+
break;
default:
break;
@@ -193,20 +193,20 @@ class SAXEventPrinter implements XDocumentHandler
/*
* XDocumentHandler
*/
- public void startDocument ()
+ public void startDocument ()
{
}
-
+
public void endDocument()
{
}
-
+
public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs)
{
try
{
String message;
-
+
message = new String("<"+str);
if (xattribs !=null)
{
@@ -217,19 +217,19 @@ class SAXEventPrinter implements XDocumentHandler
}
}
message += ">";
-
+
if (m_bIsFormatted)
{
outputIndent(m_nIndent, m_fileOutputStream);
}
-
+
m_fileOutputStream.write(message.getBytes("UTF-8"));
-
+
if (m_bIsFormatted)
{
m_fileOutputStream.write("\n".getBytes());
}
-
+
m_nIndent += 2;
}
catch (IOException e)
@@ -247,11 +247,11 @@ class SAXEventPrinter implements XDocumentHandler
{
outputIndent(m_nIndent, m_fileOutputStream);
}
-
+
m_fileOutputStream.write("</".getBytes());
m_fileOutputStream.write(str.getBytes("UTF-8"));
m_fileOutputStream.write(">".getBytes());
-
+
if (m_bIsFormatted)
{
m_fileOutputStream.write("\n".getBytes());
@@ -262,7 +262,7 @@ class SAXEventPrinter implements XDocumentHandler
e.printStackTrace();
}
}
-
+
public void characters(String str)
{
try
@@ -271,9 +271,9 @@ class SAXEventPrinter implements XDocumentHandler
{
outputIndent(m_nIndent, m_fileOutputStream);
}
-
+
m_fileOutputStream.write(str.getBytes("UTF-8"));
-
+
if (m_bIsFormatted)
{
m_fileOutputStream.write("\n".getBytes());
@@ -284,11 +284,11 @@ class SAXEventPrinter implements XDocumentHandler
e.printStackTrace();
}
}
-
+
public void ignorableWhitespace(String str)
{
}
-
+
public void processingInstruction(String aTarget, String aData)
{
try
@@ -297,11 +297,11 @@ class SAXEventPrinter implements XDocumentHandler
{
outputIndent(m_nIndent, m_fileOutputStream);
}
-
+
m_fileOutputStream.write("<?".getBytes());
m_fileOutputStream.write(aTarget.getBytes("UTF-8"));
m_fileOutputStream.write("?>".getBytes());
-
+
if (m_bIsFormatted)
{
m_fileOutputStream.write("\n".getBytes());
@@ -313,7 +313,7 @@ class SAXEventPrinter implements XDocumentHandler
}
}
- public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
+ public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
throws com.sun.star.xml.sax.SAXException
{
}
diff --git a/xmlsecurity/tools/uno/SecurityEntity.java b/xmlsecurity/tools/uno/SecurityEntity.java
index 85ef5ed49891..8f6e66551437 100644
--- a/xmlsecurity/tools/uno/SecurityEntity.java
+++ b/xmlsecurity/tools/uno/SecurityEntity.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@ class SecurityEntity
*/
private static int m_nNextSecurityId = 1;
protected int m_nSecurityId;
-
+
/*
* xml security related components
*/
@@ -62,7 +62,7 @@ class SecurityEntity
* the uri of the key material of this security entity
*/
private String m_keyURI;
-
+
SecurityEntity(
XSecuritySAXEventKeeper xSAXEventKeeper,
XXMLSecurityContext xXMLSecurityContext,
@@ -77,7 +77,7 @@ class SecurityEntity
m_xXMLEncryption = xXMLEncryption;
m_xRemoteServiceManager = xRemoteServiceManager;
m_xRemoteContext = xRemoteContext;
-
+
m_nSecurityId = getNextSecurityId();
m_keyURI = null;
}
@@ -85,7 +85,7 @@ class SecurityEntity
/**************************************************************************************
* private methods
**************************************************************************************/
-
+
/*
* generates a new security id.
*/
@@ -98,7 +98,7 @@ class SecurityEntity
/**************************************************************************************
* protected methods
**************************************************************************************/
-
+
/*
* notifies the key collector about the key id, this key id
* is used to ask the SAXEventKeeper to release the bufferred
@@ -110,7 +110,7 @@ class SecurityEntity
{
try
{
- XKeyCollector xKeyCollector =
+ XKeyCollector xKeyCollector =
(XKeyCollector)UnoRuntime.queryInterface(
XKeyCollector.class, m_xReferenceResolvedListener);
xKeyCollector.setKeyId(id);
@@ -120,7 +120,7 @@ class SecurityEntity
e.printStackTrace();
}
}
-
+
/*
* set the key uri, which will be the value of the id attribute
* of the key element
@@ -129,17 +129,17 @@ class SecurityEntity
{
m_keyURI = new String(uri);
}
-
+
protected XReferenceResolvedListener getReferenceListener()
{
return m_xReferenceResolvedListener;
}
-
+
protected int getSecurityId()
{
return m_nSecurityId;
}
-
+
/*
* configures the key material to the security entity.
*
@@ -154,7 +154,7 @@ class SecurityEntity
protected boolean setKey(String uri, boolean isExporting)
{
boolean rc = false;
-
+
if (m_keyURI != null &&
m_keyURI.equals(uri))
{
@@ -162,40 +162,40 @@ class SecurityEntity
isExporting?
(ElementMarkPriority.BEFOREMODIFY):(ElementMarkPriority.AFTERMODIFY),
false );
-
+
setKeyId(referenceId);
m_xSAXEventKeeper.setSecurityId(referenceId, m_nSecurityId);
- XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
+ XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
(XReferenceResolvedBroadcaster)UnoRuntime.queryInterface(
XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper);
-
+
xReferenceResolvedBroadcaster.addReferenceResolvedListener(referenceId, m_xReferenceResolvedListener);
-
+
rc = true;
}
-
+
return rc;
}
-
+
/*
* ends this misstion, asks the security engine to clear up all
* resources.
*/
protected boolean endMission()
{
- XMissionTaker xMissionTaker =
+ XMissionTaker xMissionTaker =
(XMissionTaker)UnoRuntime.queryInterface(
XMissionTaker.class, m_xReferenceResolvedListener);
-
+
boolean rc = xMissionTaker.endMission();
-
+
m_xXMLSecurityContext = null;
m_xXMLSignature = null;
m_xXMLEncryption = null;
m_xReferenceResolvedListener = null;
m_xSAXEventKeeper = null;
-
+
return rc;
}
}
diff --git a/xmlsecurity/tools/uno/SignatureEntity.java b/xmlsecurity/tools/uno/SignatureEntity.java
index d02ad3ee74d7..da69beeb4407 100644
--- a/xmlsecurity/tools/uno/SignatureEntity.java
+++ b/xmlsecurity/tools/uno/SignatureEntity.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@ import com.sun.star.uno.XComponentContext;
import com.sun.star.xml.crypto.*;
import com.sun.star.xml.crypto.sax.*;
-
+
/*
* this class maintains the data for a signature operation.
*/
@@ -45,10 +45,10 @@ class SignatureEntity extends SecurityEntity
{
private Vector m_vReferenceIds;
private int m_nSignatureElementCollectorId;
-
+
SignatureEntity(
XSecuritySAXEventKeeper xSAXEventKeeper,
- boolean isExporting,
+ boolean isExporting,
Object resultListener,
XXMLSecurityContext xXMLSecurityContext,
XXMLSignature xXMLSignature,
@@ -58,9 +58,9 @@ class SignatureEntity extends SecurityEntity
{
super(xSAXEventKeeper, xXMLSecurityContext, xXMLSignature,
xXMLEncryption, xRemoteServiceManager, xRemoteContext);
-
+
m_vReferenceIds = new Vector();
-
+
if (isExporting)
{
m_nSignatureElementCollectorId = m_xSAXEventKeeper.addSecurityElementCollector(
@@ -70,24 +70,24 @@ class SignatureEntity extends SecurityEntity
m_xSAXEventKeeper.setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId);
try
- {
+ {
/*
* creates a SignatureCreator.
*/
Object signatureCreator = m_xRemoteServiceManager.createInstanceWithContext(
TestTool.SIGNATURECREATOR_COMPONENT, m_xRemoteContext);
-
- m_xReferenceResolvedListener =
+
+ m_xReferenceResolvedListener =
(XReferenceResolvedListener)UnoRuntime.queryInterface(
- XReferenceResolvedListener.class, signatureCreator);
-
+ XReferenceResolvedListener.class, signatureCreator);
+
/*
* initializes the SignatureCreator.
*/
- XInitialization xInitialization =
+ XInitialization xInitialization =
(XInitialization)UnoRuntime.queryInterface(
XInitialization.class, m_xReferenceResolvedListener);
-
+
Object args[]=new Object[5];
args[0] = new Integer(m_nSecurityId).toString();
args[1] = m_xSAXEventKeeper;
@@ -95,21 +95,21 @@ class SignatureEntity extends SecurityEntity
args[3] = m_xXMLSecurityContext.getSecurityEnvironment();
args[4] = m_xXMLSignature;
xInitialization.initialize(args);
-
+
/*
* creates a Blocker.
*/
int blockerId = m_xSAXEventKeeper.addBlocker();
m_xSAXEventKeeper.setSecurityId(blockerId, m_nSecurityId);
-
+
XBlockerMonitor xBlockerMonitor = (XBlockerMonitor)UnoRuntime.queryInterface(
XBlockerMonitor.class, m_xReferenceResolvedListener);
xBlockerMonitor.setBlockerId(blockerId);
-
+
/*
* sets signature creation result listener.
*/
- XSignatureCreationResultBroadcaster xSignatureCreationResultBroadcaster =
+ XSignatureCreationResultBroadcaster xSignatureCreationResultBroadcaster =
(XSignatureCreationResultBroadcaster)UnoRuntime.queryInterface(
XSignatureCreationResultBroadcaster.class, m_xReferenceResolvedListener);
xSignatureCreationResultBroadcaster.addSignatureCreationResultListener(
@@ -120,15 +120,15 @@ class SignatureEntity extends SecurityEntity
{
e.printStackTrace();
}
-
+
}
else
{
m_nSignatureElementCollectorId = m_xSAXEventKeeper.addSecurityElementCollector(
ElementMarkPriority.BEFOREMODIFY, false);
-
+
m_xSAXEventKeeper.setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId);
-
+
try
{
/*
@@ -136,15 +136,15 @@ class SignatureEntity extends SecurityEntity
*/
Object signatureVerifier = m_xRemoteServiceManager.createInstanceWithContext(
TestTool.SIGNATUREVERIFIER_COMPONENT, m_xRemoteContext);
-
- m_xReferenceResolvedListener =
+
+ m_xReferenceResolvedListener =
(XReferenceResolvedListener)UnoRuntime.queryInterface(
- XReferenceResolvedListener.class, signatureVerifier);
-
+ XReferenceResolvedListener.class, signatureVerifier);
+
/*
* initializes the SignatureVerifier.
*/
- XInitialization xInitialization =
+ XInitialization xInitialization =
(XInitialization)UnoRuntime.queryInterface(
XInitialization.class, m_xReferenceResolvedListener);
Object args[]=new Object[5];
@@ -154,11 +154,11 @@ class SignatureEntity extends SecurityEntity
args[3] = m_xXMLSecurityContext;
args[4] = m_xXMLSignature;
xInitialization.initialize(args);
-
+
/*
* sets signature verify result listener.
*/
- XSignatureVerifyResultBroadcaster xSignatureVerifyResultBroadcaster =
+ XSignatureVerifyResultBroadcaster xSignatureVerifyResultBroadcaster =
(XSignatureVerifyResultBroadcaster)UnoRuntime.queryInterface(
XSignatureVerifyResultBroadcaster.class, m_xReferenceResolvedListener);
xSignatureVerifyResultBroadcaster.addSignatureVerifyResultListener(
@@ -174,7 +174,7 @@ class SignatureEntity extends SecurityEntity
/*
* configures the resolve listener for the signature template.
*/
- XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
+ XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
(XReferenceResolvedBroadcaster)UnoRuntime.queryInterface(
XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper);
xReferenceResolvedBroadcaster.addReferenceResolvedListener(
@@ -192,7 +192,7 @@ class SignatureEntity extends SecurityEntity
private boolean hasReference(String id)
{
boolean rc = false;
-
+
int length = m_vReferenceIds.size();
for (int i=0; i<length; ++i)
{
@@ -202,15 +202,15 @@ class SignatureEntity extends SecurityEntity
break;
}
}
-
+
return rc;
}
-
+
/**************************************************************************************
* protected methods
**************************************************************************************/
-
+
/*
* adds a new reference id.
*/
@@ -218,7 +218,7 @@ class SignatureEntity extends SecurityEntity
{
m_vReferenceIds.add(referenceId);
}
-
+
/*
* notifies how many reference in this signature.
*/
@@ -226,7 +226,7 @@ class SignatureEntity extends SecurityEntity
{
try
{
- XReferenceCollector xReferenceCollector =
+ XReferenceCollector xReferenceCollector =
(XReferenceCollector)UnoRuntime.queryInterface(
XReferenceCollector.class, m_xReferenceResolvedListener);
xReferenceCollector.setReferenceCount(m_vReferenceIds.size());
@@ -236,7 +236,7 @@ class SignatureEntity extends SecurityEntity
e.printStackTrace();
}
}
-
+
/*
* tries to add a reference to this signature.
*
@@ -251,25 +251,25 @@ class SignatureEntity extends SecurityEntity
protected boolean setReference(String id, boolean isExporting)
{
boolean rc = false;
-
+
if (hasReference(id))
{
int referenceId = m_xSAXEventKeeper.addSecurityElementCollector(
isExporting?
(ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY),
false );
-
+
m_xSAXEventKeeper.setSecurityId(referenceId, m_nSecurityId);
- XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
+ XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster =
(XReferenceResolvedBroadcaster)UnoRuntime.queryInterface(
XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper);
xReferenceResolvedBroadcaster.addReferenceResolvedListener(
referenceId, m_xReferenceResolvedListener);
-
+
try
{
- XReferenceCollector xReferenceCollector =
+ XReferenceCollector xReferenceCollector =
(XReferenceCollector)UnoRuntime.queryInterface(
XReferenceCollector.class, m_xReferenceResolvedListener);
xReferenceCollector.setReferenceId(referenceId);
@@ -278,7 +278,7 @@ class SignatureEntity extends SecurityEntity
{
e.printStackTrace();
}
-
+
rc = true;
}
diff --git a/xmlsecurity/tools/uno/TestTool.java b/xmlsecurity/tools/uno/TestTool.java
index 6c87b34bbb43..4be3370f59f6 100644
--- a/xmlsecurity/tools/uno/TestTool.java
+++ b/xmlsecurity/tools/uno/TestTool.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -27,8 +27,8 @@
package com.sun.star.xml.security.uno;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
@@ -93,7 +93,7 @@ import com.sun.star.xml.sax.XDocumentHandler;
import com.sun.star.xml.crypto.*;
import com.sun.star.xml.crypto.sax.*;
-
+
public class TestTool extends JFrame implements ActionListener
{
/*
@@ -104,7 +104,7 @@ public class TestTool extends JFrame implements ActionListener
public static String ENCRYPTOR_COMPONENT = "com.sun.star.xml.crypto.sax.Encryptor";
public static String DECRYPTOR_COMPONENT = "com.sun.star.xml.crypto.sax.Decryptor";
public static String SAXEVENTKEEPER_COMPONENT = "com.sun.star.xml.crypto.sax.SAXEventKeeper";
-
+
/*
* Java-based component names
*/
@@ -112,7 +112,7 @@ public class TestTool extends JFrame implements ActionListener
public static String XMLSIGNATURE_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.XMLSignature_JxsecImpl";
public static String XMLENCRYPTION_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.XMLEncryption_JxsecImpl";
public static String XMLDOCUMENTWRAPPER_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.XMLDocumentWrapper_JxsecImpl";
-
+
/*
* C-based component names
*/
@@ -120,19 +120,19 @@ public class TestTool extends JFrame implements ActionListener
public static String XMLSIGNATURE_COMPONENT_C = "com.sun.star.xml.crypto.XMLSignature";
public static String XMLENCRYPTION_COMPONENT_C = "com.sun.star.xml.crypto.XMLEncryption";
public static String XMLDOCUMENTWRAPPER_COMPONENT_C = "com.sun.star.xml.wrapper.XMLDocumentWrapper";
-
+
/* url resolver name */
public static String UNOURLRESOLVER = "com.sun.star.bridge.UnoUrlResolver";
-
+
/*
* connection URL
*/
private String m_unoURL = "uno:socket,host=localhost,port=2002;urp;StarOffice.ServiceManager";
-
+
/* key file */
private String m_javaTokenFile = null;
private String m_nssTokenPath = null;
-
+
/* User Interfaces */
private JButton m_goButton;
private JButton m_stepButton;
@@ -151,21 +151,21 @@ public class TestTool extends JFrame implements ActionListener
private JLabel m_saxChainLabel;
private JTextField m_saxEventText;
private JTable m_unsolvedReferenceTable;
-
+
/*
- * whether a batch file is running,
- * if so, no message box is popped up
+ * whether a batch file is running,
+ * if so, no message box is popped up
*/
private boolean m_bIsBatchRunning = false;
-
- /*
+
+ /*
* whether the UI needs to be updated.
* when user click the "go" button, the UI needs
* not to be updated step by step for performance
* reason
*/
private boolean m_bIsUIUpdateSuppressed = false;
-
+
/*
* three DOM tree adapter
*/
@@ -174,33 +174,33 @@ public class TestTool extends JFrame implements ActionListener
private DomToTreeModelAdapter m_rightTreeModelAdapter;
/*
- * the current directory, which reserves the default
+ * the current directory, which reserves the default
* location when user open/save a file.
*/
private File m_currentDirectory = null;
-
+
/*
* the log file
*/
private FileOutputStream m_logFileOutputStream = null;
-
+
/*
* the thread which is parsing the current XML
* file
*/
private ParsingThread m_parsingThread;
-
+
/*
* whether is exporting or importing
*/
private boolean m_bIsExporting;
-
+
/*
* whether java based component or c based component
* is used now
*/
private boolean m_bIsJavaBased;
-
+
/*
* XML security component interface
*/
@@ -221,10 +221,10 @@ public class TestTool extends JFrame implements ActionListener
* security framework controller
*/
private XMLSecurityFrameworkController m_xmlSecurityFrameworkController = null;
-
+
/* org.w3c.dom.Document */
private Document m_document;
-
+
/* represents whether "Go" or "Step" */
private boolean stepMode = true;
@@ -245,55 +245,55 @@ public class TestTool extends JFrame implements ActionListener
m_leftTreeModelAdapter = new DomToTreeModelAdapter(m_document);
m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_document);
m_rightTreeModelAdapter = new DomToTreeModelAdapter(m_document);
-
+
m_parsingThread = null;
-
+
m_leftTree.setModel(m_leftTreeModelAdapter);
m_middleTree.setModel(m_middleTreeModelAdapter);
m_rightTree.setModel(m_rightTreeModelAdapter);
}
-
+
/*
* constructs the user interface.
*/
private Container buildUI(int width, int height)
{
JPanel mainPanel = new JPanel();
-
+
int frameHeight = height-40;
int leftWindowWidth = (width-40)/3;
int middleWindowWidth = leftWindowWidth;
int rightWindowWidth = leftWindowWidth;
int leftPaneWidth = leftWindowWidth+middleWindowWidth;
int frameWidth = leftPaneWidth + rightWindowWidth;
-
+
/* Make a nice border */
EmptyBorder emptyBorder = new EmptyBorder(5,5,5,5);
BevelBorder bevelBorder = new BevelBorder(BevelBorder.LOWERED);
CompoundBorder compoundBorder = new CompoundBorder(emptyBorder,bevelBorder);
mainPanel.setBorder(new CompoundBorder(compoundBorder,emptyBorder));
-
+
/* Set up the tree */
m_leftTreeModelAdapter = new DomToTreeModelAdapter(m_document);
m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_document);
m_rightTreeModelAdapter = new DomToTreeModelAdapter(m_document);
-
+
m_leftTree = new JTree(m_leftTreeModelAdapter);
m_leftTextArea = new JTextArea();
m_middleTree = new JTree(m_middleTreeModelAdapter);
m_rightTree = new JTree(m_rightTreeModelAdapter);
-
+
ToolTipManager.sharedInstance().registerComponent(m_leftTree);
ToolTipManager.sharedInstance().registerComponent(m_middleTree);
ToolTipManager.sharedInstance().registerComponent(m_rightTree);
-
+
/* Builds left tab pane */
JScrollPane leftTreePane = new JScrollPane(m_leftTree);
JScrollPane leftTextPane = new JScrollPane(m_leftTextArea);
m_leftTabPane= new JTabbedPane();
m_leftTabPane.add("Tree View",leftTreePane);
m_leftTabPane.add("Text View",leftTextPane);
-
+
/* Builds middle tree pane */
JScrollPane middleTreePane = new JScrollPane(m_middleTree);
@@ -302,17 +302,17 @@ public class TestTool extends JFrame implements ActionListener
rightTreePane.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Result"),
BorderFactory.createEmptyBorder(8,8,8,8)));
-
- m_leftTabPane.setPreferredSize(
+
+ m_leftTabPane.setPreferredSize(
new Dimension( leftWindowWidth, frameHeight ));
- middleTreePane.setPreferredSize(
+ middleTreePane.setPreferredSize(
new Dimension( middleWindowWidth, frameHeight ));
- rightTreePane.setPreferredSize(
+ rightTreePane.setPreferredSize(
new Dimension( rightWindowWidth, frameHeight ));
/* Builds the SAX event text box */
m_saxEventText = new JTextField();
-
+
/* Builds the unsolved reference table */
m_unsolvedReferenceTable = new JTable(
new UnsolvedReferenceTableModel(this));
@@ -322,93 +322,93 @@ public class TestTool extends JFrame implements ActionListener
/* Builds the SAX chain information label */
m_saxChainLabel = new JLabel();
-
+
/* Builds the left pane */
JPanel tabPaneWithSaxEventPane = new JPanel();
tabPaneWithSaxEventPane.setLayout(new BorderLayout());
tabPaneWithSaxEventPane.add("Center",m_leftTabPane);
tabPaneWithSaxEventPane.add("South",new JScrollPane(m_saxEventText));
-
- JSplitPane leftPane =
+
+ JSplitPane leftPane =
new JSplitPane( JSplitPane.VERTICAL_SPLIT,
tabPaneWithSaxEventPane,
new JScrollPane(m_unsolvedReferenceTable));
leftPane.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Original"),
BorderFactory.createEmptyBorder(8,8,8,8)));
-
+
leftPane.setContinuousLayout( true );
leftPane.setDividerLocation( frameHeight*2/3 );
- leftPane.setPreferredSize(
+ leftPane.setPreferredSize(
new Dimension( leftWindowWidth, frameHeight ));
-
+
/* Builds the middle pane */
JPanel bufferNodeWithSaxChainPane = new JPanel();
bufferNodeWithSaxChainPane.setLayout(new BorderLayout());
bufferNodeWithSaxChainPane.add("Center",m_bufferNodeTextArea);
bufferNodeWithSaxChainPane.add("South",new JScrollPane(m_saxChainLabel));
-
- JSplitPane middlePane =
+
+ JSplitPane middlePane =
new JSplitPane( JSplitPane.VERTICAL_SPLIT,
middleTreePane,
new JScrollPane(bufferNodeWithSaxChainPane));
-
+
middlePane.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Insight SAXEventKeeper"),
BorderFactory.createEmptyBorder(8,8,8,8)));
-
+
middlePane.setContinuousLayout( true );
middlePane.setDividerLocation( frameHeight/2+5 );
- middlePane.setPreferredSize(
+ middlePane.setPreferredSize(
new Dimension( middleWindowWidth, frameHeight ));
/* Builds the whole frame pane */
- JSplitPane leftWithMiddlePane =
+ JSplitPane leftWithMiddlePane =
new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
leftPane,
middlePane );
leftWithMiddlePane.setContinuousLayout( true );
leftWithMiddlePane.setDividerLocation( leftWindowWidth );
- leftWithMiddlePane.setPreferredSize(
+ leftWithMiddlePane.setPreferredSize(
new Dimension( leftPaneWidth + 10, frameHeight+10 ));
-
- JSplitPane framePane =
+
+ JSplitPane framePane =
new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
leftWithMiddlePane,
rightTreePane );
-
-
+
+
framePane.setContinuousLayout( true );
framePane.setDividerLocation(leftPaneWidth+10 );
- framePane.setPreferredSize(
+ framePane.setPreferredSize(
new Dimension( frameWidth + 20, frameHeight+10 ));
-
+
/* Adds all GUI components to the main panel */
mainPanel.setLayout(new BorderLayout());
mainPanel.add("Center", framePane );
-
+
m_openButton = new JButton("Open...");
m_openButton.addActionListener(this);
-
+
m_goButton = new JButton("Go!");
m_goButton.addActionListener(this);
-
+
m_stepButton = new JButton("Step");
m_stepButton.addActionListener(this);
-
+
m_startButton = new JButton("Start");
m_startButton.addActionListener(this);
m_startButton.setEnabled(false);
-
+
m_isExportingButton = new JCheckBox("export, not import", true);
m_isJavaComponentButton = new JCheckBox("use java component", false);
-
+
m_saveButton = new JButton("Save...");
m_saveButton.addActionListener(this);
m_batchButton = new JButton("Batch...");
m_batchButton.addActionListener(this);
-
+
JPanel buttonPanel = new JPanel();
buttonPanel.add(m_batchButton);
buttonPanel.add(m_openButton);
@@ -418,11 +418,11 @@ public class TestTool extends JFrame implements ActionListener
buttonPanel.add(m_isExportingButton);
buttonPanel.add(m_isJavaComponentButton);
buttonPanel.add(m_saveButton);
-
+
mainPanel.add("South", buttonPanel);
-
+
enableGoButton(false);
-
+
return mainPanel;
}
@@ -434,7 +434,7 @@ public class TestTool extends JFrame implements ActionListener
m_goButton.setEnabled(enabled);
m_stepButton.setEnabled(enabled);
}
-
+
/*
* updates the unsolved reference information.
*/
@@ -442,7 +442,7 @@ public class TestTool extends JFrame implements ActionListener
{
m_unsolvedReferenceTable.setModel(new UnsolvedReferenceTableModel(this));
}
-
+
/*
* adjusts the view of the tree in order to make the
* particular Node into the focus tree leaf.
@@ -451,23 +451,23 @@ public class TestTool extends JFrame implements ActionListener
{
int i=0;
int currentLine = 0;
-
+
while (i<tree.getRowCount())
{
TreePath treePath = tree.getPathForRow(i);
tree.expandPath(treePath);
-
+
AdapterNode adapterNode = (AdapterNode)treePath.getLastPathComponent();
-
+
if (node == adapterNode.getNode())
{
tree.addSelectionPath(treePath);
currentLine = i;
}
-
+
++i;
}
-
+
tree.setCellRenderer(new XMLTreeCellRanderer(node));
tree.scrollRowToVisible(currentLine);
}
@@ -475,7 +475,7 @@ public class TestTool extends JFrame implements ActionListener
/******************************************************************************
* action listener related methods.
******************************************************************************/
-
+
/*
* reads in a document, either the document is a file or
* is a text paragraph.
@@ -493,7 +493,7 @@ public class TestTool extends JFrame implements ActionListener
else
{
String text = m_leftTextArea.getText();
-
+
try
{
parseStream(new ByteArrayInputStream(text.getBytes("UTF-8")));
@@ -502,11 +502,11 @@ public class TestTool extends JFrame implements ActionListener
{
e.printStackTrace();
}
-
+
m_leftTabPane.setSelectedIndex(0);
}
}
-
+
/*
* save the result tree to a file.
*/
@@ -514,10 +514,10 @@ public class TestTool extends JFrame implements ActionListener
{
saveFile();
}
-
+
/*
* selects a batch file to excute.
- */
+ */
private void openBatch()
{
File f = openFile();
@@ -534,21 +534,21 @@ public class TestTool extends JFrame implements ActionListener
{
enableGoButton(false);
m_parsingThread = null;
-
+
if (m_xmlSecurityFrameworkController != null)
{
m_xmlSecurityFrameworkController.endMission();
}
-
+
updatesUIs();
-
+
m_xmlSecurityFrameworkController = null;
freeComponents();
-
+
System.gc();
}
-
-
+
+
/******************************************************************************
* UNO component related methods
******************************************************************************/
@@ -562,7 +562,7 @@ public class TestTool extends JFrame implements ActionListener
{
m_unoURL = new String(unoUrlString);
}
-
+
try
{
m_xRemoteServiceManager = getRemoteServiceManager(m_unoURL);
@@ -572,7 +572,7 @@ public class TestTool extends JFrame implements ActionListener
e.printStackTrace();
}
}
-
+
/*
* creates UNO components.
*/
@@ -584,7 +584,7 @@ public class TestTool extends JFrame implements ActionListener
String XMLSignature_comp;
String XMLEncryption_comp;
String tokenPath;
-
+
if (m_bIsJavaBased)
{
SEInitializer_comp = SEINITIALIZER_COMPONENT_JAVA;
@@ -599,24 +599,24 @@ public class TestTool extends JFrame implements ActionListener
XMLEncryption_comp = XMLENCRYPTION_COMPONENT_C;
tokenPath = m_nssTokenPath;
}
-
+
Object seInitializerObj = m_xRemoteServiceManager.createInstanceWithContext(
SEInitializer_comp, m_xRemoteContext);
-
+
if (seInitializerObj == null)
{
freeComponents();
return false;
}
-
+
m_xSEInitializer = (XSEInitializer)UnoRuntime.queryInterface(
- XSEInitializer.class, seInitializerObj);
-
+ XSEInitializer.class, seInitializerObj);
+
m_xXMLSecurityContext = m_xSEInitializer.createSecurityContext(tokenPath);
-
+
Object xmlSignatureObj = m_xRemoteServiceManager.createInstanceWithContext(
XMLSignature_comp, m_xRemoteContext);
-
+
if (xmlSignatureObj == null)
{
freeComponents();
@@ -624,11 +624,11 @@ public class TestTool extends JFrame implements ActionListener
}
m_xXMLSignature = (XXMLSignature)UnoRuntime.queryInterface(
- XXMLSignature.class, xmlSignatureObj);
-
+ XXMLSignature.class, xmlSignatureObj);
+
Object xmlEncryptionObj = m_xRemoteServiceManager.createInstanceWithContext(
XMLEncryption_comp, m_xRemoteContext);
-
+
if (xmlEncryptionObj == null)
{
freeComponents();
@@ -636,8 +636,8 @@ public class TestTool extends JFrame implements ActionListener
}
m_xXMLEncryption = (XXMLEncryption)UnoRuntime.queryInterface(
- XXMLEncryption.class, xmlEncryptionObj);
-
+ XXMLEncryption.class, xmlEncryptionObj);
+
return true;
}
catch(Exception e)
@@ -647,7 +647,7 @@ public class TestTool extends JFrame implements ActionListener
return false;
}
}
-
+
/*
* frees UNO components.
*/
@@ -660,7 +660,7 @@ public class TestTool extends JFrame implements ActionListener
m_xSEInitializer.freeSecurityContext(m_xXMLSecurityContext);
m_xXMLSecurityContext = null;
}
-
+
m_xXMLSignature = null;
m_xXMLEncryption = null;
m_xSEInitializer = null;
@@ -670,13 +670,13 @@ public class TestTool extends JFrame implements ActionListener
e.printStackTrace();
}
}
-
+
/*
* getRemoteServiceManager
*/
- private XMultiComponentFactory getRemoteServiceManager(String unoUrl) throws java.lang.Exception
+ private XMultiComponentFactory getRemoteServiceManager(String unoUrl) throws java.lang.Exception
{
- if (m_xRemoteContext == null)
+ if (m_xRemoteContext == null)
{
/*
* First step: create local component context, get local servicemanager and
@@ -692,7 +692,7 @@ public class TestTool extends JFrame implements ActionListener
*/
XUnoUrlResolver xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(
XUnoUrlResolver.class, urlResolver );
-
+
/*
* Second step: use xUrlResolver interface to import the remote StarOffice.ServiceManager,
* retrieve its property DefaultContext and get the remote servicemanager
@@ -706,21 +706,21 @@ public class TestTool extends JFrame implements ActionListener
}
return m_xRemoteContext.getServiceManager();
}
-
+
/******************************************************************************
* XML related methods
******************************************************************************/
/*
- * removes all empty text node inside the particular element
+ * removes all empty text node inside the particular element
*/
private void removeEmptyText(Node node)
{
int type = node.getNodeType();
NodeList children;
int i;
-
+
switch (type)
{
case Node.DOCUMENT_NODE:
@@ -730,9 +730,9 @@ public class TestTool extends JFrame implements ActionListener
{
Node nextSibling = child.getNextSibling();
int childType = child.getNodeType();
-
+
if (childType==Node.TEXT_NODE)
- {
+ {
String message = child.getNodeValue().trim();
if (message == null || message.length()<=0)
{
@@ -743,7 +743,7 @@ public class TestTool extends JFrame implements ActionListener
{
removeEmptyText(child);
}
-
+
child = nextSibling;
}
break;
@@ -762,22 +762,22 @@ public class TestTool extends JFrame implements ActionListener
m_document = null;
m_startButton.setEnabled(false);
initUI();
-
+
/* factory.setValidating(true); */
/* factory.setNamespaceAware(true); */
-
- try
+
+ try
{
DocumentBuilder builder = factory.newDocumentBuilder();
m_document = builder.parse(is);
m_startButton.setEnabled(true);
initUI();
}
- catch (ParserConfigurationException pce)
+ catch (ParserConfigurationException pce)
{
pce.printStackTrace();
}
- catch (IOException ioe)
+ catch (IOException ioe)
{
ioe.printStackTrace();
}
@@ -792,7 +792,7 @@ public class TestTool extends JFrame implements ActionListener
/******************************************************************************
* file operation related methods
******************************************************************************/
-
+
/*
* opens a file, and parses it into the original tree.
*/
@@ -810,21 +810,21 @@ public class TestTool extends JFrame implements ActionListener
}
}
-
+
/*
* selects a file to open
*/
private File openFile()
{
File rc = null;
-
+
JFileChooser fileChooser= new JFileChooser();
-
+
fileChooser.setDialogTitle("Select File To Open");
fileChooser.setDialogType(JFileChooser.OPEN_DIALOG);
-
+
fileChooser.setApproveButtonText("Ok");
-
+
if (m_currentDirectory == null)
{
fileChooser.rescanCurrentDirectory();
@@ -833,7 +833,7 @@ public class TestTool extends JFrame implements ActionListener
{
fileChooser.setCurrentDirectory(m_currentDirectory);
}
-
+
fileChooser.setFileFilter(new XMLFileFilter());
int result = fileChooser.showDialog(this,null);
@@ -842,19 +842,19 @@ public class TestTool extends JFrame implements ActionListener
m_currentDirectory = fileChooser.getCurrentDirectory();
rc = fileChooser.getSelectedFile();
}
-
+
return rc;
}
-
+
private void saveFile()
{
JFileChooser fileChooser= new JFileChooser();
-
+
fileChooser.setDialogTitle("Select File To Save");
fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
-
+
fileChooser.setApproveButtonText("Ok");
-
+
if (m_currentDirectory == null)
{
fileChooser.rescanCurrentDirectory();
@@ -863,7 +863,7 @@ public class TestTool extends JFrame implements ActionListener
{
fileChooser.setCurrentDirectory(m_currentDirectory);
}
-
+
fileChooser.setFileFilter(new XMLFileFilter());
int result = fileChooser.showDialog(this,null);
@@ -888,20 +888,20 @@ public class TestTool extends JFrame implements ActionListener
private void runBatch(File f)
{
FileInputStream fis = null;
-
+
try
{
fis = new FileInputStream(f);
StringBuffer commandBuffer = new StringBuffer();
-
+
m_logFileOutputStream = new FileOutputStream("TestTool-log.txt");
m_bIsBatchRunning = true;
int ch = 0;
-
+
while (ch != -1)
{
ch = fis.read();
-
+
if (ch != 0x0a && ch != -1)
{
if (ch != 0x0d)
@@ -943,7 +943,7 @@ public class TestTool extends JFrame implements ActionListener
{
m_isExportingButton.setSelected(false);
}
-
+
startsUp();
if (m_parsingThread != null)
{
@@ -957,7 +957,7 @@ public class TestTool extends JFrame implements ActionListener
System.out.println("exception happen during batch:"+e);
e.printStackTrace();
}
-
+
m_bIsUIUpdateSuppressed = false;
updatesUIs();
}
@@ -970,15 +970,15 @@ public class TestTool extends JFrame implements ActionListener
saveFile(new File(fileName));
m_logFileOutputStream.write("command end \n\n".getBytes());
}
-
+
commandBuffer = new StringBuffer();
}
}
-
+
m_bIsBatchRunning = false;
m_logFileOutputStream.close();
m_logFileOutputStream = null;
-
+
fis.close();
fis = null;
}
@@ -1007,7 +1007,7 @@ public class TestTool extends JFrame implements ActionListener
/******************************************************************************
* others
******************************************************************************/
-
+
/*
* starts up the operation.
*/
@@ -1017,20 +1017,20 @@ public class TestTool extends JFrame implements ActionListener
{
m_parsingThread = null;
}
-
+
m_bIsExporting = m_isExportingButton.isSelected();
m_bIsJavaBased = m_isJavaComponentButton.isSelected();
-
+
if (createComponents())
{
m_rightTreeEventCollector = new SAXEventCollector(this);
-
+
m_parsingThread = new ParsingThread(
m_document,
null,
this);
-
- m_xmlSecurityFrameworkController =
+
+ m_xmlSecurityFrameworkController =
new XMLSecurityFrameworkController(
this,
m_bIsExporting,
@@ -1042,7 +1042,7 @@ public class TestTool extends JFrame implements ActionListener
m_xXMLEncryption,
m_xRemoteServiceManager,
m_xRemoteContext);
-
+
enableGoButton(true);
}
else
@@ -1050,15 +1050,15 @@ public class TestTool extends JFrame implements ActionListener
showMessage("Error in creating XML Security Components!");
}
}
-
+
/**************************************************************************************
* protected methods
**************************************************************************************/
-
+
/******************************************************************************
* UI related methods
******************************************************************************/
-
+
/*
* updates the sax chain information.
*/
@@ -1074,7 +1074,7 @@ public class TestTool extends JFrame implements ActionListener
{
m_saxEventText.setText(event);
}
-
+
/*
* updates all information in the UI.
*/
@@ -1084,7 +1084,7 @@ public class TestTool extends JFrame implements ActionListener
{
m_leftTree.clearSelection();
updatesTree(null, m_leftTree);
-
+
if (m_xmlSecurityFrameworkController != null)
{
String bufferNodeTreeText = m_xmlSecurityFrameworkController.getBufferNodeTreeInformation();
@@ -1097,7 +1097,7 @@ public class TestTool extends JFrame implements ActionListener
{
m_middleTreeEventCollector = new SAXEventCollector(null);
m_xmlSecurityFrameworkController.getDocument(m_middleTreeEventCollector);
-
+
m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_middleTreeEventCollector.getDocument());
m_middleTree.setModel(m_middleTreeModelAdapter);
updatesTree(null, m_middleTree);
@@ -1110,18 +1110,18 @@ public class TestTool extends JFrame implements ActionListener
m_middleTree.setVisible(false);
m_bufferNodeTextArea.setText("No XMLImporter/XMLExporter");
}
-
+
if (m_rightTreeEventCollector != null)
{
m_rightTreeModelAdapter = new DomToTreeModelAdapter((Document)m_rightTreeEventCollector.getDocument());
m_rightTree.setModel(m_rightTreeModelAdapter);
updatesTree((Node)m_rightTreeEventCollector.getCurrentElement(), m_rightTree);
}
-
+
updatesUnsolvedReferencesInformation();
}
}
-
+
/*
* shows a message.
*/
@@ -1135,7 +1135,7 @@ public class TestTool extends JFrame implements ActionListener
{
byte [] b = msg.getBytes();
m_logFileOutputStream.write(" ".getBytes());
-
+
for (int i=0; i<b.length; ++i)
{
m_logFileOutputStream.write(b[i]);
@@ -1162,7 +1162,7 @@ public class TestTool extends JFrame implements ActionListener
else
{
Object[] options = { "OK", "Go back to step mode" };
- if (1 == JOptionPane.showOptionDialog(this, msg, "TestTool Notification",
+ if (1 == JOptionPane.showOptionDialog(this, msg, "TestTool Notification",
JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE,
null, options, options[0]))
{
@@ -1185,7 +1185,7 @@ public class TestTool extends JFrame implements ActionListener
protected Vector getUnsolvedReferenceIds()
{
Vector rc;
-
+
if (m_xmlSecurityFrameworkController == null)
{
rc = new Vector();
@@ -1195,10 +1195,10 @@ public class TestTool extends JFrame implements ActionListener
rc = ((XMLSecurityFrameworkController)m_xmlSecurityFrameworkController).
getUnsolvedReferenceIds();
}
-
+
return rc;
}
-
+
/*
* gets all unsolved reference keeper ids.
* a reference keeper id is the id which the SAXEventKeeper uses
@@ -1207,7 +1207,7 @@ public class TestTool extends JFrame implements ActionListener
protected Vector getUnsolvedReferenceKeeperIds()
{
Vector rc;
-
+
if (m_xmlSecurityFrameworkController == null)
{
rc = new Vector();
@@ -1217,7 +1217,7 @@ public class TestTool extends JFrame implements ActionListener
rc = ((XMLSecurityFrameworkController)m_xmlSecurityFrameworkController).
getUnsolvedReferenceKeeperIds();
}
-
+
return rc;
}
@@ -1229,7 +1229,7 @@ public class TestTool extends JFrame implements ActionListener
protected Vector getUnsolvedReferenceRefNum()
{
Vector rc;
-
+
if (m_xmlSecurityFrameworkController == null)
{
rc = new Vector();
@@ -1239,7 +1239,7 @@ public class TestTool extends JFrame implements ActionListener
rc = ((XMLSecurityFrameworkController)m_xmlSecurityFrameworkController).
getUnsolvedReferenceRefNum();
}
-
+
return rc;
}
@@ -1272,7 +1272,7 @@ public class TestTool extends JFrame implements ActionListener
{
if (stepMode) break;
}
-
+
if (!notOver) endMission();
}
}
@@ -1299,14 +1299,14 @@ public class TestTool extends JFrame implements ActionListener
openBatch();
}
}
-
+
/*
* void-consturctor method
*/
public TestTool()
{
getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
-
+
try
{
m_currentDirectory = new File(System.getProperty("user.dir"));
@@ -1316,7 +1316,7 @@ public class TestTool extends JFrame implements ActionListener
System.out.println("getProperty error :"+e);
}
}
-
+
/*
* consturctor method with a specific connection URL
*/
@@ -1325,24 +1325,24 @@ public class TestTool extends JFrame implements ActionListener
this();
m_unoURL = new String(connecturl);
}
-
+
public static void main(String argv[])
{
- Dimension screenSize =
+ Dimension screenSize =
Toolkit.getDefaultToolkit().getScreenSize();
-
+
TestTool tt;
-
+
if (argv.length < 1)
{
System.out.println("Usage: java TestTool [javaTokenFile] [nssTokenPath] [xml file]?");
return;
}
-
+
boolean hasFile = false;
boolean hasBatch = false;
String fileName = null;
-
+
if (argv.length >= 3)
{
if (argv[2].startsWith("-b"))
@@ -1356,25 +1356,25 @@ public class TestTool extends JFrame implements ActionListener
hasFile = true;
}
}
-
+
tt = new TestTool();
tt.m_javaTokenFile = new String(argv[0]);
tt.m_nssTokenPath = new String(argv[1]);
tt.connectSO(null);
-
+
/* Set up a GUI framework */
JFrame myFrame = new JFrame("XML Security Components Tester");
myFrame.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
- }
+ }
);
-
+
myFrame.setContentPane(tt.buildUI(screenSize.width, screenSize.height));
myFrame.pack();
int w = screenSize.width-30;
int h = screenSize.height-30;
- myFrame.setLocation(screenSize.width/2 - w/2,
+ myFrame.setLocation(screenSize.width/2 - w/2,
screenSize.height/2 - h/2);
myFrame.setSize(w, h);
myFrame.setVisible(true);
diff --git a/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java b/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java
index 21f17de8877d..a5a38c3939b3 100644
--- a/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java
+++ b/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,39 +30,39 @@ package com.sun.star.xml.security.uno;
import javax.swing.table.AbstractTableModel;
/*
- * this class is used to maintain the unsolved reference
+ * this class is used to maintain the unsolved reference
* table.
*/
class UnsolvedReferenceTableModel extends AbstractTableModel
{
- private String[] m_columnNames = {"id",
+ private String[] m_columnNames = {"id",
"refNum",
"EC's id"};
-
+
private TestTool m_testTool;
-
+
UnsolvedReferenceTableModel(TestTool testTool)
{
m_testTool = testTool;
}
-
- public String getColumnName(int col)
- {
- return m_columnNames[col].toString();
+
+ public String getColumnName(int col)
+ {
+ return m_columnNames[col].toString();
}
-
- public int getRowCount()
+
+ public int getRowCount()
{
- return m_testTool.getUnsolvedReferenceIds().size();
+ return m_testTool.getUnsolvedReferenceIds().size();
}
-
- public int getColumnCount()
+
+ public int getColumnCount()
{
- return m_columnNames.length;
+ return m_columnNames.length;
}
-
- public Object getValueAt(int row, int col)
- {
+
+ public Object getValueAt(int row, int col)
+ {
if (col == 0)
{
return (String)m_testTool.getUnsolvedReferenceIds().elementAt(row);
@@ -80,10 +80,10 @@ class UnsolvedReferenceTableModel extends AbstractTableModel
return null;
}
}
-
+
public boolean isCellEditable(int row, int col)
{
- return false;
+ return false;
}
}
diff --git a/xmlsecurity/tools/uno/XMLFileFilter.java b/xmlsecurity/tools/uno/XMLFileFilter.java
index b9436cacfbda..765de1fc5935 100644
--- a/xmlsecurity/tools/uno/XMLFileFilter.java
+++ b/xmlsecurity/tools/uno/XMLFileFilter.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,31 +36,31 @@ import javax.swing.filechooser.FileFilter;
*/
class XMLFileFilter extends FileFilter
{
- public static String getExtension(File f)
+ public static String getExtension(File f)
{
String ext = null;
String s = f.getName();
int i = s.lastIndexOf('.');
-
+
if (i > 0 && i < s.length() - 1) {
ext = s.substring(i+1).toLowerCase();
}
-
+
return ext;
}
-
- public boolean accept(File f)
+
+ public boolean accept(File f)
{
boolean rc = false;
-
- if (f.isDirectory())
+
+ if (f.isDirectory())
{
rc = true;
}
else
{
String extension = getExtension(f);
- if (extension != null)
+ if (extension != null)
{
if (extension.equals("xml") || extension.equals("txt"))
{
@@ -68,10 +68,10 @@ class XMLFileFilter extends FileFilter
}
}
}
-
+
return rc;
}
-
+
public String getDescription()
{
return "XML and batch files (.xml,.txt)";
diff --git a/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java b/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java
index 058981b460b0..ed512ed083bc 100644
--- a/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java
+++ b/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@ import com.sun.star.xml.wrapper.*;
/*
* the XMLSecurityFrameworkController class is used to controll the xml security framework.
*/
-public class XMLSecurityFrameworkController
+public class XMLSecurityFrameworkController
implements XDocumentHandler, XSignatureCreationResultListener, XSignatureVerifyResultListener,
XEncryptionResultListener, XDecryptionResultListener, XSAXEventKeeperStatusChangeListener
{
@@ -55,7 +55,7 @@ public class XMLSecurityFrameworkController
*/
private XMultiComponentFactory m_xRemoteServiceManager;
private XComponentContext m_xRemoteContext;
-
+
/*
* xml security related UNO components
*/
@@ -65,62 +65,62 @@ public class XMLSecurityFrameworkController
private XXMLSecurityContext m_xXMLSecurityContext;
private XXMLSignature m_xXMLSignature;
private XXMLEncryption m_xXMLEncryption;
-
+
/*
* used to reserve the current SAX ancestor path
*/
private Stack m_currentPath;
-
+
/*
* maintains all SignatureEntities.
*/
private Vector m_signatureList;
-
+
/*
* maintains all EncryptionEntities.
*/
private Vector m_encryptionList;
-
+
/*
* maintains all unsolved reference Ids.
* These ids are strings which is the value of the id attribute
* of the referenced element.
*/
private Vector m_vUnsolvedReferenceIds;
-
+
/*
* maintains all unsolved reference keeper ids.
* The keeper id is used to uniquely identify a bufferred element
* by the SAXEventKeeper.
*/
private Vector m_vUnsolvedReferencedKeeperIds;
-
+
/*
- * maintains the left time that each unsolved reference can be
+ * maintains the left time that each unsolved reference can be
* claimed.
*/
private Vector m_vUnsolvedReferenceRefNum;
-
+
/*
* whether exporting or importing
*/
private boolean m_bIsExporting;
-
+
/*
* whether java or c
*/
private boolean m_bIsJavaBased;
-
+
/*
* whether the SAXEventKeeper is blocking
*/
private boolean m_bIsBlocking;
-
+
/*
* whether it is collecting a bufferred element
*/
private boolean m_bIsInsideCollectedElement;
-
+
/*
* whether a SAXEventKeeper is in the SAX chain
*/
@@ -130,7 +130,7 @@ public class XMLSecurityFrameworkController
* the ParsingThread used to parse the document
*/
private ParsingThread m_parsingThread;
-
+
/*
* the next document handler that will receives SAX events
* from the parsing thread.
@@ -139,18 +139,18 @@ public class XMLSecurityFrameworkController
* variable will be the xOutputHandler.
*/
private XDocumentHandler m_xExportHandler;
-
+
/*
* the TestTool used to feedback information
*/
private TestTool m_testTool;
-
+
/*
* for encryption target
*/
private boolean m_bIsEncryptionTarget;
private EncryptionEntity m_EncryptionForTarget;
-
+
XMLSecurityFrameworkController(
TestTool testTool,
boolean bIsExporting,
@@ -165,45 +165,45 @@ public class XMLSecurityFrameworkController
{
m_bIsExporting = bIsExporting;
m_bIsJavaBased = bIsJavaBased;
-
+
m_xOutputHandler = xOutputHandler;
m_xXMLSecurityContext = xXMLSecurityContext;
m_xXMLSignature = xXMLSignature;
m_xXMLEncryption = xXMLEncryption;
m_xRemoteServiceManager = xRemoteServiceManager;
m_xRemoteContext = xRemoteContext;
-
+
m_testTool = testTool;
m_parsingThread = parsingThread;
-
+
m_signatureList = new Vector();
m_encryptionList = new Vector();
-
+
m_vUnsolvedReferenceIds = new Vector();
m_vUnsolvedReferencedKeeperIds = new Vector();
m_vUnsolvedReferenceRefNum = new Vector();
-
+
m_xXMLDocumentWrapper = null;
m_xSAXEventKeeper = null;
-
+
m_bSAXEventKeeperIncluded = false;
m_bIsBlocking = false;
m_bIsInsideCollectedElement = false;
-
+
m_bIsEncryptionTarget = false;
m_EncryptionForTarget = null;
changeOutput();
-
+
m_currentPath = new Stack();
-
+
foundSecurityRelated();
}
-
+
/**************************************************************************************
* private methods
**************************************************************************************/
-
+
/*
* changes the output document handler.
*/
@@ -212,7 +212,7 @@ public class XMLSecurityFrameworkController
if (m_bIsExporting)
{
m_parsingThread.setHandler(this);
-
+
/*
* If the SAXEventKeeper is in the SAX chain, then redirects output
* to the SAXEventKeeper, otherwise, to the m_xOutputHandler
@@ -222,7 +222,7 @@ public class XMLSecurityFrameworkController
m_xExportHandler = (XDocumentHandler)UnoRuntime.queryInterface(
XDocumentHandler.class, m_xSAXEventKeeper);
m_xSAXEventKeeper.setNextHandler(m_xOutputHandler);
-
+
m_testTool.updatesSAXChainInformation("XMLExporter -> SAXEventKeeper -> SAXWriter");
}
else
@@ -248,14 +248,14 @@ public class XMLSecurityFrameworkController
m_xExportHandler = m_xOutputHandler;
}
}
-
+
/*
* handles the situation when a security related element is found.
* if the SAXEventKeeper is not initialized, then creates a
* SAXEventKeeper.
* the return value represents whether the SAXEventKeeper is newly
* created.
- */
+ */
private boolean foundSecurityRelated()
{
if (m_xSAXEventKeeper == null)
@@ -263,7 +263,7 @@ public class XMLSecurityFrameworkController
m_testTool.showMessage("Message from : "+
(m_bIsExporting?"XMLExporter":"XMLImporter")+
"\n\nA security related content found, a SAXEventKeeper is created.\n ");
-
+
m_bIsBlocking = false;
m_bIsInsideCollectedElement = false;
@@ -273,7 +273,7 @@ public class XMLSecurityFrameworkController
* creates an XMLDocumentWrapper component.
*/
Object xmlDocumentObj = null;
-
+
if (m_bIsJavaBased)
{
xmlDocumentObj = m_xRemoteServiceManager.createInstanceWithContext(
@@ -284,24 +284,24 @@ public class XMLSecurityFrameworkController
xmlDocumentObj = m_xRemoteServiceManager.createInstanceWithContext(
TestTool.XMLDOCUMENTWRAPPER_COMPONENT_C, m_xRemoteContext);
}
-
+
m_xXMLDocumentWrapper = (XXMLDocumentWrapper)UnoRuntime.queryInterface(
XXMLDocumentWrapper.class, xmlDocumentObj);
-
+
/*
* creates a SAXEventKeeper component.
*/
Object saxEventKeeperObj = m_xRemoteServiceManager.createInstanceWithContext(
TestTool.SAXEVENTKEEPER_COMPONENT, m_xRemoteContext);
- m_xSAXEventKeeper =
+ m_xSAXEventKeeper =
(XSecuritySAXEventKeeper)UnoRuntime.queryInterface(
- XSecuritySAXEventKeeper.class, saxEventKeeperObj);
-
+ XSecuritySAXEventKeeper.class, saxEventKeeperObj);
+
/*
* initializes the SAXEventKeeper component with the XMLDocumentWrapper component.
*/
- XInitialization xInitialization =
+ XInitialization xInitialization =
(XInitialization)UnoRuntime.queryInterface(
XInitialization.class, m_xSAXEventKeeper);
Object args[]=new Object[1];
@@ -312,18 +312,18 @@ public class XMLSecurityFrameworkController
{
e.printStackTrace();
}
-
+
/*
* configures the SAXEventKeeper's status change listener.
*/
- XSAXEventKeeperStatusChangeBroadcaster xSaxEventKeeperStatusChangeBroadcaster =
+ XSAXEventKeeperStatusChangeBroadcaster xSaxEventKeeperStatusChangeBroadcaster =
(XSAXEventKeeperStatusChangeBroadcaster)UnoRuntime.queryInterface(
- XSAXEventKeeperStatusChangeBroadcaster.class, m_xSAXEventKeeper);
+ XSAXEventKeeperStatusChangeBroadcaster.class, m_xSAXEventKeeper);
xSaxEventKeeperStatusChangeBroadcaster.addSAXEventKeeperStatusChangeListener(this);
}
-
+
boolean rc = !m_bSAXEventKeeperIncluded;
-
+
/*
* changes the export document handler.
*/
@@ -339,16 +339,16 @@ public class XMLSecurityFrameworkController
private void findKeyOrReference(SecurityEntity signatureEntity, String uriStr, boolean isFindingKey)
{
int i=0;
-
+
while (i<m_vUnsolvedReferenceIds.size())
{
String id = (String)m_vUnsolvedReferenceIds.elementAt(i);
-
+
if (id.equals(uriStr))
{
int refNum = ((Integer)m_vUnsolvedReferenceRefNum.elementAt(i)).intValue();
int keeperId = ((Integer)m_vUnsolvedReferencedKeeperIds.elementAt(i)).intValue();
-
+
if (isFindingKey)
{
/*
@@ -358,17 +358,17 @@ public class XMLSecurityFrameworkController
keeperId,
m_bIsExporting?
(ElementMarkPriority.BEFOREMODIFY):(ElementMarkPriority.AFTERMODIFY));
-
+
/*
* notifies the key keeper id.
*/
signatureEntity.setKeyId(cloneKeeperId);
-
+
/*
* sets the security id for the key.
*/
m_xSAXEventKeeper.setSecurityId(cloneKeeperId, signatureEntity.getSecurityId());
-
+
/*
* sets the resolve listener.
*/
@@ -385,15 +385,15 @@ public class XMLSecurityFrameworkController
* clones a new ElementCollector for the referenced element.
*/
int cloneKeeperId = m_xSAXEventKeeper.cloneElementCollector(
- keeperId,
+ keeperId,
m_bIsExporting?
(ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY));
-
+
/*
* sets the security id.
*/
m_xSAXEventKeeper.setSecurityId(cloneKeeperId, signatureEntity.getSecurityId());
-
+
/*
* sets the resolve listener.
*/
@@ -402,7 +402,7 @@ public class XMLSecurityFrameworkController
XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper);
xReferenceResolvedBroadcaster.addReferenceResolvedListener(cloneKeeperId,
signatureEntity.getReferenceListener());
-
+
try{
XReferenceCollector xReferenceCollector =
(XReferenceCollector)UnoRuntime.queryInterface(
@@ -414,7 +414,7 @@ public class XMLSecurityFrameworkController
e.printStackTrace();
}
}
-
+
/*
* if this unsolved reference reaches its max reference number, remove this reference
* from all vectors.
@@ -432,7 +432,7 @@ public class XMLSecurityFrameworkController
m_vUnsolvedReferenceRefNum.setElementAt(new Integer(refNum),(i));
++i;
}
-
+
/*
* If it is find a key, then no further search is needed, one
* signature has one key at most.
@@ -448,7 +448,7 @@ public class XMLSecurityFrameworkController
}
}
}
-
+
/*
* checks whether a startElement event represents any security related information.
* return true if this event can't be forwarded into the SAX chain.
@@ -456,7 +456,7 @@ public class XMLSecurityFrameworkController
private boolean checkSecurityElement(String localName, com.sun.star.xml.sax.XAttributeList xattribs)
{
boolean rc = false;
-
+
if (localName.equals("Signature"))
/*
* this element is a Signature element.
@@ -480,23 +480,23 @@ public class XMLSecurityFrameworkController
if (!m_currentPath.empty())
{
Object signedInfo = m_currentPath.pop();
-
+
if (!m_currentPath.empty())
{
Object objSignature = m_currentPath.peek();
-
+
if ((objSignature instanceof SignatureEntity) && signedInfo.toString().equals("SignedInfo"))
/*
* this element is a Reference element in a signature.
*/
{
String uriStr = xattribs.getValueByName("URI");
-
+
if (uriStr.charAt(0) == '#')
{
uriStr = uriStr.substring(1);
SignatureEntity signatureEntity = (SignatureEntity)objSignature;
-
+
if (uriStr != null && uriStr.length()>0)
{
signatureEntity.addReferenceId(uriStr);
@@ -509,7 +509,7 @@ public class XMLSecurityFrameworkController
}
m_currentPath.push(localName);
}
- else if(localName.equals("KeyValue") ||
+ else if(localName.equals("KeyValue") ||
localName.equals("KeyName") ||
localName.equals("X509Data") ||
localName.equals("EncryptedKey"))
@@ -517,11 +517,11 @@ public class XMLSecurityFrameworkController
if (!m_currentPath.empty())
{
Object keyInfo = m_currentPath.pop();
-
+
if (!m_currentPath.empty())
{
Object objSorE = m_currentPath.peek();
-
+
if ((objSorE instanceof SignatureEntity) && keyInfo.toString().equals("KeyInfo"))
/*
* this element is the key element of a signature.
@@ -541,7 +541,7 @@ public class XMLSecurityFrameworkController
}
m_currentPath.push(keyInfo);
}
-
+
m_currentPath.push(localName);
}
else if(localName.equals("RetrievalMethod"))
@@ -549,11 +549,11 @@ public class XMLSecurityFrameworkController
if (!m_currentPath.empty())
{
Object keyInfo = m_currentPath.pop();
-
+
if (!m_currentPath.empty())
{
Object objSorE = m_currentPath.peek();
-
+
if ((objSorE instanceof SignatureEntity) && keyInfo.toString().equals("KeyInfo"))
/*
* this element is the RetrievalMethod element in a signature,
@@ -562,7 +562,7 @@ public class XMLSecurityFrameworkController
{
String uriStr = xattribs.getValueByName("URI");
SignatureEntity signatureEntity = (SignatureEntity)objSorE;
-
+
if (uriStr != null && uriStr.length()>0)
{
signatureEntity.setKeyURI(uriStr);
@@ -577,7 +577,7 @@ public class XMLSecurityFrameworkController
{
String uriStr = xattribs.getValueByName("URI");
EncryptionEntity theEncryption = (EncryptionEntity)objSorE;
-
+
if (uriStr != null && uriStr.length()>0)
{
theEncryption.setKeyURI(uriStr);
@@ -603,9 +603,9 @@ public class XMLSecurityFrameworkController
m_xXMLEncryption,
m_xRemoteServiceManager,
m_xRemoteContext);
-
+
m_encryptionList.add(theEncryption);
-
+
if (m_bIsExporting)
{
m_currentPath.push(theEncryption);
@@ -622,7 +622,7 @@ public class XMLSecurityFrameworkController
{
theEncryption.setKeyId(0);
}
-
+
rc = true;
}
}
@@ -633,23 +633,23 @@ public class XMLSecurityFrameworkController
{
m_currentPath.push(localName);
}
-
+
return rc;
}
-
+
/*
* checks whether a startElement event is referenced by any security entity.
*/
private void checkReference(String localName, com.sun.star.xml.sax.XAttributeList xattribs, String id)
{
String refNumStr = xattribs.getValueByName("refNum");
-
+
if ( m_bIsEncryptionTarget )
{
m_EncryptionForTarget.setReference(m_bIsExporting);
m_bIsEncryptionTarget = false;
}
-
+
if (id != null && id.length()>0 )
/*
* only if this element has id attribute, then it can be referenced by
@@ -662,14 +662,14 @@ public class XMLSecurityFrameworkController
* referencing number to 999.
*/
int refNum = 999;
-
+
if (refNumStr != null && refNumStr.length()>0 )
{
refNum = new Integer(refNumStr).intValue();
}
-
+
int length;
-
+
/*
* searches the signature list to check whether any sigture has
* reference on this element.
@@ -678,18 +678,18 @@ public class XMLSecurityFrameworkController
for (int i=0; i<length; ++i)
{
SignatureEntity signatureEntity = (SignatureEntity)m_signatureList.elementAt(i);
-
+
if (signatureEntity.setReference(id, m_bIsExporting))
{
refNum--;
}
-
+
if (signatureEntity.setKey(id, m_bIsExporting))
{
refNum--;
}
}
-
+
/*
* searches the encryption list for reference.
*/
@@ -697,13 +697,13 @@ public class XMLSecurityFrameworkController
for (int i=0; i<length; ++i)
{
EncryptionEntity theEncryption = (EncryptionEntity)m_encryptionList.elementAt(i);
-
+
if (theEncryption.setKey(id, m_bIsExporting))
{
refNum--;
}
}
-
+
/*
* if the max referencing number is not reached, then add this element
* into the unsolved reference list.
@@ -711,7 +711,7 @@ public class XMLSecurityFrameworkController
if (refNum>0)
{
int keeperId;
-
+
if (localName.equals("EncryptedKey"))
{
keeperId = m_xSAXEventKeeper.addSecurityElementCollector(
@@ -726,14 +726,14 @@ public class XMLSecurityFrameworkController
(ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY),
false);
}
-
+
m_vUnsolvedReferenceIds.add(id);
m_vUnsolvedReferencedKeeperIds.add(new Integer(keeperId));
m_vUnsolvedReferenceRefNum.add(new Integer(refNum));
}
}
}
-
+
/*
* configures the output handler.
*/
@@ -742,12 +742,12 @@ public class XMLSecurityFrameworkController
m_xOutputHandler = handler;
changeOutput();
}
-
-
+
+
/**************************************************************************************
* protected methods
**************************************************************************************/
-
+
/*
* methods used to transfer unsolved reference information.
*/
@@ -755,7 +755,7 @@ public class XMLSecurityFrameworkController
{
return m_vUnsolvedReferenceIds;
}
-
+
protected Vector getUnsolvedReferenceKeeperIds()
{
return m_vUnsolvedReferencedKeeperIds;
@@ -765,7 +765,7 @@ public class XMLSecurityFrameworkController
{
return m_vUnsolvedReferenceRefNum;
}
-
+
protected String getBufferNodeTreeInformation()
{
if (m_xSAXEventKeeper != null)
@@ -777,7 +777,7 @@ public class XMLSecurityFrameworkController
return null;
}
}
-
+
protected void getDocument(XDocumentHandler handler)
{
if (m_xXMLDocumentWrapper != null)
@@ -792,7 +792,7 @@ public class XMLSecurityFrameworkController
}
}
}
-
+
protected void endMission()
{
while (m_signatureList.size()>0 || m_encryptionList.size()>0)
@@ -810,7 +810,7 @@ public class XMLSecurityFrameworkController
theEncryption.endMission();
}
}
-
+
while (m_vUnsolvedReferenceIds.size()>0)
{
int keeperId = ((Integer)m_vUnsolvedReferencedKeeperIds.elementAt(0)).intValue();
@@ -819,21 +819,21 @@ public class XMLSecurityFrameworkController
m_vUnsolvedReferencedKeeperIds.remove(0);
m_vUnsolvedReferenceRefNum.remove(0);
}
-
+
m_xSAXEventKeeper.setNextHandler(null);
-
- XSAXEventKeeperStatusChangeBroadcaster xSaxEventKeeperStatusChangeBroadcaster =
+
+ XSAXEventKeeperStatusChangeBroadcaster xSaxEventKeeperStatusChangeBroadcaster =
(XSAXEventKeeperStatusChangeBroadcaster)UnoRuntime.queryInterface(
- XSAXEventKeeperStatusChangeBroadcaster.class, m_xSAXEventKeeper);
+ XSAXEventKeeperStatusChangeBroadcaster.class, m_xSAXEventKeeper);
xSaxEventKeeperStatusChangeBroadcaster.addSAXEventKeeperStatusChangeListener(null);
-
+
m_xSAXEventKeeper = null;
m_xXMLDocumentWrapper = null;
m_xOutputHandler = null;
m_xXMLSecurityContext = null;
m_xXMLSignature = null;
m_xXMLEncryption = null;
-
+
m_xExportHandler = null;
m_parsingThread.setHandler(null);
}
@@ -854,7 +854,7 @@ public class XMLSecurityFrameworkController
{
e.printStackTrace();
}
-
+
}
public void endDocument()
@@ -867,7 +867,7 @@ public class XMLSecurityFrameworkController
e.printStackTrace();
}
}
-
+
public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs)
{
try{
@@ -876,10 +876,10 @@ public class XMLSecurityFrameworkController
{
idAttr = xattribs.getValueByName("Id");
}
-
+
boolean hasIdAttr = (idAttr != null && idAttr.length()>0 );
boolean needResend = false;
-
+
if (hasIdAttr ||
(str.equals("Signature")||str.equals("EncryptedData")))/* || str.equals("EncryptedKey"))) */
{
@@ -888,16 +888,16 @@ public class XMLSecurityFrameworkController
needResend = true;
}
}
-
+
boolean suppressToNext = checkSecurityElement(str, xattribs);
-
+
checkReference(str, xattribs, idAttr);
-
+
if (needResend)
{
m_xSAXEventKeeper.setNextHandler(null);
-
- XDocumentHandler saxEventKeeperHandler =
+
+ XDocumentHandler saxEventKeeperHandler =
(XDocumentHandler)UnoRuntime.queryInterface(
XDocumentHandler.class, m_xSAXEventKeeper);
saxEventKeeperHandler.startElement(str, xattribs);
@@ -920,7 +920,7 @@ public class XMLSecurityFrameworkController
if (!m_currentPath.empty())
{
Object obj = m_currentPath.pop();
-
+
if (obj.toString().equals("SignedInfo"))
{
if (!m_currentPath.empty())
@@ -939,7 +939,7 @@ public class XMLSecurityFrameworkController
}
}
-
+
try{
m_xExportHandler.endElement(str);
}
@@ -948,7 +948,7 @@ public class XMLSecurityFrameworkController
e.printStackTrace();
}
}
-
+
public void characters(String str)
{
try{
@@ -959,11 +959,11 @@ public class XMLSecurityFrameworkController
e.printStackTrace();
}
}
-
+
public void ignorableWhitespace(String str)
{
}
-
+
public void processingInstruction(String aTarget, String aData)
{
try{
@@ -975,12 +975,12 @@ public class XMLSecurityFrameworkController
}
}
- public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
+ public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator )
throws com.sun.star.xml.sax.SAXException
{
}
-
-
+
+
/*
* XSignatureCreationResultListener
*/
@@ -990,7 +990,7 @@ public class XMLSecurityFrameworkController
message += "A Signature is created:";
message += "\nSecurity Id = "+securityId;
message += "\nCreation result = "+((creationResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail");
-
+
m_testTool.showMessage("Message from : SignatureCreator\n\n"+message+"\n ");
}
@@ -1003,7 +1003,7 @@ public class XMLSecurityFrameworkController
message += "A Signature is verified:";
message += "\nSecurity Id = "+securityId;
message += "\nVerify result = "+((verifyResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail");
-
+
m_testTool.showMessage("Message from : SignatureVerifier\n\n"+message+"\n ");
}
@@ -1016,10 +1016,10 @@ public class XMLSecurityFrameworkController
message += "An EncryptedData is encrypted:";
message += "\nSecurity Id = "+securityId;
message += "\nEncrypt result = "+((encryptionResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail");
-
+
m_testTool.showMessage("Message from : Encryptor\n\n"+message+"\n ");
}
-
+
/*
* XDecryptionResultListener methods
*/
@@ -1029,10 +1029,10 @@ public class XMLSecurityFrameworkController
message += "An EncryptedData is decrypted:";
message += "\nSecurity Id = "+securityId;
message += "\nDecrypt result = "+((decryptionResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail");
-
+
m_testTool.showMessage("Message from : Decryptor\n\n"+message+"\n ");
}
-
+
/*
* XSAXEventKeeperStatusChangeListener methods
*/
@@ -1041,19 +1041,19 @@ public class XMLSecurityFrameworkController
m_testTool.showMessage("Message from : SAXEventKeeper\n\n"+
(isBlocking?"The SAX event stream is blocked.":"The SAX event stream is unblocked.")+
"\n ");
-
+
this.m_bIsBlocking = isBlocking;
}
-
+
public void collectionStatusChanged(boolean isInsideCollectedElement)
{
m_testTool.showMessage("Message from : SAXEventKeeper\n\n"+
(isInsideCollectedElement?"Begin to buffer data ...":"End of data bufferring.")+
"\n ");
-
+
/*
this.m_bIsInsideCollectedElement = isInsideCollectedElement;
-
+
if ( !m_bIsInsideCollectedElement && !m_bIsBlocking)
{
m_bSAXEventKeeperIncluded = false;
@@ -1065,7 +1065,7 @@ public class XMLSecurityFrameworkController
changeOutput();
*/
}
-
+
public void bufferStatusChanged(boolean isBufferEmpty)
{
m_testTool.showMessage("Message from : SAXEventKeeper\n\n"+
diff --git a/xmlsecurity/tools/uno/XMLTreeCellRanderer.java b/xmlsecurity/tools/uno/XMLTreeCellRanderer.java
index 77891a239853..567ba2111217 100644
--- a/xmlsecurity/tools/uno/XMLTreeCellRanderer.java
+++ b/xmlsecurity/tools/uno/XMLTreeCellRanderer.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -34,27 +34,27 @@ import java.awt.Component;
import javax.swing.JTree;
/*
- * a TreeCellRender which can show a graph on the current
+ * a TreeCellRender which can show a graph on the current
* tree node.
*/
-class XMLTreeCellRanderer extends DefaultTreeCellRenderer
+class XMLTreeCellRanderer extends DefaultTreeCellRenderer
{
/*
* the icon for the current Node
*/
private ImageIcon m_currentIcon;
-
+
/*
* the current Node
*/
private Node m_currentNode;
-
+
XMLTreeCellRanderer(Node currentNode)
{
m_currentNode = currentNode;
m_currentIcon = new ImageIcon("current.gif");
}
-
+
public Component getTreeCellRendererComponent(
JTree tree,
Object value,
@@ -62,14 +62,14 @@ class XMLTreeCellRanderer extends DefaultTreeCellRenderer
boolean expanded,
boolean leaf,
int row,
- boolean hasFocus)
+ boolean hasFocus)
{
super.getTreeCellRendererComponent(
tree, value, sel,
expanded, leaf, row,
hasFocus);
-
- if (((AdapterNode)value).getNode() == m_currentNode)
+
+ if (((AdapterNode)value).getNode() == m_currentNode)
{
setIcon(m_currentIcon);
setToolTipText("This is the current element.");
@@ -77,8 +77,8 @@ class XMLTreeCellRanderer extends DefaultTreeCellRenderer
else
{
setToolTipText(null); /* no tool tip */
- }
-
+ }
+
return this;
}
}
diff --git a/xmlsecurity/workben/signaturetest.cxx b/xmlsecurity/workben/signaturetest.cxx
index 32abb131d5cd..0d2e507d2925 100644
--- a/xmlsecurity/workben/signaturetest.cxx
+++ b/xmlsecurity/workben/signaturetest.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -69,16 +69,16 @@ using namespace ::com::sun::star;
void Main();
-#define TEXTFIELDWIDTH 80
-#define TEXTFIELDSTARTX 10
+#define TEXTFIELDWIDTH 80
+#define TEXTFIELDSTARTX 10
-#define EDITWIDTH 200
-#define EDITHEIGHT 20
+#define EDITWIDTH 200
+#define EDITHEIGHT 20
-#define FIXEDLINEHEIGHT 15
+#define FIXEDLINEHEIGHT 15
-#define BUTTONWIDTH 50
-#define BUTTONHEIGHT 22
+#define BUTTONWIDTH 50
+#define BUTTONHEIGHT 22
#define BUTTONSPACE 20
#define LISTBOXHEIGHT 120
@@ -141,32 +141,32 @@ class MyWin : public WorkWindow
private:
FixedLine maTokenLine;
CheckBox maCryptoCheckBox;
- FixedText maFixedTextTokenName;
- FileControl maEditTokenName;
+ FixedText maFixedTextTokenName;
+ FileControl maEditTokenName;
FixedLine maTest1Line;
- FixedText maFixedTextXMLFileName;
- FileControl maEditXMLFileName;
- FixedText maFixedTextBINFileName;
- FileControl maEditBINFileName;
- FixedText maFixedTextSIGFileName;
- FileControl maEditSIGFileName;
- PushButton maSignButton;
- PushButton maVerifyButton;
+ FixedText maFixedTextXMLFileName;
+ FileControl maEditXMLFileName;
+ FixedText maFixedTextBINFileName;
+ FileControl maEditBINFileName;
+ FixedText maFixedTextSIGFileName;
+ FileControl maEditSIGFileName;
+ PushButton maSignButton;
+ PushButton maVerifyButton;
FixedLine maTest2Line;
- FixedText maFixedTextDOCFileName;
- FileControl maEditDOCFileName;
- PushButton maDigitalSignaturesButton;
- PushButton maVerifyDigitalSignaturesButton;
+ FixedText maFixedTextDOCFileName;
+ FileControl maEditDOCFileName;
+ PushButton maDigitalSignaturesButton;
+ PushButton maVerifyDigitalSignaturesButton;
FixedLine maHintLine;
- FixedText maHintText;
+ FixedText maHintText;
- DECL_LINK( CryptoCheckBoxHdl, CheckBox* );
- DECL_LINK( SignButtonHdl, Button* );
- DECL_LINK( VerifyButtonHdl, Button* );
- DECL_LINK( DigitalSignaturesWithServiceHdl, Button* );
- DECL_LINK( VerifyDigitalSignaturesHdl, Button* );
- DECL_LINK( DigitalSignaturesWithTokenHdl, Button* );
- DECL_LINK( StartVerifySignatureHdl, void* );
+ DECL_LINK( CryptoCheckBoxHdl, CheckBox* );
+ DECL_LINK( SignButtonHdl, Button* );
+ DECL_LINK( VerifyButtonHdl, Button* );
+ DECL_LINK( DigitalSignaturesWithServiceHdl, Button* );
+ DECL_LINK( VerifyDigitalSignaturesHdl, Button* );
+ DECL_LINK( DigitalSignaturesWithTokenHdl, Button* );
+ DECL_LINK( StartVerifySignatureHdl, void* );
public:
MyWin( Window* pParent, WinBits nWinStyle );
@@ -296,7 +296,7 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
maTest2Line.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT );
maTest2Line.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Test Office Document" ) ) );
maTest2Line.Show();
-
+
nY += EDITHEIGHT*3/2;
@@ -342,13 +342,13 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
maEditDOCFileName.SetText( aNSSFolder + String( RTL_CONSTASCII_USTRINGPARAM( "demo-sample.sxw" ) ) );
maEditSIGFileName.SetText( aNSSFolder + String( RTL_CONSTASCII_USTRINGPARAM( "demo-result.xml" ) ) );
maEditTokenName.SetText( aNSSFolder );
-
+
#ifdef WNT
maEditTokenName.SetText( String() );
maEditTokenName.Disable();
maCryptoCheckBox.Disable();
-#endif
-
+#endif
+
}
IMPL_LINK( MyWin, CryptoCheckBoxHdl, CheckBox*, EMPTYARG )
@@ -369,25 +369,25 @@ IMPL_LINK( MyWin, CryptoCheckBoxHdl, CheckBox*, EMPTYARG )
IMPL_LINK( MyWin, DigitalSignaturesWithServiceHdl, Button*, EMPTYARG )
{
rtl::OUString aDocFileName = maEditDOCFileName.GetText();
- uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL(
+ uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL(
aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
- uno::Reference< security::XDocumentDigitalSignatures > xD(
+ uno::Reference< security::XDocumentDigitalSignatures > xD(
comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
if ( xD.is() )
xD->signDocumentContent( xStore, NULL );
-
+
return 0;
}
IMPL_LINK( MyWin, VerifyDigitalSignaturesHdl, Button*, EMPTYARG )
{
rtl::OUString aDocFileName = maEditDOCFileName.GetText();
- uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL(
+ uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL(
aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
- uno::Reference< security::XDocumentDigitalSignatures > xD(
+ uno::Reference< security::XDocumentDigitalSignatures > xD(
comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
if ( xD.is() )
{
@@ -404,10 +404,10 @@ IMPL_LINK( MyWin, VerifyDigitalSignaturesHdl, Button*, EMPTYARG )
aText += String( RTL_CONSTASCII_USTRINGPARAM( "valid" ) );
InfoBox( this, aText ).Execute();
}
-
+
}
-
+
return 0;
}
@@ -428,13 +428,13 @@ IMPL_LINK( MyWin, DigitalSignaturesWithTokenHdl, Button*, EMPTYARG )
return 0;
}
- uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL(
+ uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL(
aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
aSignaturesDialog.SetStorage( xStore );
aSignaturesDialog.Execute();
-
+
return 0;
}
@@ -471,15 +471,15 @@ IMPL_LINK( MyWin, SignButtonHdl, Button*, EMPTYARG )
sal_Int32 nSecurityId = aSignatureHelper.GetNewSecurityId();
aSignatureHelper.SetX509Certificate( nSecurityId, xCertToUse->getIssuerName(), bigIntegerToNumericString( xCertToUse->getSerialNumber() ) );
-
+
aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False );
aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True );
-
+
SvFileStream* pStream = new SvFileStream( aSIGFileName, STREAM_WRITE );
SvLockBytesRef xLockBytes = new SvLockBytes( pStream, TRUE );
uno::Reference< io::XOutputStream > xOutputStream = new utl::OOutputStreamHelper( xLockBytes );
bool bDone = aSignatureHelper.CreateAndWriteSignature( xOutputStream );
-
+
aSignatureHelper.EndMission();
if ( !bDone )
@@ -491,7 +491,7 @@ IMPL_LINK( MyWin, SignButtonHdl, Button*, EMPTYARG )
rtl::OUString aInfo( String( RTL_CONSTASCII_USTRINGPARAM( "Signature successfully created!\n\n" ) ) );
// aInfo += getSignatureInformationmations( aSignatureHelper.getAllSignatureInformation(), aSignatureHelper.GetSecurityEnvironment() );
-
+
InfoBox( this, aInfo ).Execute();
}
@@ -531,7 +531,7 @@ IMPL_LINK( MyWin, VerifyButtonHdl, Button*, EMPTYARG )
uno::Reference< io::XInputStream > xInputStream = new utl::OInputStreamHelper( xLockBytes, nBytes );
bool bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream );
xInputStream->closeInput();
-
+
aSignatureHelper.EndMission();
if ( !bDone )