diff options
Diffstat (limited to 'xmlsecurity')
197 files changed, 743 insertions, 2198 deletions
diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx index 42b0254306c2..7aa8a6192009 100644 --- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_xmlsecurity.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx index f2701c727e99..ade8fb78ecc0 100644 --- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,3 +31,4 @@ #ifdef PRECOMPILED_HEADERS #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/biginteger.hxx b/xmlsecurity/inc/xmlsecurity/biginteger.hxx index b77c7c3bb8c6..74d25bef987d 100644 --- a/xmlsecurity/inc/xmlsecurity/biginteger.hxx +++ b/xmlsecurity/inc/xmlsecurity/biginteger.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <sal/config.h> #include <rtl/ustring.hxx> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include "com/sun/star/uno/Sequence.h" rtl::OUString bigIntegerToNumericString( ::com::sun::star::uno::Sequence< sal_Int8 > serial ); @@ -41,3 +40,4 @@ rtl::OUString bigIntegerToNumericString( ::com::sun::star::uno::Sequence< sal_In #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx index fa259cadc647..867eee8997b1 100644 --- a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,7 +61,7 @@ private: SignatureInformations maCertsToIgnore; FixedText maHintFT; - SvxSimpleTable maCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + SvxSimpleTable maCertLB; // #i48648 now SvHeaderTabListBox PushButton maViewBtn; @@ -92,3 +93,4 @@ public: #endif // _XMLSECURITY_CERTIFICATECHOOSER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx index 622a912e788e..1734d69aeb4a 100644 --- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -113,7 +114,7 @@ public: class CertificateViewerDetailsTP : public CertificateViewerTP { private: - SvxSimpleTable maElementsLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + SvxSimpleTable maElementsLB; // #i48648 now SvHeaderTabListBox MultiLineEdit maElementML; Font maStdFont; Font maFixedWidthFont; @@ -163,3 +164,4 @@ public: #endif // _XMLSECURITY_CERTIFICATEVIEWER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/certvalidity.hxx b/xmlsecurity/inc/xmlsecurity/certvalidity.hxx index 20fb05579029..837d5c29786d 100644 --- a/xmlsecurity/inc/xmlsecurity/certvalidity.hxx +++ b/xmlsecurity/inc/xmlsecurity/certvalidity.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,3 +36,4 @@ rtl::OUString certificateValidityToOUString( ::sal_Int32 certValidity ) ; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx index 1acc3733e2d3..74a5b8073af6 100644 --- a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,7 +80,7 @@ private: FixedText maHintDocFT; FixedText maHintBasicFT; FixedText maHintPackageFT; - SvxSimpleTable maSignaturesLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + SvxSimpleTable maSignaturesLB; // #i48648 now SvHeaderTabListBox FixedImage maSigsValidImg; FixedInfo maSigsValidFI; FixedImage maSigsInvalidImg; @@ -148,3 +149,4 @@ public: #endif // _XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx index 14d6a160bd01..beb089060039 100644 --- a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx +++ b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -101,3 +102,5 @@ public: }; #endif // _XMLSECURITY_XMLSIGNATUREHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/global.hrc b/xmlsecurity/inc/xmlsecurity/global.hrc index 57a9a95e88b3..5ec98db80b1e 100644 --- a/xmlsecurity/inc/xmlsecurity/global.hrc +++ b/xmlsecurity/inc/xmlsecurity/global.hrc @@ -42,7 +42,6 @@ #define RID_XMLSECTP_MACROWARN 1009 #define RID_XMLSECTP_READONLY_CONFIG_TIP 1010 #define RID_XMLSECTP_LOCK 1011 -#define RID_XMLSECTP_LOCK_HC 1012 #define RID_XMLSECWB_NO_MOZILLA_PROFILE 1013 #endif diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx index 6ebab6d99265..da4a43e5cf60 100644 --- a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx +++ b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -137,7 +138,7 @@ class MacroSecurityTrustedSourcesTP : public MacroSecurityTP private: FixedLine maTrustCertFL; ReadOnlyImage maTrustCertROFI; - SvxSimpleTable maTrustCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + SvxSimpleTable maTrustCertLB; // #i48648 now SvHeaderTabListBox PushButton maAddCertPB; PushButton maViewCertPB; PushButton maRemoveCertPB; @@ -173,3 +174,4 @@ public: #endif // _XMLSECURITY_MACROSECURITY_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx index 345380835d70..fb1be3f86137 100644 --- a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx +++ b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -110,3 +111,4 @@ typedef ::std::vector< SignatureInformation > SignatureInformations; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx b/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx index 8e99a393ace2..2f7f969e6054 100644 --- a/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx +++ b/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/warnings.hxx b/xmlsecurity/inc/xmlsecurity/warnings.hxx index a8f0b033616d..8ac38118f4c0 100644 --- a/xmlsecurity/inc/xmlsecurity/warnings.hxx +++ b/xmlsecurity/inc/xmlsecurity/warnings.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx index 932c37f81252..d0d3bbe8d012 100644 --- a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx +++ b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -204,3 +205,5 @@ public: }; #endif // _XMLSECURITY_XMLSIGNATUREHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/prj/build.lst b/xmlsecurity/prj/build.lst index f480685a7dad..422f4a43b65d 100644 --- a/xmlsecurity/prj/build.lst +++ b/xmlsecurity/prj/build.lst @@ -1,4 +1,4 @@ -xs xmlsecurity : L10N:l10n xmloff unotools offapi unoil svx MOZ:moz SO:moz_prebuilt LIBXMLSEC:libxmlsec NSS:nss LIBXSLT:libxslt NEON:neon NULL +xs xmlsecurity : TRANSLATIONS:translations xmloff unotools offapi unoil svx MOZ:moz LIBXMLSEC:libxmlsec NSS:nss LIBXSLT:libxslt NEON:neon NULL xs xmlsecurity usr1 - all xs_mkout NULL xs xmlsecurity\inc nmake - all xs_inc NULL xs xmlsecurity\source\framework nmake - all xs_fw xs_inc NULL diff --git a/xmlsecurity/prj/d.lst b/xmlsecurity/prj/d.lst index 94967c20a2e8..69da448e7281 100644 --- a/xmlsecurity/prj/d.lst +++ b/xmlsecurity/prj/d.lst @@ -1,13 +1,13 @@ -mkdir: %COMMON_DEST%\bin%_EXT%\hid -..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid -..\%__SRC%\bin\xsec_fw.dll %_DEST%\bin%_EXT%\xsec_fw.dll -..\%__SRC%\bin\xsec_xmlsec.dll %_DEST%\bin%_EXT%\xsec_xmlsec.dll -..\%__SRC%\bin\xmlsecurity.dll %_DEST%\bin%_EXT%\xmlsecurity.dll -..\%__SRC%\lib\libxsec_fw.so %_DEST%\lib%_EXT%\libxsec_fw.so -..\%__SRC%\lib\libxsec_xmlsec.so %_DEST%\lib%_EXT%\libxsec_xmlsec.so -..\%__SRC%\lib\libxmlsecurity.so %_DEST%\lib%_EXT%\libxmlsecurity.so -..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\* -..\%__SRC%\bin\xmlsec*.res %_DEST%\bin%_EXT%\xmlsec*.res -..\%__SRC%\misc\xmlsecurity.component %_DEST%\xml%_EXT%\xmlsecurity.component -..\%__SRC%\misc\xsec_fw.component %_DEST%\xml%_EXT%\xsec_fw.component -..\%__SRC%\misc\xsec_xmlsec.component %_DEST%\xml%_EXT%\xsec_xmlsec.component +mkdir: %COMMON_DEST%\bin\hid +..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin\hid\*.hid +..\%__SRC%\bin\xsec_fw.dll %_DEST%\bin\xsec_fw.dll +..\%__SRC%\bin\xsec_xmlsec.dll %_DEST%\bin\xsec_xmlsec.dll +..\%__SRC%\bin\xmlsecurity.dll %_DEST%\bin\xmlsecurity.dll +..\%__SRC%\lib\libxsec_fw.so %_DEST%\lib\libxsec_fw.so +..\%__SRC%\lib\libxsec_xmlsec.so %_DEST%\lib\libxsec_xmlsec.so +..\%__SRC%\lib\libxmlsecurity.so %_DEST%\lib\libxmlsecurity.so +..\%__SRC%\lib\*.dylib %_DEST%\lib\* +..\%__SRC%\bin\xmlsec*.res %_DEST%\bin\xmlsec*.res +..\%__SRC%\misc\xmlsecurity.component %_DEST%\xml\xmlsecurity.component +..\%__SRC%\misc\xsec_fw.component %_DEST%\xml\xsec_fw.component +..\%__SRC%\misc\xsec_xmlsec.component %_DEST%\xml\xsec_xmlsec.component diff --git a/xmlsecurity/qa/certext/User_35_Root_11.crt b/xmlsecurity/qa/certext/User_35_Root_11.crt index 6902605756af..0092d16c7a60 100644 --- a/xmlsecurity/qa/certext/User_35_Root_11.crt +++ b/xmlsecurity/qa/certext/User_35_Root_11.crt @@ -23,14 +23,14 @@ Certificate: 55:9b:90:91:f4:ce:56:04:d5 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Key Usage: + X509v3 Key Usage: Digital Signature, Non Repudiation, Key Encipherment - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 91:47:AC:29:95:5D:EF:72:14:8F:82:45:07:E2:94:49:75:C6:7D:73 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 - X509v3 Subject Alternative Name: + X509v3 Subject Alternative Name: DNS:alt.openoffice.org, IP Address:192.168.7.1, IP Address:13:0:0:0:0:0:0:17, email:my@other.address, Registered ID:1.2.3.4, othername:<unsupported>, DirName:/C=DE/O=OpenOffice.org/OU=Development/CN=User 32 Root 11, URI:http://my.url.here/ Signature Algorithm: sha1WithRSAEncryption 6e:80:e6:1e:86:3d:d2:65:a6:17:fa:80:2d:2e:dc:85:32:05: diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx index d490e500b2c3..97c5c08864d6 100644 --- a/xmlsecurity/source/component/certificatecontainer.cxx +++ b/xmlsecurity/source/component/certificatecontainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,7 +46,7 @@ CertificateContainer::searchMap( const ::rtl::OUString & url, const ::rtl::OUStr ret = (sal_Bool) (*p).second.equals(certificate_name); if( ret ) break; - p++; + ++p; } return ret; @@ -134,7 +135,7 @@ CertificateContainer::impl_getStaticSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) { Sequence< ::rtl::OUString > aRet(1); - *aRet.getArray() = ::rtl::OUString::createFromAscii("com.sun.star.security.CertificateContainer"); + *aRet.getArray() = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.security.CertificateContainer")); return aRet; } @@ -144,7 +145,7 @@ CertificateContainer::impl_getStaticSupportedServiceNames( ) CertificateContainer::impl_getStaticImplementationName() throw(::com::sun::star::uno::RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.security.CertificateContainer"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.security.CertificateContainer")); } //------------------------------------------------------------------------- @@ -169,3 +170,4 @@ CertificateContainer::impl_createFactory( const Reference< XMultiServiceFactory return xReturn; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/component/certificatecontainer.hxx b/xmlsecurity/source/component/certificatecontainer.hxx index 3bf11cd55d92..abea11bf61f0 100644 --- a/xmlsecurity/source/component/certificatecontainer.hxx +++ b/xmlsecurity/source/component/certificatecontainer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,13 +35,9 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase2.hxx> -#ifndef _XCERTIFICATECONTAINER_HPP_ #include <com/sun/star/security/XCertificateContainer.hpp> -#endif -#ifndef _CERTIFICATECONTAINERSTATUS_HPP_ #include <com/sun/star/security/CertificateContainerStatus.hpp> -#endif #include <vector> @@ -97,3 +94,4 @@ class CertificateContainer : public ::cppu::WeakImplHelper2< ::com::sun::star::l #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 0c8250848efa..b503a391aff5 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -319,7 +320,7 @@ DocumentDigitalSignatures::ImplVerifySignatures( if (!rSigInfo.Signer.is()) rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) ); - // --> PB 2004-12-14 #i38744# time support again + // Time support again (#i38744#) Date aDate( rInfo.stDateTime.Day, rInfo.stDateTime.Month, rInfo.stDateTime.Year ); Time aTime( rInfo.stDateTime.Hours, rInfo.stDateTime.Minutes, rInfo.stDateTime.Seconds, rInfo.stDateTime.HundredthSeconds ); @@ -339,7 +340,7 @@ DocumentDigitalSignatures::ImplVerifySignatures( rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer, Sequence<Reference<css::security::XCertificate> >()); } catch (SecurityException& ) { - OSL_ENSURE(0, "Verification of certificate failed"); + OSL_FAIL("Verification of certificate failed"); rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID; } } @@ -439,8 +440,6 @@ void DocumentDigitalSignatures::showCertificate( ::ucbhelper::ContentBroker* pBroker = NULL; //warning free code - //if ( aLocObj.GetProtocol() == INET_PROT_FILE && ( pBroker = ::ucbhelper::ContentBroker::get() ) ) - // xContentProvider = pBroker->getContentProviderInterface(); if ( aLocObj.GetProtocol() == INET_PROT_FILE) { pBroker = ::ucbhelper::ContentBroker::get(); @@ -514,3 +513,4 @@ Reference< XInterface > DocumentDigitalSignatures_CreateInstance( return (cppu::OWeakObject*) new DocumentDigitalSignatures( rCtx ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/component/documentdigitalsignatures.hxx b/xmlsecurity/source/component/documentdigitalsignatures.hxx index 1102c65b43cb..3525370d10b5 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.hxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,5 @@ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL Docum const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rCtx) throw ( com::sun::star::uno::Exception ); #endif // _XMLSECURITY_DOCUMENTDIGITALSIGNATURES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/component/registerservices.cxx b/xmlsecurity/source/component/registerservices.cxx index 0f6efeff05ce..0681a853744f 100644 --- a/xmlsecurity/source/component/registerservices.cxx +++ b/xmlsecurity/source/component/registerservices.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,12 +42,12 @@ using namespace ::com::sun::star; extern "C" { -void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void* pRet = 0; uno::Reference< XInterface > xFactory; @@ -86,3 +87,4 @@ void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pService +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 9e934d4e04f8..873c537399ab 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -187,7 +188,7 @@ void CertificateChooser::ImplInitialize() sEntry += '\t'; sEntry += XmlSec::GetDateString( maCerts[ nC ]->getNotValidAfter() ); SvLBoxEntry* pEntry = maCertLB.InsertEntry( sEntry ); - pEntry->SetUserData( ( void* )nC ); // missuse user data as index + pEntry->SetUserData( ( void* )(sal_IntPtr)nC ); // missuse user data as index } // enable/disable buttons @@ -236,3 +237,4 @@ void CertificateChooser::ImplShowCertificateDetails() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 3b38045938f2..b12169eb06dc 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -119,24 +120,18 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) ) ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) ) { - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - maKeyImg.SetImage( Image( XMLSEC_RES( IMG_KEY_HC ) ) ); - //Verify the certificate sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(mpDlg->mxCert, Sequence<Reference<css::security::XCertificate> >()); bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; - bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); if ( !bCertValid ) { maCertImg.SetImage( - Image( XMLSEC_RES( bHC ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) ); + Image( XMLSEC_RES( IMG_STATE_NOT_VALIDATED ) ) ); maHintNotTrustedFI.SetText( String( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) ) ); } - else if ( bHC ) - maCertImg.SetImage( Image( XMLSEC_RES( IMG_STATE_CERIFICATED_HC ) ) ); FreeResource(); @@ -290,10 +285,9 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif const char* pHexSep = " "; String aLBEntry; String aDetails; - // --> PB 2004-10-11 #i35107# - 0 == "V1", 1 == "V2", ..., n = "V(n+1)" + // Certificate Versions are reported wrong (#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(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); @@ -305,12 +299,6 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif aLBEntry = pairIssuer.first; aDetails = pairIssuer.second; InsertElement( String( XMLSEC_RES( STR_ISSUER ) ), aLBEntry, aDetails ); - /* - aSeq = xCert->getIssuerUniqueID(); - aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); - aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); - InsertElement( String( XMLSEC_RES( STR_ISSUER_ID ) ), aLBEntry, aDetails, true ); - */ DateTime aDateTime; utl::typeConvert( xCert->getNotValidBefore(), aDateTime ); @@ -329,12 +317,7 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif aLBEntry = pairSubject.first; aDetails = pairSubject.second; InsertElement( String( XMLSEC_RES( STR_SUBJECT ) ), aLBEntry, aDetails ); - /* - aSeq = xCert->getSubjectUniqueID(); - aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); - aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); - InsertElement( String( XMLSEC_RES( STR_SUBJECT_ID ) ), aLBEntry, aDetails, true ); - */ + aLBEntry = aDetails = xCert->getSubjectPublicKeyAlgorithm(); InsertElement( String( XMLSEC_RES( STR_SUBJECT_PUBKEY_ALGO ) ), aLBEntry, aDetails ); aSeq = xCert->getSubjectPublicKeyValue(); @@ -419,12 +402,6 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, Cert ,msCertNotValidated ( XMLSEC_RES( STR_PATH_CERT_NOT_VALIDATED ) ) { - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - { - maCertImage = Image( XMLSEC_RES( IMG_CERT_SMALL_HC ) ); - maCertNotValidatedImage = Image( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL_HC ) ); - } - FreeResource(); maCertPathLB.SetNodeDefaultImages(); @@ -548,3 +525,4 @@ SvLBoxEntry* CertificateViewerCertPathTP::InsertCert( return pEntry; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src index 637d3a7f45fe..88fed2fa1865 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.src +++ b/xmlsecurity/source/dialogs/certificateviewer.src @@ -174,21 +174,6 @@ TabPage RID_XMLSECTP_GENERAL ImageBitmap = Bitmap { File = "notcertificate_40x56.png"; }; MaskColor = STD_MASKCOLOR; }; - Image IMG_STATE_CERIFICATED_HC - { - ImageBitmap = Bitmap { File = "certificate_40x56_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; - Image IMG_STATE_NOT_VALIDATED_HC - { - ImageBitmap = Bitmap { File = "notcertificate_40x56_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; - Image IMG_KEY_HC - { - ImageBitmap = Bitmap { File = "key_12_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; }; TabPage RID_XMLSECTP_DETAILS @@ -324,21 +309,11 @@ TabPage RID_XMLSECTP_CERTPATH ImageBitmap = Bitmap { File = "certificate_16.png"; }; MaskColor = STD_MASKCOLOR; }; - Image IMG_CERT_SMALL_HC - { - ImageBitmap = Bitmap { File = "certificate_16_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; Image IMG_CERT_NOTVALIDATED_SMALL { ImageBitmap = Bitmap { File = "notcertificate_16.png"; }; MaskColor = STD_MASKCOLOR; }; - Image IMG_CERT_NOTVALIDATED_SMALL_HC - { - ImageBitmap = Bitmap { File = "notcertificate_16_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; String STR_PATH_CERT_OK { Text [ en-US ] = "The certificate is OK."; diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc index b30eb9198e32..e8f144577451 100644 --- a/xmlsecurity/source/dialogs/dialogs.hrc +++ b/xmlsecurity/source/dialogs/dialogs.hrc @@ -82,30 +82,21 @@ #define FI_STATE_BROKEN 10 #define IMG_STATE_NOTVALIDATED 11 #define FI_STATE_NOTVALIDATED 12 -#define IMG_STATE_VALID_HC 13 -#define IMG_STATE_BROKEN_HC 14 -#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 @@ -175,9 +166,6 @@ #define FI_CORRPRIVKEY 14 #define STR_CERTIFICATE_NOT_VALIDATED 15 #define IMG_STATE_NOT_VALIDATED 16 -#define IMG_STATE_CERIFICATED_HC 17 -#define IMG_STATE_NOT_VALIDATED_HC 18 -#define IMG_KEY_HC 19 #define IMG1_WIDTH 33 #define IMG1_HEIGHT 22 @@ -237,9 +225,7 @@ #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 -#define IMG_CERT_NOTVALIDATED_SMALL_HC 7 #define STR_PATH_CERT_OK 8 #define STR_PATH_CERT_NOT_VALIDATED 9 @@ -250,8 +236,6 @@ #define CVP_ROW_3 (CVP_ROW_2+RSC_CD_PUSHBUTTON_HEIGHT) #define CVP_ROW_4 (CVP_ROW_3+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) -//#define CV_ROW_0A (CV_ROW_0+RSC_SP_CTRL_DESC_Y+RSC_CD_FIXEDTEXT_HEIGHT) -//#define CV_ROW_2A (CV_ROW_2+RSC_SP_CTRL_DESC_Y+RSC_CD_FIXEDTEXT_HEIGHT) // --------- tab dialog macro security --------- diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 51f9924a61ed..a40e1626404e 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -210,7 +211,6 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( { // --> PB #i48253 the tablistbox needs its own unique id maSignaturesLB.Window::SetUniqueId( HID_XMLSEC_TREE_SIGNATURESDLG ); - // <-- Size aControlSize( maSignaturesLB.GetSizePixel() ); aControlSize = maSignaturesLB.PixelToLogic( aControlSize, MapMode( MAP_APPFONT ) ); const long nControlWidth = aControlSize.Width(); @@ -220,14 +220,6 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( maSigsNotvalidatedFI.SetText( String( XMLSEC_RES( STR_NO_INFO_TO_VERIFY ) ) ); - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - { - // high contrast mode needs other images - maSigsValidImg.SetImage( Image( XMLSEC_RES( IMG_STATE_VALID_HC ) ) ); - maSigsInvalidImg.SetImage( Image( XMLSEC_RES( IMG_STATE_BROKEN_HC ) ) ); - maSigsNotvalidatedImg.SetImage( Image( XMLSEC_RES( IMG_STATE_NOTVALIDATED_HC ) ) ); - } - FreeResource(); mbVerifySignatures = true; @@ -398,8 +390,8 @@ IMPL_LINK( DigitalSignaturesDialog, OKButtonHdl, void*, EMPTYARG ) uno::Reference< com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler = maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); - int nInfos = maCurrentSignatureInformations.size(); - for( int n = 0 ; n < nInfos ; ++n ) + size_t nInfos = maCurrentSignatureInformations.size(); + for( size_t n = 0 ; n < nInfos ; ++n ) maSignatureHelper.ExportSignature( xDocumentHandler, maCurrentSignatureInformations[ n ] ); @@ -451,7 +443,7 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) rtl::OUString aCertSerial = xSerialNumberAdapter->toString( xCert->getSerialNumber() ); if ( !aCertSerial.getLength() ) { - DBG_ERROR( "Error in Certificate, problem with serial number!" ); + OSL_FAIL( "Error in Certificate, problem with serial number!" ); return -1; } @@ -492,8 +484,8 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); // Export old signatures... - int nInfos = maCurrentSignatureInformations.size(); - for ( int n = 0; n < nInfos; n++ ) + size_t nInfos = maCurrentSignatureInformations.size(); + for ( size_t n = 0; n < nInfos; n++ ) maSignatureHelper.ExportSignature( xDocumentHandler, maCurrentSignatureInformations[n]); // Create a new one... @@ -526,7 +518,7 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) } catch ( uno::Exception& ) { - DBG_ERROR( "Exception while adding a signature!" ); + OSL_FAIL( "Exception while adding a signature!" ); // Don't keep invalid entries... ImplGetSignatureInformations(true); ImplFillSignaturesBox(); @@ -554,8 +546,8 @@ IMPL_LINK( DigitalSignaturesDialog, RemoveButtonHdl, Button*, EMPTYARG ) Reference< css::xml::sax::XDocumentHandler> xDocumentHandler = maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); - int nInfos = maCurrentSignatureInformations.size(); - for( int n = 0 ; n < nInfos ; ++n ) + size_t nInfos = maCurrentSignatureInformations.size(); + for( size_t n = 0 ; n < nInfos ; ++n ) maSignatureHelper.ExportSignature( xDocumentHandler, maCurrentSignatureInformations[ n ] ); maSignatureHelper.CloseDocumentHandler( xDocumentHandler); @@ -568,7 +560,7 @@ IMPL_LINK( DigitalSignaturesDialog, RemoveButtonHdl, Button*, EMPTYARG ) } catch ( uno::Exception& ) { - DBG_ERROR( "Exception while removing a signature!" ); + OSL_FAIL( "Exception while removing a signature!" ); // Don't keep invalid entries... ImplGetSignatureInformations(true); ImplFillSignaturesBox(); @@ -594,13 +586,13 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() uno::Reference< ::com::sun::star::security::XCertificate > xCert; String aNullStr; - int nInfos = maCurrentSignatureInformations.size(); - int nValidSigs = 0, nValidCerts = 0; + size_t nInfos = maCurrentSignatureInformations.size(); + size_t nValidSigs = 0, nValidCerts = 0; bool bAllNewSignatures = true; if( nInfos ) { - for( int n = 0; n < nInfos; ++n ) + for( size_t n = 0; n < nInfos; ++n ) { DocumentSignatureAlgorithm mode = DocumentSignatureHelper::getDocumentAlgorithm( m_sODFVersion, maCurrentSignatureInformations[n]); @@ -647,13 +639,13 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() nValidCerts++; } catch (css::uno::SecurityException& ) { - OSL_ENSURE(0, "Verification of certificate failed"); + OSL_FAIL("Verification of certificate failed"); bCertValid = false; } aSubject = XmlSec::GetContentPart( xCert->getSubjectName() ); aIssuer = XmlSec::GetContentPart( xCert->getIssuerName() ); - // --> PB 2004-10-12 #i20172# String with date and time information + // String with date and time information (#i20172#) aDateTimeStr = XmlSec::GetDateTimeString( rInfo.stDateTime ); } bSigValid = ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ); @@ -694,7 +686,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() else if (meSignatureMode == SignatureModeMacros && bSigValid && bCertValid) { - aImage = aImage = maSigsValidImg.GetImage(); + aImage = maSigsValidImg.GetImage(); } SvLBoxEntry* pEntry = maSignaturesLB.InsertEntry( aNullStr, aImage, aImage ); @@ -844,3 +836,4 @@ SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream( return aHelper; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src index 54ef5ce17eeb..16b2219d7f08 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src @@ -181,21 +181,6 @@ ModalDialog RID_XMLSECDLG_DIGSIG Pos = MAP_APPFONT( 6, 171 ); Size = MAP_APPFONT( 50, 14 ); }; - Image IMG_STATE_VALID_HC - { - ImageBitmap = Bitmap { File = "signet_11x16_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; - Image IMG_STATE_BROKEN_HC - { - ImageBitmap = Bitmap { File = "caution_11x16_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; - Image IMG_STATE_NOTVALIDATED_HC - { - ImageBitmap = Bitmap { File = "notcertificate_16_h.png"; }; - MaskColor = STD_MASKCOLOR; - }; }; diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 6e9498c264b5..90c7179e9c64 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,7 +139,7 @@ MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pD pCheck->Check(); else { - DBG_ERROR("illegal macro security level"); + OSL_FAIL("illegal macro security level"); } maSecReadonlyFI.Show(bReadonly); if(bReadonly) @@ -281,7 +282,7 @@ IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, void*, EMPTYARG ) if( nSel != LISTBOX_ENTRY_NOTFOUND ) { maTrustFileLocLB.RemoveEntry( nSel ); - // --> PB 2004-09-21 #i33584# + // Trusted Path could not be removed (#i33584#) // after remove an entry, select another one if exists sal_uInt16 nNewCount = maTrustFileLocLB.GetEntryCount(); if ( nNewCount > 0 ) @@ -290,7 +291,6 @@ IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, void*, EMPTYARG ) nSel = nNewCount - 1; maTrustFileLocLB.SelectEntryPos( nSel ); } - // <-- ImplCheckButtons(); } @@ -328,7 +328,7 @@ 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_IntPtr)nEntry ); // missuse user data as index } } } @@ -370,8 +370,6 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent, mbAuthorsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS ); maTrustCertROFI.Show( mbAuthorsReadonly ); mbAuthorsReadonly ? maTrustCertLB.DisableTable() : maTrustCertLB.EnableTable(); -// unused button -// maAddCertPB.Enable( !mbAuthorsReadonly ); FillCertLB(); @@ -411,33 +409,24 @@ void MacroSecurityTrustedSourcesTP::ClosePage( void ) mpDlg->maSecOptions.SetSecureURLs( aSecureURLs ); } - // --> PB 2004-09-21 #i33584# + // Trusted Path could not be removed (#i33584#) // don't forget to remove the old saved SecureURLs else mpDlg->maSecOptions.SetSecureURLs( cssu::Sequence< rtl::OUString >() ); - // <-- mpDlg->maSecOptions.SetTrustedAuthors( maTrustedAuthors ); } -/*-- 26.02.2004 13:31:04--------------------------------------------------- - -----------------------------------------------------------------------*/ ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) : FixedImage(pParent, rResId) { - sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode(); - SetImage( Image(XMLSEC_RES( bHighContrast ? RID_XMLSECTP_LOCK_HC : RID_XMLSECTP_LOCK ))); + SetImage( Image(XMLSEC_RES( RID_XMLSECTP_LOCK ))); } -/*-- 26.02.2004 13:31:04--------------------------------------------------- - - -----------------------------------------------------------------------*/ ReadOnlyImage::~ReadOnlyImage() { } -/*-- 26.02.2004 13:31:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void ReadOnlyImage::RequestHelp( const HelpEvent& rHEvt ) { if( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() ) @@ -457,12 +446,10 @@ void ReadOnlyImage::RequestHelp( const HelpEvent& rHEvt ) Window::RequestHelp( rHEvt ); } -/*-- 26.02.2004 14:20:21--------------------------------------------------- - - -----------------------------------------------------------------------*/ const String& ReadOnlyImage::GetHelpTip() { static String aStr(XMLSEC_RES( RID_XMLSECTP_READONLY_CONFIG_TIP)); return aStr; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/macrosecurity.src b/xmlsecurity/source/dialogs/macrosecurity.src index 5a4ab4f12b10..c86da19e510c 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.src +++ b/xmlsecurity/source/dialogs/macrosecurity.src @@ -239,12 +239,3 @@ Image RID_XMLSECTP_LOCK }; MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; }; }; -Image RID_XMLSECTP_LOCK_HC -{ - ImageBitmap = Bitmap - { - File = "lock_hc.bmp"; - }; - MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; }; -}; - diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx index 25de43ac4566..73cb5676d783 100644 --- a/xmlsecurity/source/dialogs/resourcemanager.cxx +++ b/xmlsecurity/source/dialogs/resourcemanager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,9 +53,6 @@ namespace XmlSec if( !pResMgr ) { 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() ); } @@ -78,7 +76,7 @@ namespace XmlSec String GetDateTimeString( const ::com::sun::star::util::DateTime& _rDT ) { - // --> PB 2004-10-12 #i20172# String with date and time information + // String with date and time information (#i20172#) DateTime aDT( GetDateTime( _rDT ) ); const LocaleDataWrapper& rLoDa = GetLocaleData(); String sRet( rLoDa.getDate( aDT ) ); @@ -126,7 +124,7 @@ namespace XmlSec ::rtl::OUStringBuffer s1, s2; OUString sEqual(RTL_CONSTASCII_USTRINGPARAM(" = ")); typedef vector< pair < OUString, OUString > >::const_iterator CIT; - for (CIT i = vecAttrValueOfDN.begin(); i < vecAttrValueOfDN.end(); i ++) + for (CIT i = vecAttrValueOfDN.begin(); i < vecAttrValueOfDN.end(); ++i) { if (i != vecAttrValueOfDN.begin()) { @@ -343,7 +341,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) { OUString sPartId = OUString::createFromAscii( aIDs[i++] ); typedef vector< pair < OUString, OUString > >::const_iterator CIT; - for (CIT idn = vecAttrValueOfDN.begin(); idn != vecAttrValueOfDN.end(); idn++) + for (CIT idn = vecAttrValueOfDN.begin(); idn != vecAttrValueOfDN.end(); ++idn) { if (idn->first.equals(sPartId)) { @@ -371,7 +369,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) { nNum = sal_uInt8( pSerNumSeq[ i ] ); - //MM : exchange the buffer[0] and buffer[1], which make it consistent with Mozilla and Windows + // exchange the buffer[0] and buffer[1], which make it consistent with Mozilla and Windows pBuffer[ 1 ] = pHexDigs[ nNum & 0x0F ]; nNum >>= 4; pBuffer[ 0 ] = pHexDigs[ nNum ]; @@ -429,3 +427,4 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/resourcemanager.hxx b/xmlsecurity/source/dialogs/resourcemanager.hxx index 0a0615871af3..07b266845e51 100644 --- a/xmlsecurity/source/dialogs/resourcemanager.hxx +++ b/xmlsecurity/source/dialogs/resourcemanager.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ namespace XmlSec #define XMLSEC_RES(id) ResId(id,*XmlSec::GetResMgr()) #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/stbcontrl.cxx b/xmlsecurity/source/dialogs/stbcontrl.cxx index 44395ed5d328..db5e970ce406 100644 --- a/xmlsecurity/source/dialogs/stbcontrl.cxx +++ b/xmlsecurity/source/dialogs/stbcontrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,81 +29,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlsecurity.hxx" -// include --------------------------------------------------------------- #include <tools/shl.hxx> -#ifndef _STATUS_HXX //autogen #include <vcl/status.hxx> -#endif -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif #include <vcl/image.hxx> -//#ifndef _SFXITEMPOOL_HXX -//#include <svl/itempool.hxx> -//#endif #include <sfx2/app.hxx> #include <sfx2/module.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objsh.hxx> - #include <svl/eitem.hxx> - - #include <xmlsecurity/stbcontrl.hxx> #define PAINT_OFFSET 5 -//#include "sizeitem.hxx" -//#include "dialmgr.hxx" -//#include "dlgutil.hxx" -//#include "stbctrls.h" - -//#include "dialogs.hrc" - -/*#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX -#include <unotools/localedatawrapper.hxx> -#endif -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX -#include <comphelper/processfactory.hxx> -#endif*/ - - - SFX_IMPL_STATUSBAR_CONTROL( XmlSecStatusBarControl, SfxBoolItem ); -/* -class FunctionPopup_Impl : public PopupMenu -{ -public: - FunctionPopup_Impl( sal_uInt16 nCheck ); - - sal_uInt16 GetSelected() const { return nSelected; } - -private: - sal_uInt16 nSelected; - - virtual void Select(); -}; - -// ----------------------------------------------------------------------- - -FunctionPopup_Impl::FunctionPopup_Impl( sal_uInt16 nCheck ) : - PopupMenu( ResId( RID_SVXMNU_PSZ_FUNC, DIALOG_MGR() ) ), - nSelected( 0 ) -{ - if (nCheck) - CheckItem( nCheck ); -} - -// ----------------------------------------------------------------------- - -void FunctionPopup_Impl::Select() -{ - nSelected = GetCurItemId(); -} -*/ - - struct XmlSecStatusBarControl::XmlSecStatusBarControl_Impl { @@ -119,7 +60,6 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nId, StatusBar& _rSt ,mpImpl( new XmlSecStatusBarControl_Impl ) { mpImpl->mbSigned = false; -// pImp->maImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); } XmlSecStatusBarControl::~XmlSecStatusBarControl() @@ -155,13 +95,7 @@ void XmlSecStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, void XmlSecStatusBarControl::Command( const CommandEvent& rCEvt ) { // can / has to be done when integrated in Office! -// if( rCEvt.GetCommand() == .... ) - if( false ) - { -// GetBindings().GetDispatcher()->Execute( SID_PSZ_FUNCTION, SFX_CALLMODE_RECORD, &aItem, 0L ); - } - else - SfxStatusBarControl::Command( rCEvt ); + SfxStatusBarControl::Command( rCEvt ); } void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) @@ -186,3 +120,4 @@ void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) pDev->SetFillColor( aOldFillColor ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/warnings.cxx b/xmlsecurity/source/dialogs/warnings.cxx index b92266f427d7..43c110a81a14 100644 --- a/xmlsecurity/source/dialogs/warnings.cxx +++ b/xmlsecurity/source/dialogs/warnings.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,7 +34,7 @@ #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <comphelper/sequence.hxx> -// MM : added for password exception +// added for password exception #include <vcl/msgbox.hxx> #include <com/sun/star/security/NoPasswordException.hpp> using namespace ::com::sun::star::security; @@ -76,7 +77,6 @@ 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 ) ); if( mxCert.is() ) maSignsFI.SetText( XmlSec::GetContentPart( mxCert->getSubjectName() ) ); @@ -138,8 +138,4 @@ IMPL_LINK( MacroWarning, EnableBtnHdl, void*, EMPTYARG ) return 0; } -/*IMPL_LINK( MacroWarning, DisableBtnHdl, void*, EMPTYARG ) -{ - return 0; -}*/ - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx index 5e06d3fbc3b6..5be0154ebe11 100644 --- a/xmlsecurity/source/framework/buffernode.cxx +++ b/xmlsecurity/source/framework/buffernode.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,9 +71,6 @@ bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const * RESULT * bExist - true if a match found, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -117,9 +115,6 @@ void BufferNode::setReceivedAll() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -152,9 +147,6 @@ void BufferNode::addElementCollector(const ElementCollector* pElementCollector) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -183,9 +175,6 @@ void BufferNode::removeElementCollector(const ElementCollector* pElementCollecto * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -231,9 +220,6 @@ void BufferNode::setBlocker(const ElementMark* pBlocker) * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -266,9 +252,6 @@ rtl::OUString BufferNode::printChildren() const * RESULT * result - the information string * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -303,12 +286,6 @@ rtl::OUString BufferNode::printChildren() const } rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "(" )); - /* - if (((ElementCollector*)(*ii))->isInternalNotificationSuppressed()) - { - rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*IN-Suppressed* " )); - } - */ rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SecID=" )); rc += rtl::OUString::valueOf(((ElementCollector*)(*ii))->getSecurityId()); rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" )); @@ -337,15 +314,12 @@ bool BufferNode::hasAnything() const * RESULT * bExist - true if there is, false otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com ******************************************************************************/ { - return (m_pBlocker != NULL || m_vElementCollectors.size() > 0); + return (m_pBlocker != NULL || !m_vElementCollectors.empty()); } bool BufferNode::hasChildren() const @@ -367,15 +341,12 @@ bool BufferNode::hasChildren() const * RESULT * bExist - true if there is, false otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com ******************************************************************************/ { - return (m_vChildren.size() > 0); + return (!m_vChildren.empty()); } std::vector< const BufferNode* >* BufferNode::getChildren() const @@ -402,9 +373,6 @@ const BufferNode* BufferNode::getFirstChild() const * child - the first child BufferNode, or NULL if there is no child * BufferNode. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -412,7 +380,7 @@ const BufferNode* BufferNode::getFirstChild() const { BufferNode* rc = NULL; - if (m_vChildren.size() > 0) + if (!m_vChildren.empty()) { rc = (BufferNode*)m_vChildren.front(); } @@ -443,9 +411,6 @@ void BufferNode::addChild(const BufferNode* pChild, sal_Int32 nPosition) * If the nPosition is -1, then the new child BufferNode is appended * at the end. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -484,9 +449,6 @@ void BufferNode::addChild(const BufferNode* pChild) * NOTES * The new child BufferNode is appended at the end. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -513,9 +475,6 @@ void BufferNode::removeChild(const BufferNode* pChild) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -552,9 +511,6 @@ sal_Int32 BufferNode::indexOfChild(const BufferNode* pChild) const * index - the index of that child BufferNode. If that child BufferNode * is not found, -1 is returned. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -602,9 +558,6 @@ const BufferNode* BufferNode::childAt(sal_Int32 nIndex) const * child - the child BufferNode at index position, or NULL if the index * is out of the range of children. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -648,9 +601,6 @@ const BufferNode* BufferNode::getNextSibling() const * RESULT * sibling - the next sibling BufferNode, or NULL if there is none. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -686,9 +636,6 @@ const BufferNode* BufferNode::isAncestor(const BufferNode* pDescendant) const * bIs - true if this BufferNode is an ancestor of the pDescendant, * false otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -741,9 +688,6 @@ bool BufferNode::isPrevious(const BufferNode* pFollowing) const * bIs - true if this BufferNode is ahead in the tree order, false * otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -794,9 +738,6 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const * node is; * 4. otherwise, no "next" node exists. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -877,9 +818,6 @@ void BufferNode::notifyBranch() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -914,9 +852,6 @@ void BufferNode::notifyAncestor() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -949,15 +884,12 @@ void BufferNode::elementCollectorNotify() * child - the first child BufferNode, or NULL if there is no child * BufferNode. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com ******************************************************************************/ { - if (m_vElementCollectors.size()>0) + if (!m_vElementCollectors.empty()) { cssxc::sax::ElementMarkPriority nMaxPriority = cssxc::sax::ElementMarkPriority_MINIMUM; cssxc::sax::ElementMarkPriority nPriority; @@ -1042,9 +974,6 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const * RESULT * bExist - true if a match found, false otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1109,9 +1038,6 @@ bool BufferNode::isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurity * RESULT * bExist - true if a match found, false otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1157,9 +1083,6 @@ bool BufferNode::isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const * RESULT * bExist - true if a match found, false otherwise. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1211,9 +1134,6 @@ const BufferNode* BufferNode::getNextChild(const BufferNode* pChild) const * nextChild - the next child BufferNode after the pChild, or NULL if * there is none. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1259,9 +1179,6 @@ void BufferNode::freeAllChildren() * RESULT * empty * - * HISTORY - * 30.03.2004 - the correct the memory leak bug - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1277,3 +1194,5 @@ void BufferNode::freeAllChildren() m_vChildren.clear(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/buffernode.hxx b/xmlsecurity/source/framework/buffernode.hxx index ec5d071d234b..bdece77655fd 100644 --- a/xmlsecurity/source/framework/buffernode.hxx +++ b/xmlsecurity/source/framework/buffernode.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,9 +55,6 @@ class BufferNode * BufferNode objects are also in ancestor/descendant relationship. * This class is used to manipulate the tree of bufferred elements. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -135,3 +133,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/decryptorimpl.cxx b/xmlsecurity/source/framework/decryptorimpl.cxx index a2fcafc1ca4b..de1c666887c7 100644 --- a/xmlsecurity/source/framework/decryptorimpl.cxx +++ b/xmlsecurity/source/framework/decryptorimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,9 +74,6 @@ bool DecryptorImpl::checkReady() const * RESULT * bReady - true if all conditions are satisfied, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -104,9 +102,6 @@ void DecryptorImpl::notifyResultListener() const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -141,9 +136,6 @@ void DecryptorImpl::startEngine( const cssu::Reference< * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -243,3 +235,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl::getSupportedServiceNames return DecryptorImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/decryptorimpl.hxx b/xmlsecurity/source/framework/decryptorimpl.hxx index 99aa2822667c..8dcb9880bd78 100644 --- a/xmlsecurity/source/framework/decryptorimpl.hxx +++ b/xmlsecurity/source/framework/decryptorimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,10 +54,6 @@ class DecryptorImpl : public cppu::ImplInheritanceHelper3 * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -134,3 +131,4 @@ SAL_CALL DecryptorImpl_createInstance( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/elementcollector.cxx b/xmlsecurity/source/framework/elementcollector.cxx index 7f720bb86250..2822c9746d39 100644 --- a/xmlsecurity/source/framework/elementcollector.cxx +++ b/xmlsecurity/source/framework/elementcollector.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,9 +83,6 @@ ElementCollector::ElementCollector( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -93,13 +91,6 @@ ElementCollector::ElementCollector( m_type = cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR; } -/* -bool ElementCollector::isInternalNotificationSuppressed() const -{ - return m_bInternalNotificationSuppressed; -} -*/ - cssxc::sax::ElementMarkPriority ElementCollector::getPriority() const { return m_nPriority; @@ -128,9 +119,6 @@ void ElementCollector::notifyListener() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -165,9 +153,6 @@ void ElementCollector::setReferenceResolvedListener( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -195,9 +180,6 @@ void ElementCollector::setSecurityId(sal_Int32 nSecurityId) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -229,9 +211,6 @@ void ElementCollector::doNotify() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -268,9 +247,6 @@ ElementCollector* ElementCollector::clone( * RESULT * clone - a new ElementCollector * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -294,3 +270,4 @@ ElementCollector* ElementCollector::clone( return pClonedOne; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/elementcollector.hxx b/xmlsecurity/source/framework/elementcollector.hxx index acef68b3bc8e..72ed2c87026a 100644 --- a/xmlsecurity/source/framework/elementcollector.hxx +++ b/xmlsecurity/source/framework/elementcollector.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,6 @@ class ElementCollector : public ElementMark * of the ElementMark class, this class also maintains the priority, and * manages the notify process * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -88,7 +86,6 @@ public: xReferenceResolvedListener); virtual ~ElementCollector() {}; - //bool isInternalNotificationSuppressed() const; com::sun::star::xml::crypto::sax::ElementMarkPriority getPriority() const; bool getModify() const; void notifyListener(); @@ -106,3 +103,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/elementmark.cxx b/xmlsecurity/source/framework/elementmark.cxx index 3185d5e954dc..5452895cb5c0 100644 --- a/xmlsecurity/source/framework/elementmark.cxx +++ b/xmlsecurity/source/framework/elementmark.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,9 +62,6 @@ ElementMark::ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -103,3 +101,4 @@ sal_Int32 ElementMark::getBufferId() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/elementmark.hxx b/xmlsecurity/source/framework/elementmark.hxx index 0c08357867b4..9f77c0f31e5e 100644 --- a/xmlsecurity/source/framework/elementmark.hxx +++ b/xmlsecurity/source/framework/elementmark.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,6 @@ class ElementMark * This class maintains the security id, buffer id and its type for a * buffer node. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -83,3 +81,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/encryptionengine.cxx b/xmlsecurity/source/framework/encryptionengine.cxx index 53e0c295a192..333672399c77 100644 --- a/xmlsecurity/source/framework/encryptionengine.cxx +++ b/xmlsecurity/source/framework/encryptionengine.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,9 +72,6 @@ bool EncryptionEngine::checkReady() const * RESULT * bReady - true if all conditions are satisfied, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -122,9 +120,6 @@ void EncryptionEngine::tryToPerform( ) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -178,9 +173,6 @@ void EncryptionEngine::clearUp( ) const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -214,3 +206,4 @@ void SAL_CALL EncryptionEngine::setBlockerId( sal_Int32 id ) tryToPerform(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/encryptionengine.hxx b/xmlsecurity/source/framework/encryptionengine.hxx index 375fcc42b239..a0ae4173f061 100644 --- a/xmlsecurity/source/framework/encryptionengine.hxx +++ b/xmlsecurity/source/framework/encryptionengine.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,9 +54,6 @@ class EncryptionEngine : public cppu::ImplInheritanceHelper1 * FUNCTION * Maintains common members and methods related with encryption. * - * HISTORY - * 05.01.2004 - Interface supported: XBlockerMonitor - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -101,3 +99,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/encryptorimpl.cxx b/xmlsecurity/source/framework/encryptorimpl.cxx index e2ba215e21ff..161b544ca088 100644 --- a/xmlsecurity/source/framework/encryptorimpl.cxx +++ b/xmlsecurity/source/framework/encryptorimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,9 +75,6 @@ bool EncryptorImpl::checkReady() const * RESULT * bReady - true if all conditions are satisfied, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -114,9 +112,6 @@ void EncryptorImpl::notifyResultListener() const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -151,9 +146,6 @@ void EncryptorImpl::startEngine( const cssu::Reference< * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -279,3 +271,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl::getSupportedServiceNames return EncryptorImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/encryptorimpl.hxx b/xmlsecurity/source/framework/encryptorimpl.hxx index e80540ee9066..50af964adceb 100644 --- a/xmlsecurity/source/framework/encryptorimpl.hxx +++ b/xmlsecurity/source/framework/encryptorimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <com/sun/star/xml/crypto/sax/XEncryptionResultBroadcaster.hpp> #include <com/sun/star/xml/crypto/sax/XEncryptionResultListener.hpp> -#ifndef _COM_SUN_STAR_XML_CRYPTO_SAX_XSIGNATURECOLLECTOR_HPP_ #include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> -#endif #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -57,9 +56,6 @@ class EncryptorImpl : public cppu::ImplInheritanceHelper4 * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -148,3 +144,4 @@ SAL_CALL EncryptorImpl_createInstance( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx index d5779e623522..99f2d60f3258 100644 --- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -110,9 +111,6 @@ void SAXEventKeeperImpl::setCurrentBufferNode(BufferNode* pBufferNode) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -158,9 +156,6 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers() * pBufferNode - the BufferNode that has been connected with both new * ElementCollectors and new Blocker. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -168,7 +163,7 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers() { BufferNode* pBufferNode = NULL; - if ( (m_vNewElementCollectors.size()>0) || + if ( (!m_vNewElementCollectors.empty()) || (m_pNewBlocker != NULL)) { /* @@ -209,7 +204,7 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers() m_pNewBlocker = NULL; } - if (m_vNewElementCollectors.size()>0) + if (!m_vNewElementCollectors.empty()) { std::vector< const ElementCollector* >::const_iterator ii = m_vNewElementCollectors.begin(); @@ -245,9 +240,6 @@ ElementMark* SAXEventKeeperImpl::findElementMarkBuffer(sal_Int32 nId) const * pElementMark - the ElementMark with the particular Id, or NULL when * no such Id exists. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -287,9 +279,6 @@ void SAXEventKeeperImpl::removeElementMarkBuffer(sal_Int32 nId) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -362,9 +351,6 @@ rtl::OUString SAXEventKeeperImpl::printBufferNode( * RESULT * info - the information string * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -445,9 +431,6 @@ cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > * RESULT * list - the child Elements list. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -506,9 +489,6 @@ void SAXEventKeeperImpl::smashBufferNode( * operation can delete all useless bufferred SAX events which are only * needed by the Blocker to be deleted. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -651,9 +631,6 @@ BufferNode* SAXEventKeeperImpl::findNextBlockingBufferNode( * pBufferNode - the next blocking BufferNode, or NULL if no such * BufferNode exists. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -698,9 +675,6 @@ void SAXEventKeeperImpl::diffuse(BufferNode* pBufferNode) const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -735,16 +709,13 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com ******************************************************************************/ { m_bIsReleasing = true; - while (m_vReleasedElementMarkBuffers.size()>0) + while (!m_vReleasedElementMarkBuffers.empty()) { std::vector< sal_Int32 >::iterator pId = m_vReleasedElementMarkBuffers.begin(); sal_Int32 nId = *pId; @@ -897,9 +868,6 @@ void SAXEventKeeperImpl::markElementMarkBuffer(sal_Int32 nId) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -942,9 +910,6 @@ sal_Int32 SAXEventKeeperImpl::createElementCollector( * RESULT * nId - the Id of the new ElementCollector * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -990,9 +955,6 @@ sal_Int32 SAXEventKeeperImpl::createBlocker(sal_Int32 nSecurityId) * RESULT * nId - the Id of the new Blocker * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1461,3 +1423,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl::getSupportedService return SAXEventKeeperImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx b/xmlsecurity/source/framework/saxeventkeeperimpl.hxx index 4afe43852f2d..52d1fed61ec4 100644 --- a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,12 +67,6 @@ class SAXEventKeeperImpl : public cppu::WeakImplHelper6 * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -367,3 +362,4 @@ SAL_CALL SAXEventKeeperImpl_createInstance( const com::sun::star::uno::Reference +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/securityengine.cxx b/xmlsecurity/source/framework/securityengine.cxx index eac5e4189565..b6554e343354 100644 --- a/xmlsecurity/source/framework/securityengine.cxx +++ b/xmlsecurity/source/framework/securityengine.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,3 +87,4 @@ sal_Bool SAL_CALL SecurityEngine::endMission( ) return rc; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/securityengine.hxx b/xmlsecurity/source/framework/securityengine.hxx index c5c9e84977ea..d6dc0b9117fd 100644 --- a/xmlsecurity/source/framework/securityengine.hxx +++ b/xmlsecurity/source/framework/securityengine.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,10 +53,6 @@ class SecurityEngine : public cppu::WeakImplHelper3 * Maintains common members and methods related with security engine * operation. * - * HISTORY - * 05.01.2004 - Interface supported: XReferenceResolvedListener, - * XKeyCollector, and XMissionTaker - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -108,7 +105,6 @@ protected: /* * the status of the operation */ - //bool m_bOperationSucceed; com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus; /* @@ -170,3 +166,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.cxx b/xmlsecurity/source/framework/signaturecreatorimpl.cxx index 761b981237f6..c1717f8ad2f8 100644 --- a/xmlsecurity/source/framework/signaturecreatorimpl.cxx +++ b/xmlsecurity/source/framework/signaturecreatorimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,9 +76,6 @@ bool SignatureCreatorImpl::checkReady() const * RESULT * bReady - true if all conditions are satisfied, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -108,9 +106,6 @@ void SignatureCreatorImpl::notifyResultListener() const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -146,9 +141,6 @@ void SignatureCreatorImpl::startEngine( const cssu::Reference< * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -192,9 +184,6 @@ void SignatureCreatorImpl::clearUp() const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -295,3 +284,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl::getSupportedServi return SignatureCreatorImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.hxx b/xmlsecurity/source/framework/signaturecreatorimpl.hxx index db25bf10f893..f55076e69f42 100644 --- a/xmlsecurity/source/framework/signaturecreatorimpl.hxx +++ b/xmlsecurity/source/framework/signaturecreatorimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,10 +56,6 @@ class SignatureCreatorImpl : public cppu::ImplInheritanceHelper4 * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -145,3 +142,4 @@ SAL_CALL SignatureCreatorImpl_createInstance( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/signatureengine.cxx b/xmlsecurity/source/framework/signatureengine.cxx index 51fbdb259667..794ad73e3a35 100644 --- a/xmlsecurity/source/framework/signatureengine.cxx +++ b/xmlsecurity/source/framework/signatureengine.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,9 +72,6 @@ bool SignatureEngine::checkReady() const * RESULT * bReady - true if all conditions are satisfied, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -122,9 +120,6 @@ void SignatureEngine::tryToPerform( ) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -191,9 +186,6 @@ void SignatureEngine::clearUp( ) const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -266,3 +258,5 @@ cssu::Reference< com::sun::star::io::XInputStream > SAL_CALL SignatureEngine::ge return xInputStream; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/signatureengine.hxx b/xmlsecurity/source/framework/signatureengine.hxx index b36cd6aa6442..45a26637f73d 100644 --- a/xmlsecurity/source/framework/signatureengine.hxx +++ b/xmlsecurity/source/framework/signatureengine.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> #include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> -#ifndef _COM_SUN_STAR_XML_CRYPTO_SAX_XSIGNATURECOLLECTOR_HPP_ #include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> -#endif #include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> #include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp> #include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp> @@ -64,9 +63,6 @@ class SignatureEngine : public cppu::ImplInheritanceHelper2 * FUNCTION * Maintains common members and methods related with signature operation. * - * HISTORY - * 05.01.2004 - Interface supported: XReferenceCollector - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -142,3 +138,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx index 535944ef8415..0ab14e4e16e5 100644 --- a/xmlsecurity/source/framework/signatureverifierimpl.cxx +++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,9 +74,6 @@ bool SignatureVerifierImpl::checkReady() const * RESULT * bReady - true if all conditions are satisfied, false otherwise * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -103,9 +101,6 @@ void SignatureVerifierImpl::notifyResultListener() const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -139,9 +134,6 @@ void SignatureVerifierImpl::startEngine( const cssu::Reference< * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -240,3 +232,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl::getSupportedServ return SignatureVerifierImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/signatureverifierimpl.hxx b/xmlsecurity/source/framework/signatureverifierimpl.hxx index 68b4fff245d2..3a40a6e901a1 100644 --- a/xmlsecurity/source/framework/signatureverifierimpl.hxx +++ b/xmlsecurity/source/framework/signatureverifierimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,10 +54,6 @@ class SignatureVerifierImpl : public cppu::ImplInheritanceHelper3 * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -133,3 +130,4 @@ SAL_CALL SignatureVerifierImpl_createInstance( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx index ec978dc488e1..3399663e1332 100644 --- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx +++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -120,12 +121,12 @@ Sequence< OUString > SAL_CALL XMLEncryptionTemplateImpl :: getSupportedServiceNa Sequence< OUString > XMLEncryptionTemplateImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLEncryptionTemplate" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLEncryptionTemplate")) ; return seqServiceNames ; } OUString XMLEncryptionTemplateImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.framework.XMLEncryptionTemplateImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.framework.XMLEncryptionTemplateImpl")) ; } //Helper for registry @@ -134,9 +135,7 @@ Reference< XInterface > SAL_CALL XMLEncryptionTemplateImpl :: impl_createInstanc } Reference< XSingleServiceFactory > XMLEncryptionTemplateImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { - //Reference< XSingleServiceFactory > xFactory ; - //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; - //return xFactory ; return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx index af2f7ab93028..87aad120ff53 100644 --- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx +++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> @@ -111,3 +108,5 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3< } ; #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 6b50d7b017ed..21dd97381a6a 100644 --- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx +++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -145,12 +146,12 @@ Sequence< OUString > SAL_CALL XMLSignatureTemplateImpl :: getSupportedServiceNam Sequence< OUString > XMLSignatureTemplateImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignatureTemplate" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignatureTemplate")) ; return seqServiceNames ; } OUString XMLSignatureTemplateImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.framework.XMLSignatureTemplateImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.framework.XMLSignatureTemplateImpl")) ; } //Helper for registry @@ -159,9 +160,7 @@ Reference< XInterface > SAL_CALL XMLSignatureTemplateImpl :: impl_createInstance } Reference< XSingleServiceFactory > XMLSignatureTemplateImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { - //Reference< XSingleServiceFactory > xFactory ; - //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; - //return xFactory ; return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx index c4e33fdfe972..544a25c9a197 100644 --- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx +++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,21 +35,15 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> -#ifndef __SGI_STL_VECTOR #include <vector> -#endif class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3< ::com::sun::star::xml::crypto::XXMLSignatureTemplate , @@ -123,3 +118,5 @@ class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3< } ; #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 a9c418595901..bec99e49686e 100644 --- a/xmlsecurity/source/framework/xsec_framework.cxx +++ b/xmlsecurity/source/framework/xsec_framework.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,14 +53,14 @@ using namespace ::com::sun::star::registry; extern "C" { //================================================================================================== -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment **) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -void * SAL_CALL component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; @@ -171,3 +172,4 @@ void * SAL_CALL component_getFactory( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index d0fba345588c..2c33af2dc372 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,7 +43,6 @@ #include "rtl/uri.hxx" using namespace ::com::sun::star::uno; -//using namespace ::com::sun::star; namespace css = ::com::sun::star; using rtl::OUString; @@ -216,7 +216,7 @@ DocumentSignatureHelper::CreateElementList( ImplFillElementList(aElements, rxStore, ::rtl::OUString(), false, mode); // 2) Pictures... - rtl::OUString aSubStorageName( rtl::OUString::createFromAscii( "Pictures" ) ); + rtl::OUString aSubStorageName( RTL_CONSTASCII_USTRINGPARAM("Pictures") ); try { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); @@ -227,7 +227,7 @@ DocumentSignatureHelper::CreateElementList( ; // Doesn't have to exist... } // 3) OLE.... - aSubStorageName = rtl::OUString::createFromAscii( "ObjectReplacements" ); + aSubStorageName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ObjectReplacements")); try { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); @@ -235,7 +235,7 @@ DocumentSignatureHelper::CreateElementList( xSubStore.clear(); // Object folders... - rtl::OUString aMatchStr( rtl::OUString::createFromAscii( "Object " ) ); + rtl::OUString aMatchStr( RTL_CONSTASCII_USTRINGPARAM("Object ") ); Reference < css::container::XNameAccess > xElements( rxStore, UNO_QUERY ); Sequence< ::rtl::OUString > aElementNames = xElements->getElementNames(); sal_Int32 nElements = aElementNames.getLength(); @@ -264,7 +264,7 @@ DocumentSignatureHelper::CreateElementList( case SignatureModeMacros: { // 1) Macros - rtl::OUString aSubStorageName( rtl::OUString::createFromAscii( "Basic" ) ); + rtl::OUString aSubStorageName( RTL_CONSTASCII_USTRINGPARAM("Basic") ); try { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); @@ -276,7 +276,7 @@ DocumentSignatureHelper::CreateElementList( } // 2) Dialogs - aSubStorageName = rtl::OUString::createFromAscii( "Dialogs") ; + aSubStorageName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dialogs")) ; try { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); @@ -287,7 +287,7 @@ DocumentSignatureHelper::CreateElementList( ; // Doesn't have to exist... } // 3) Scripts - aSubStorageName = rtl::OUString::createFromAscii( "Scripts") ; + aSubStorageName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Scripts")) ; try { Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); @@ -430,7 +430,7 @@ bool DocumentSignatureHelper::equalsReferenceUriManifestPath( retVal = true; typedef std::vector<OUString>::const_iterator CIT; for (CIT i = vUriSegments.begin(), j = vPathSegments.begin(); - i != vUriSegments.end(); i++, j++) + i != vUriSegments.end(); ++i, ++j) { //Decode the uri segment, so that %20 becomes ' ', etc. OUString sDecUri = ::rtl::Uri::decode( @@ -460,3 +460,5 @@ bool DocumentSignatureHelper::equalsReferenceUriManifestPath( { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "packagesignatures.xml" ) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index d2def9648476..22a41bb3f4df 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,10 +50,6 @@ #include <tools/date.hxx> #include <tools/time.hxx> -//MM : search for the default profile -//#include <unotools/streamhelper.hxx> -//MM : end - /* SEInitializer component */ #define SEINITIALIZER_COMPONENT "com.sun.star.xml.crypto.SEInitializer" @@ -90,7 +87,7 @@ bool XMLSignatureHelper::Init() void XMLSignatureHelper::ImplCreateSEInitializer() { - rtl::OUString sSEInitializer(rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT )); + rtl::OUString sSEInitializer(RTL_CONSTASCII_USTRINGPARAM( SEINITIALIZER_COMPONENT )); uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > ( xMCF->createInstanceWithContext( sSEInitializer, mxCtx ), uno::UNO_QUERY ); @@ -171,11 +168,6 @@ void XMLSignatureHelper::SetX509Certificate( void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime ) { - /* - rtl::OUString aDate = String::CreateFromInt32( rDate.GetDate() ); - rtl::OUString aTime = String::CreateFromInt32( rTime.GetTime() ); - mpXSecController->setDateTime( nSecurityId, aDate, aTime ); - */ ::com::sun::star::util::DateTime stDateTime; stDateTime.HundredthSeconds = (::sal_uInt16)rTime.Get100Sec(); stDateTime.Seconds = (::sal_uInt16)rTime.GetSec(); @@ -201,8 +193,8 @@ uno::Reference<xml::sax::XDocumentHandler> XMLSignatureHelper::CreateDocumentHan */ uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); uno::Reference< io::XActiveDataSource > xSaxWriter( - xMCF->createInstanceWithContext(rtl::OUString::createFromAscii( - "com.sun.star.xml.sax.Writer"), mxCtx ), uno::UNO_QUERY ); + xMCF->createInstanceWithContext(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.xml.sax.Writer")), mxCtx ), uno::UNO_QUERY ); DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" ); @@ -262,16 +254,10 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax /* * create a signature listener */ -/* - ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener( - LINK( this, XMLSignatureHelper, SignatureCreationResultListener ), - LINK( this, XMLSignatureHelper, SignatureVerifyResultListener ), - LINK( this, XMLSignatureHelper, StartVerifySignatureElement ) ); -*/ + /* * configure the signature creation listener */ - //mpXSecController->setSignatureCreationResultListener( pSignatureListener ); /* * write signatures @@ -284,7 +270,6 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax /* * clear up the signature creation listener */ - //mpXSecController->setSignatureCreationResultListener( NULL ); return !mbError; } @@ -311,7 +296,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe * prepare ParserInputSrouce */ xml::sax::InputSource aParserInput; - // aParserInput.sSystemId = ouName; aParserInput.aInputStream = xInputStream; /* @@ -320,7 +304,7 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); uno::Reference< xml::sax::XParser > xParser( xMCF->createInstanceWithContext( - rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser"), mxCtx ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser") ), mxCtx ), uno::UNO_QUERY ); DBG_ASSERT( xParser.is(), "Can't create parser" ); @@ -342,7 +326,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe /* * configure the signature verify listener */ - //mpXSecController->setSignatureVerifyResultListener( pSignatureListener ); /* * setup the connection: @@ -383,7 +366,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe /* * clear up the signature verify listener */ - //mpXSecController->setSignatureVerifyResultListener( NULL ); /* * release the signature reader @@ -444,3 +426,5 @@ IMPL_LINK( XMLSignatureHelper, StartVerifySignatureElement, const uno::Reference return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx index 83988e872b49..fed623cb22b1 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -231,3 +232,4 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx index 84b45d02ba41..e5dd47978b94 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -132,3 +133,4 @@ public: static com::sun::star::uno::Reference < com::sun::star::io::XInputStream > OpenInputStream( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStore, const rtl::OUString& rURI ); }; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index bdcb0658af1e..9b888932b746 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -296,9 +297,6 @@ int XSecController::findSignatureInfor( sal_Int32 nSecurityId) const * index - the index of the signature, or -1 when no such signature * existing * - * HISTORY - * 08.05.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -339,17 +337,14 @@ void XSecController::createXSecComponent( ) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * 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 )); + rtl::OUString sSAXEventKeeper(RTL_CONSTASCII_USTRINGPARAM( SAXEVENTKEEPER_COMPONENT )); + rtl::OUString sXMLSignature(RTL_CONSTASCII_USTRINGPARAM( XMLSIGNATURE_COMPONENT )); + rtl::OUString sXMLDocument(RTL_CONSTASCII_USTRINGPARAM( XMLDOCUMENTWRAPPER_COMPONENT )); /* * marks all security components are not available. @@ -448,9 +443,6 @@ bool XSecController::chainOn( bool bRetrievingLastEvent ) * events except that startElement event, then adds a new * ElementCollector, then receives that startElement event. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -548,9 +540,6 @@ void XSecController::chainOff() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -616,9 +605,6 @@ void XSecController::checkChainingStatus() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -655,9 +641,6 @@ void XSecController::initializeSAXChain() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -697,9 +680,6 @@ cssu::Reference< com::sun::star::io::XInputStream > * RESULT * xInputStream - the XInputStream interface * - * HISTORY - * 15.04.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -714,57 +694,6 @@ cssu::Reference< com::sun::star::io::XInputStream > return xObjectInputStream; } -#if 0 -sal_Int32 XSecController::getFastPropertyIndex(sal_Int32 nHandle) const -/****** XSecController/getFastPropertyIndex *********************************** - * - * NAME - * getFastPropertyIndex -- gets the index of a particular fast property - * - * SYNOPSIS - * nIndex = getFastPropertyIndex( nHandle ); - * - * FUNCTION - * See NAME. - * - * INPUTS - * nHandle - the key for the fast property - * - * RESULT - * nIndex - the index of the fast property, or -1 - * if the key is not found. - * - * HISTORY - * 05.01.2004 - implemented - * - * AUTHOR - * 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 ) - { - if ( nHandle == (*ii)) - { - bFound = true; - break; - } - } - - if (!bFound) - { - nIndex = -1; - } - - return nIndex; -} -#endif - /* * public methods */ @@ -799,9 +728,6 @@ void XSecController::startMission( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -845,9 +771,6 @@ void XSecController::setSAXChainConnector( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -886,9 +809,6 @@ void XSecController::setSAXChainConnector( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -920,9 +840,6 @@ void XSecController::clearSAXChainConnector() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -965,9 +882,6 @@ void XSecController::endMission() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1026,9 +940,6 @@ const char* XSecController::getErrorMessage() * RESULT * empty * - * HISTORY - * 22.04.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1058,9 +969,6 @@ void XSecController::exportSignature( * RESULT * empty * - * HISTORY - * 26.05.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1090,11 +998,6 @@ 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 - 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; @@ -1364,46 +1267,6 @@ SignatureInformations XSecController::getSignatureInformations() const /* * XFastPropertySet */ -/* -void SAL_CALL XSecController::setFastPropertyValue( - sal_Int32 nHandle, - const cssu::Any& aValue ) - throw ( cssb::UnknownPropertyException, - cssb::PropertyVetoException, - cssl::IllegalArgumentException, - cssl::WrappedTargetException, - cssu::RuntimeException) -{ - sal_Int32 nIndex = getFastPropertyIndex(nHandle); - if (nIndex == -1) - { - m_vFastPropertyIndexs.push_back( nHandle ); - m_vFastPropertyValues.push_back( aValue ); - } - else - { - m_vFastPropertyValues[nIndex] = aValue; - } -} - -cssu::Any SAL_CALL XSecController::getFastPropertyValue( - sal_Int32 nHandle ) - throw ( - cssb::UnknownPropertyException, - cssl::WrappedTargetException, - cssu::RuntimeException) -{ - cssu::Any aValue; - - sal_Int32 nIndex = getFastPropertyIndex(nHandle); - if (nIndex != -1) - { - aValue = m_vFastPropertyValues[nIndex]; - } - - return aValue; -} -*/ /* * XSAXEventKeeperStatusChangeListener @@ -1412,13 +1275,6 @@ cssu::Any SAL_CALL XSecController::getFastPropertyValue( void SAL_CALL XSecController::blockingStatusChanged( sal_Bool isBlocking ) throw (cssu::RuntimeException) { - /* - showMessageBox( rtl::OUString::createFromAscii((isBlocking? - "Blocking Status => TRUE": - "Blocking Status => FALSE")), - rtl::OUString::createFromAscii("SAXEventKeeper Status")); - */ - this->m_bIsBlocking = isBlocking; checkChainingStatus(); } @@ -1427,13 +1283,6 @@ void SAL_CALL XSecController::collectionStatusChanged( sal_Bool isInsideCollectedElement ) throw (cssu::RuntimeException) { - /* - showMessageBox( rtl::OUString::createFromAscii((isInsideCollectedElement? - "Collection Status => TRUE": - "Collection Status => FALSE")), - rtl::OUString::createFromAscii("SAXEventKeeper Status")); - */ - this->m_bIsCollectingElement = isInsideCollectedElement; checkChainingStatus(); } @@ -1441,12 +1290,7 @@ void SAL_CALL XSecController::collectionStatusChanged( void SAL_CALL XSecController::bufferStatusChanged( sal_Bool /*isBufferEmpty*/) throw (cssu::RuntimeException) { - /* - showMessageBox( rtl::OUString::createFromAscii((isBufferEmpty? - "Buffer Empty => TRUE": - "Buffer Empty => FALSE")), - rtl::OUString::createFromAscii("SAXEventKeeper Status")); - */ + } /* @@ -1460,16 +1304,6 @@ void SAL_CALL XSecController::signatureCreated( sal_Int32 securityId, com::sun:: SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor; - /* - if (nResult == cssxc::sax::SignatureCreationResult_CREATIONSUCCEED) - { - signatureInfor.nStatus = STATUS_CREATION_SUCCEED; - } - else - { - signatureInfor.nStatus = STATUS_CREATION_FAIL; - } - */ signatureInfor.nStatus = nResult; } @@ -1484,15 +1318,7 @@ void SAL_CALL XSecController::signatureVerified( sal_Int32 securityId, com::sun: SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor; - /* - if (nResult == cssxc::sax::SignatureVerifyResult_VERIFYSUCCEED) - { - signatureInfor.nStatus = STATUS_VERIFY_SUCCEED; - } - else - { - signatureInfor.nStatus = STATUS_VERIFY_FAIL; - } - */ signatureInfor.nStatus = nResult; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx index 4a715105d044..37ab6d328fdf 100644 --- a/xmlsecurity/source/helper/xsecctl.hxx +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -171,12 +172,6 @@ class XSecController : public cppu::WeakImplHelper4 * Controlls the whole xml security framework to create signatures or to * verify signatures. * - * HISTORY - * 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 @@ -216,19 +211,6 @@ private: com::sun::star::uno::Reference< com::sun::star::xml::crypto::XXMLSecurityContext > m_xSecurityContext; -#if 0 - /* - * the signature creation result listener - */ - com::sun::star::uno::Reference< - com::sun::star::xml::crypto::sax::XSignatureCreationResultListener > m_xSignatureCreationResultListener; - /* - * the signature verify result listener - */ - com::sun::star::uno::Reference< - com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener > m_xSignatureVerifyResultListener; -#endif - /* * the security id incrementer, in order to make any security id unique * to the SAXEventKeeper. @@ -531,23 +513,6 @@ public: /* * XFastPropertySet */ - /* - virtual void SAL_CALL setFastPropertyValue( - sal_Int32 nHandle, - const com::sun::star::uno::Any& aValue ) - throw ( - com::sun::star::beans::UnknownPropertyException, - com::sun::star::beans::PropertyVetoException, - com::sun::star::lang::IllegalArgumentException, - com::sun::star::lang::WrappedTargetException, - com::sun::star::uno::RuntimeException); - virtual com::sun::star::uno::Any SAL_CALL getFastPropertyValue( - sal_Int32 nHandle ) - throw ( - com::sun::star::beans::UnknownPropertyException, - com::sun::star::lang::WrappedTargetException, - com::sun::star::uno::RuntimeException); - */ /* * XSAXEventKeeperStatusChangeListener @@ -575,3 +540,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index 1546acbdb4ef..96272fd07416 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,7 +75,6 @@ void SAL_CALL XSecParser::startDocument( ) m_bInSignatureValue = false; m_bInDigestValue = false; m_bInDate = false; - //m_bInTime = false; if (m_xNextHandler.is()) { @@ -151,27 +151,27 @@ void SAL_CALL XSecParser::startElement( } else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509ISSUERNAME))) { - m_ouX509IssuerName = rtl::OUString::createFromAscii(""); + m_ouX509IssuerName = rtl::OUString(); m_bInX509IssuerName = true; } else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509SERIALNUMBER))) { - m_ouX509SerialNumber = rtl::OUString::createFromAscii(""); + m_ouX509SerialNumber = rtl::OUString(); m_bInX509SerialNumber = true; } else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509CERTIFICATE))) { - m_ouX509Certificate = rtl::OUString::createFromAscii(""); + m_ouX509Certificate = rtl::OUString(); m_bInX509Certificate = true; } else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREVALUE))) { - m_ouSignatureValue = rtl::OUString::createFromAscii(""); + m_ouSignatureValue = rtl::OUString(); m_bInSignatureValue = true; } else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE))) { - m_ouDigestValue = rtl::OUString::createFromAscii(""); + m_ouDigestValue = rtl::OUString(); m_bInDigestValue = true; } else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY)) ) @@ -185,16 +185,9 @@ void SAL_CALL XSecParser::startElement( +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE))) { - m_ouDate = rtl::OUString::createFromAscii(""); + m_ouDate = rtl::OUString(); m_bInDate = true; } - /* - else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME))) - { - m_ouTime = rtl::OUString::createFromAscii(""); - m_bInTime = true; - } - */ if (m_xNextHandler.is()) { @@ -270,13 +263,6 @@ void SAL_CALL XSecParser::endElement( const rtl::OUString& aName ) m_pXSecController->setDate( m_ouDate ); m_bInDate = false; } - /* - else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME)) ) - { - m_pXSecController->setTime( m_ouTime ); - m_bInTime = false; - } - */ if (m_xNextHandler.is()) { @@ -326,12 +312,6 @@ void SAL_CALL XSecParser::characters( const rtl::OUString& aChars ) { m_ouDate += aChars; } - /* - else if (m_bInTime) - { - m_ouTime += aChars; - } - */ if (m_xNextHandler.is()) { @@ -375,3 +355,5 @@ void SAL_CALL XSecParser::initialize( { aArguments[0] >>= m_xNextHandler; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx index 8de771569191..6530fa1d4207 100644 --- a/xmlsecurity/source/helper/xsecparser.hxx +++ b/xmlsecurity/source/helper/xsecparser.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,9 +53,6 @@ class XSecParser: public cppu::WeakImplHelper2 * security elements in the SAX event stream, then notifies * the XSecController. * - * HISTORY - * 05.01.2004 - Interface supported: XDocumentHandler, XInitialization - * * NOTES * This class is used when importing a document. * @@ -75,7 +73,6 @@ private: rtl::OUString m_ouDigestValue; rtl::OUString m_ouSignatureValue; rtl::OUString m_ouDate; - //rtl::OUString m_ouTime; /* * whether inside a particular element @@ -86,7 +83,6 @@ private: bool m_bInDigestValue; bool m_bInSignatureValue; bool m_bInDate; - //bool m_bInTime; /* * the XSecController collaborating with XSecParser @@ -163,3 +159,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx index 774a07cb28f2..d64f1adc1623 100644 --- a/xmlsecurity/source/helper/xsecsign.cxx +++ b/xmlsecurity/source/helper/xsecsign.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,7 +87,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); xReferenceResolvedListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( xMCF->createInstanceWithContext( - rtl::OUString::createFromAscii(SIGNATURECREATOR_COMPONENT), mxCtx), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SIGNATURECREATOR_COMPONENT)), mxCtx), cssu::UNO_QUERY); cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY); @@ -372,3 +373,4 @@ bool XSecController::WriteSignature( return rc; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx index 82210fdc91b3..7fb4540f06fd 100644 --- a/xmlsecurity/source/helper/xsecverify.cxx +++ b/xmlsecurity/source/helper/xsecverify.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,7 +71,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); xReferenceResolvedListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( xMCF->createInstanceWithContext( - rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT ), mxCtx), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SIGNATUREVERIFIER_COMPONENT )), mxCtx), cssu::UNO_QUERY); cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY); @@ -219,14 +220,6 @@ void XSecController::setDate( rtl::OUString& ouDate ) isi.signatureInfor.ouDateTime = ouDate; } -/* -void XSecController::setTime( rtl::OUString& ouTime ) -{ - InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; - isi.signatureInfor.ouTime = ouTime; -} -*/ - void XSecController::setId( rtl::OUString& ouId ) { InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; @@ -329,3 +322,4 @@ void XSecController::releaseSignatureReader() m_pXSecParser = NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx index e3947671ae38..100708938cdb 100644 --- a/xmlsecurity/source/xmlsec/biginteger.cxx +++ b/xmlsecurity/source/xmlsec/biginteger.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -124,3 +125,4 @@ OUString bigIntegerToNumericString ( Sequence< sal_Int8 > integer ) return aRet ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx index 19dfeb9c08a7..c7e3c0fa61be 100644 --- a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,4 @@ void CertificateExtension_XmlSecImpl :: setCertExtn( unsigned char* value, unsig m_critical = critical ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx index 26d5e413307c..bbfecbbcd760 100644 --- a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx +++ b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,4 @@ class CertificateExtension_XmlSecImpl : public ::cppu::WeakImplHelper1< #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 b92fe3b1214e..e53863d1dd01 100644 --- a/xmlsecurity/source/xmlsec/certvalidity.cxx +++ b/xmlsecurity/source/xmlsec/certvalidity.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,43 +57,44 @@ rtl::OUString certificateValidityToOUString( ::sal_Int32 certValidity ) { OUString aValidity ; if( (certValidity & CertificateValidity::VALID) == CertificateValidity::VALID ) { - aValidity = OUString::createFromAscii( ( const char* )VALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(VALID_STR )) ; } else if( ( certValidity & CertificateValidity::INVALID ) == CertificateValidity::INVALID ) { - aValidity = OUString::createFromAscii( ( const char* )INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(INVALID_STR )) ; } else if( ( certValidity & CertificateValidity::UNTRUSTED ) == CertificateValidity::UNTRUSTED ) { - aValidity = OUString::createFromAscii( ( const char* )UNTRUSTED_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(UNTRUSTED_STR )) ; } else if( ( certValidity & CertificateValidity::TIME_INVALID ) == CertificateValidity::TIME_INVALID ) { - aValidity = OUString::createFromAscii( ( const char* )TIME_INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(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(RTL_CONSTASCII_USTRINGPARAM(NOT_NESTED_TIME_STR )) ; } else if( ( certValidity & CertificateValidity::REVOKED ) == CertificateValidity::REVOKED ) { - aValidity = OUString::createFromAscii( ( const char* )REVOKED_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(REVOKED_STR )) ; } else if( ( certValidity & CertificateValidity::UNKNOWN_REVOKATION ) == CertificateValidity::UNKNOWN_REVOKATION ) { - aValidity = OUString::createFromAscii( ( const char* )UNKNOWN_REVOKATION_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(UNKNOWN_REVOKATION_STR )) ; } else if( ( certValidity & CertificateValidity::SIGNATURE_INVALID ) == CertificateValidity::SIGNATURE_INVALID ) { - aValidity = OUString::createFromAscii( ( const char* )SIGNATURE_INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(SIGNATURE_INVALID_STR )) ; } else if( ( certValidity & CertificateValidity::EXTENSION_INVALID ) == CertificateValidity::EXTENSION_INVALID ) { - aValidity = OUString::createFromAscii( ( const char* )EXTENSION_INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(EXTENSION_INVALID_STR )) ; } else if( ( certValidity & CertificateValidity::EXTENSION_UNKNOWN ) == CertificateValidity::EXTENSION_UNKNOWN ) { - aValidity = OUString::createFromAscii( ( const char* )EXTENSION_UNKNOWN_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(EXTENSION_UNKNOWN_STR )) ; } else if( ( certValidity & CertificateValidity::ISSUER_UNKNOWN ) == CertificateValidity::ISSUER_UNKNOWN ) { - aValidity = OUString::createFromAscii( ( const char* )ISSUER_UNKNOWN_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(ISSUER_UNKNOWN_STR )) ; } else if( ( certValidity & CertificateValidity::ISSUER_UNTRUSTED ) == CertificateValidity::ISSUER_UNTRUSTED ) { - aValidity = OUString::createFromAscii( ( const char* )ISSUER_UNTRUSTED_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(ISSUER_UNTRUSTED_STR )) ; } else if( ( certValidity & CertificateValidity::ISSUER_INVALID ) == CertificateValidity::ISSUER_INVALID ) { - aValidity = OUString::createFromAscii( ( const char* )ISSUER_INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(ISSUER_INVALID_STR )) ; } else if( ( certValidity & CertificateValidity::ROOT_UNKNOWN ) == CertificateValidity::ROOT_UNKNOWN ) { - aValidity = OUString::createFromAscii( ( const char* )ROOT_UNKNOWN_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(ROOT_UNKNOWN_STR )) ; } else if( ( certValidity & CertificateValidity::ROOT_UNTRUSTED ) == CertificateValidity::ROOT_UNTRUSTED ) { - aValidity = OUString::createFromAscii( ( const char* )ROOT_UNTRUSTED_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(ROOT_UNTRUSTED_STR )) ; } else if( ( certValidity & CertificateValidity::ROOT_INVALID ) == CertificateValidity::ROOT_INVALID ) { - aValidity = OUString::createFromAscii( ( const char* )ROOT_INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(ROOT_INVALID_STR )) ; } else if( ( certValidity & CertificateValidity::CHAIN_INCOMPLETE ) == CertificateValidity::CHAIN_INCOMPLETE ) { - aValidity = OUString::createFromAscii( ( const char* )CHAIN_INCOMPLETE_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(CHAIN_INCOMPLETE_STR )) ; } else { - aValidity = OUString::createFromAscii( ( const char* )INVALID_STR ) ; + aValidity = OUString(RTL_CONSTASCII_USTRINGPARAM(INVALID_STR )) ; } return aValidity ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/diagnose.cxx b/xmlsecurity/source/xmlsec/diagnose.cxx index 4c10d2f7d576..88002aa1bcb2 100644 --- a/xmlsecurity/source/xmlsec/diagnose.cxx +++ b/xmlsecurity/source/xmlsec/diagnose.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xmlstreamio.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -36,8 +34,7 @@ namespace xmlsecurity { -struct UseDiagnose : public rtl::StaticWithInit< - const bool, UseDiagnose> +struct UseDiagnose : public rtl::StaticWithInit< bool, UseDiagnose> { bool operator () () const { @@ -75,3 +72,5 @@ void xmlsec_trace(const char* pszFormat, ...) } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/diagnose.hxx b/xmlsecurity/source/xmlsec/diagnose.hxx index 691d4e277c20..33bd9cb8a6a4 100644 --- a/xmlsecurity/source/xmlsec/diagnose.hxx +++ b/xmlsecurity/source/xmlsec/diagnose.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xmlstreamio.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,3 +39,5 @@ namespace xmlsecurity #endif //XMLSECURITY_DIAGNOSE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx index 2c55bf1a4fad..6a1558108b61 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.cxx +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,112 +44,6 @@ using namespace ::com::sun::star::xml::crypto; -// ::com::sun::star::uno::Reference< XXMLSecurityTemplate > g_xErrorRecorder; -// bool g_bErrorRecorded; - -// 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; -// } -// } - extern "C" void errorCallback(const char * /*file*/, @@ -166,46 +61,16 @@ void errorCallback(const char * /*file*/, // const char * amsg = msg ? msg : ""; // 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 ( 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); -// } - -//void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& xTemplate) - void setErrorRecorder() { -// ::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 ); -// } - void clearErrorRecorder() { xmlSecErrorsSetCallback(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 8c219a5396fd..c861263a0f22 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.hxx +++ b/xmlsecurity/source/xmlsec/errorcallback.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _ERRORCALLBACK_XMLSECIMPL_HXX_ #define _ERRORCALLBACK_XMLSECIMPL_HXX_ -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> #include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> @@ -42,3 +41,4 @@ void clearErrorRecorder(); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/oid.hxx b/xmlsecurity/source/xmlsec/mscrypt/oid.hxx index 05447254175c..c46456d4dc87 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/oid.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/oid.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -156,3 +157,5 @@ OIDItem OIDs[] = { int nOID = 115; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index d4bc76e627b5..33587ab59d0b 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,13 +38,12 @@ #pragma warning(pop) #endif #include <sal/config.h> +#include <sal/macros.h> #include <osl/thread.h> #include "securityenvironment_mscryptimpl.hxx" -#ifndef _X509CERTIFICATE_NSSIMPL_HXX_ #include "x509certificate_mscryptimpl.hxx" -#endif -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <xmlsec/xmlsec.h> #include <xmlsec/keysmngr.h> @@ -55,12 +55,10 @@ #include "xmlsec/keysmngr.h" #include "xmlsec/mscrypto/akmngr.h" -//CP : added by CP #include <rtl/locale.h> #include <osl/nlsupport.h> #include <osl/process.h> -//CP : end #include <rtl/memory.h> #include "../diagnose.hxx" @@ -115,11 +113,10 @@ CertErrorToString arErrStrings[] = void traceTrustStatus(DWORD err) { - int numErrors = sizeof(arErrStrings) / sizeof(CertErrorToString); xmlsec_trace("The certificate error status is: "); if (err == 0) xmlsec_trace("%s", arErrStrings[0].name); - for (int i = 1; i < numErrors; i++) + for (int i = 1; i < SAL_N_ELEMENTS(arErrStrings); i++) { if (arErrStrings[i].error & err) xmlsec_trace("%s", arErrStrings[i].name); @@ -155,21 +152,21 @@ SecurityEnvironment_MSCryptImpl :: ~SecurityEnvironment_MSCryptImpl() { if( !m_tSymKeyList.empty() ) { std::list< HCRYPTKEY >::iterator symKeyIt ; - for( symKeyIt = m_tSymKeyList.begin() ; symKeyIt != m_tSymKeyList.end() ; symKeyIt ++ ) + for( symKeyIt = m_tSymKeyList.begin() ; symKeyIt != m_tSymKeyList.end() ; ++symKeyIt ) CryptDestroyKey( *symKeyIt ) ; } if( !m_tPubKeyList.empty() ) { std::list< HCRYPTKEY >::iterator pubKeyIt ; - for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; pubKeyIt ++ ) + for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; ++pubKeyIt ) CryptDestroyKey( *pubKeyIt ) ; } if( !m_tPriKeyList.empty() ) { std::list< HCRYPTKEY >::iterator priKeyIt ; - for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ ) + for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; ++priKeyIt ) CryptDestroyKey( *priKeyIt ) ; } @@ -205,12 +202,12 @@ Sequence< OUString > SAL_CALL SecurityEnvironment_MSCryptImpl :: getSupportedSer Sequence< OUString > SecurityEnvironment_MSCryptImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.SecurityEnvironment" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.SecurityEnvironment")) ; return seqServiceNames ; } OUString SecurityEnvironment_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl")) ; } //Helper for registry @@ -233,17 +230,15 @@ sal_Int64 SAL_CALL SecurityEnvironment_MSCryptImpl :: getSomething( const Sequen } /* XUnoTunnel extension */ + + +namespace +{ + class theSecurityEnvironment_MSCryptImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSecurityEnvironment_MSCryptImplUnoTunnelId > {}; +} + const Sequence< sal_Int8>& SecurityEnvironment_MSCryptImpl :: getUnoTunnelId() { - static Sequence< sal_Int8 >* pSeq = 0 ; - if( !pSeq ) { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; - if( !pSeq ) { - static Sequence< sal_Int8> aSeq( 16 ) ; - rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; - pSeq = &aSeq ; - } - } - return *pSeq ; + return theSecurityEnvironment_MSCryptImplUnoTunnelId::get().getSeq(); } /* XUnoTunnel extension */ @@ -267,12 +262,6 @@ void SecurityEnvironment_MSCryptImpl :: setCryptoProvider( HCRYPTPROV aProv ) th } if( aProv != NULL ) { - /*- Replaced by direct adopt for WINNT support ---- - if( !CryptContextAddRef( aProv, NULL, NULL ) ) - throw Exception() ; - else - m_hProv = aProv ; - ----*/ m_hProv = aProv ; } } @@ -323,16 +312,12 @@ void SecurityEnvironment_MSCryptImpl :: adoptSymKey( HCRYPTKEY aSymKey ) throw( if( aSymKey != NULL ) { //First try to find the key in the list - for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; ++keyIt ) { if( *keyIt == aSymKey ) return ; } //If we do not find the key in the list, add a new node - /*- Replaced with directly adopt for WINNT 4.0 support ---- - if( !CryptDuplicateKey( aSymKey, NULL, 0, &symkey ) ) - throw RuntimeException() ; - ----*/ symkey = aSymKey ; try { @@ -348,7 +333,7 @@ void SecurityEnvironment_MSCryptImpl :: rejectSymKey( HCRYPTKEY aSymKey ) throw( std::list< HCRYPTKEY >::iterator keyIt ; if( aSymKey != NULL ) { - for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; ++keyIt ) { if( *keyIt == aSymKey ) { symkey = *keyIt ; CryptDestroyKey( symkey ) ; @@ -365,7 +350,7 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getSymKey( unsigned int position ) unsigned int pos ; symkey = NULL ; - for( pos = 0, keyIt = m_tSymKeyList.begin() ; pos < position && keyIt != m_tSymKeyList.end() ; pos ++ , keyIt ++ ) ; + for( pos = 0, keyIt = m_tSymKeyList.begin() ; pos < position && keyIt != m_tSymKeyList.end() ; ++pos , ++keyIt ) ; if( pos == position && keyIt != m_tSymKeyList.end() ) symkey = *keyIt ; @@ -379,16 +364,12 @@ void SecurityEnvironment_MSCryptImpl :: adoptPubKey( HCRYPTKEY aPubKey ) throw( if( aPubKey != NULL ) { //First try to find the key in the list - for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; ++keyIt ) { if( *keyIt == aPubKey ) return ; } //If we do not find the key in the list, add a new node - /*- Replaced with directly adopt for WINNT 4.0 support ---- - if( !CryptDuplicateKey( aPubKey, NULL, 0, &pubkey ) ) - throw RuntimeException() ; - ----*/ pubkey = aPubKey ; try { @@ -404,7 +385,7 @@ void SecurityEnvironment_MSCryptImpl :: rejectPubKey( HCRYPTKEY aPubKey ) throw( std::list< HCRYPTKEY >::iterator keyIt ; if( aPubKey != NULL ) { - for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; ++keyIt ) { if( *keyIt == aPubKey ) { pubkey = *keyIt ; CryptDestroyKey( pubkey ) ; @@ -421,7 +402,7 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getPubKey( unsigned int position ) unsigned int pos ; pubkey = NULL ; - for( pos = 0, keyIt = m_tPubKeyList.begin() ; pos < position && keyIt != m_tPubKeyList.end() ; pos ++ , keyIt ++ ) ; + for( pos = 0, keyIt = m_tPubKeyList.begin() ; pos < position && keyIt != m_tPubKeyList.end() ; ++pos , ++keyIt ) ; if( pos == position && keyIt != m_tPubKeyList.end() ) pubkey = *keyIt ; @@ -435,16 +416,12 @@ void SecurityEnvironment_MSCryptImpl :: adoptPriKey( HCRYPTKEY aPriKey ) throw( if( aPriKey != NULL ) { //First try to find the key in the list - for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; ++keyIt ) { if( *keyIt == aPriKey ) return ; } //If we do not find the key in the list, add a new node - /*- Replaced with directly adopt for WINNT 4.0 support ---- - if( !CryptDuplicateKey( aPriKey, NULL, 0, &prikey ) ) - throw RuntimeException() ; - ----*/ prikey = aPriKey ; try { @@ -460,7 +437,7 @@ void SecurityEnvironment_MSCryptImpl :: rejectPriKey( HCRYPTKEY aPriKey ) throw( std::list< HCRYPTKEY >::iterator keyIt ; if( aPriKey != NULL ) { - for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; ++keyIt ) { if( *keyIt == aPriKey ) { prikey = *keyIt ; CryptDestroyKey( prikey ) ; @@ -477,7 +454,7 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getPriKey( unsigned int position ) unsigned int pos ; prikey = NULL ; - for( pos = 0, keyIt = m_tPriKeyList.begin() ; pos < position && keyIt != m_tPriKeyList.end() ; pos ++ , keyIt ++ ) ; + for( pos = 0, keyIt = m_tPriKeyList.begin() ; pos < position && keyIt != m_tPriKeyList.end() ; ++pos , ++keyIt ) ; if( pos == position && keyIt != m_tPriKeyList.end() ) prikey = *keyIt ; @@ -516,21 +493,12 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPer DWORD dwKeySpec; HCRYPTPROV hCryptProv; - /* - hSystemKeyStore = CertOpenStore( - CERT_STORE_PROV_SYSTEM , - 0 , - NULL , - CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_READONLY_FLAG | CERT_STORE_OPEN_EXISTING_FLAG , - L"MY" - ) ; - */ hSystemKeyStore = CertOpenSystemStore( 0, "MY" ) ; if( hSystemKeyStore != NULL ) { pCertContext = CertEnumCertificatesInStore( hSystemKeyStore, pCertContext ); while (pCertContext) { - // Add By CP for checking whether the certificate is a personal certificate or not. + // for checking whether the certificate is a personal certificate or not. if(!(CryptAcquireCertificatePrivateKey(pCertContext, CRYPT_ACQUIRE_COMPARE_KEY_FLAG, NULL, @@ -538,13 +506,12 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPer &dwKeySpec, NULL))) { - // Not Privatekey found. SKIP this one; By CP + // Not Privatekey found. SKIP this one. pCertContext = CertEnumCertificatesInStore( hSystemKeyStore, pCertContext ); continue; } // then TODO : Check the personal cert is valid or not. - // end CP xcert = MswcryCertContextToXCert( pCertContext ) ; if( xcert != NULL ) certsList.push_back( xcert ) ; @@ -561,7 +528,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPer std::list< X509Certificate_MSCryptImpl* >::iterator xcertIt ; Sequence< Reference< XCertificate > > certSeq( length ) ; - for( i = 0, xcertIt = certsList.begin(); xcertIt != certsList.end(); xcertIt ++, i++ ) { + for( i = 0, xcertIt = certsList.begin(); xcertIt != certsList.end(); ++xcertIt, ++i ) { certSeq[i] = *xcertIt ; } @@ -574,7 +541,6 @@ 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 ; X509Certificate_MSCryptImpl *xcert = NULL ; PCCERT_CONTEXT pCertContext = NULL ; @@ -582,12 +548,11 @@ Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( con CRYPT_INTEGER_BLOB cryptSerialNumber ; CERT_INFO certInfo ; - // By CP , for correct encoding + // for correct encoding sal_uInt16 encoding ; rtl_Locale *pLocale = NULL ; osl_getProcessLocale( &pLocale ) ; encoding = osl_getTextEncodingFromLocale( pLocale ) ; - // CP end //Create cert info from issue and serial rtl::OString oissuer = rtl::OUStringToOString( issuerName , encoding ) ; @@ -1214,7 +1179,7 @@ X509Certificate_MSCryptImpl* MswcryCertContextToXCert( PCCERT_CONTEXT cert ) ::rtl::OUString SecurityEnvironment_MSCryptImpl::getSecurityEnvironmentInformation() throw( ::com::sun::star::uno::RuntimeException ) { - return rtl::OUString::createFromAscii("Microsoft Crypto API"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Microsoft Crypto API")); } /* Native methods */ @@ -1310,3 +1275,5 @@ void SecurityEnvironment_MSCryptImpl :: destroyKeysManager(xmlSecKeysMngrPtr pKe xmlSecKeysMngrDestroy( pKeysMngr ) ; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx index 7d6f21ce1551..c35cd7621a79 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,14 +43,10 @@ #include <cppuhelper/implbase4.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/security/XCertificate.hpp> @@ -96,26 +93,43 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4< virtual ~SecurityEnvironment_MSCryptImpl() ; //Methods from XSecurityEnvironment - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL getPersonalCertificates() throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL getPersonalCertificates() + throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::com::sun::star::uno::Sequence< sal_Int8 >& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( + const ::rtl::OUString& issuerName, + const ::com::sun::star::uno::Sequence< sal_Int8 >& serialNumber ) + throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::rtl::OUString& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( + const ::rtl::OUString& issuerName, + const ::rtl::OUString& serialNumber ) + throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL buildCertificatePath( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& beginCert ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL buildCertificatePath( + const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& beginCert ) + throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromRaw( const ::com::sun::star::uno::Sequence< sal_Int8 >& rawCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromRaw( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rawCertificate ) + throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - 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 ::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( 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) 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); + 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 @@ -138,9 +152,12 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4< static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; //Helper for registry - 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::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 ) ; + 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 ) @@ -151,41 +168,30 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4< //Native mehtods virtual HCRYPTPROV getCryptoProvider() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void setCryptoProvider( HCRYPTPROV aProv ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual LPCTSTR getKeyContainer() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void setKeyContainer( LPCTSTR aKeyContainer ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual HCERTSTORE getCryptoSlot() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void setCryptoSlot( HCERTSTORE aKeyStore ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual HCERTSTORE getCertDb() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void setCertDb( HCERTSTORE aCertDb ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void adoptSymKey( HCRYPTKEY aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void rejectSymKey( HCRYPTKEY aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual HCRYPTKEY getSymKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void adoptPubKey( HCRYPTKEY aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void rejectPubKey( HCRYPTKEY aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual HCRYPTKEY getPubKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void adoptPriKey( HCRYPTKEY aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void rejectPriKey( HCRYPTKEY aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual HCRYPTKEY getPriKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void enableDefaultCrypt( sal_Bool enable ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual sal_Bool defaultEnabled() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; //Native mehtods @@ -196,3 +202,4 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4< #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 43c0bc53cb22..72063a140240 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -236,3 +237,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl::getSupported return SEInitializer_MSCryptImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx index 8acd41dfa539..1553155c9e37 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #define _SEINITIALIZERIMPL_HXX #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> -#ifndef _COM_SUN_STAR_XML_CRYPTO_SEINITIALIZER_HPP_ #include <com/sun/star/xml/crypto/XSEInitializer.hpp> -#endif #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -55,9 +54,6 @@ class SEInitializer_MSCryptImpl : public cppu::WeakImplHelper2 * instance. After this instance is used up, use this class to free this * instance. * - * HISTORY - * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -106,3 +102,4 @@ SAL_CALL SEInitializer_MSCryptImpl_createInstance( const com::sun::star::uno::Re #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index fd3f0aca0952..ea2f8ce27e73 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,23 +29,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlsecurity.hxx" #include <sal/config.h> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include "x509certificate_mscryptimpl.hxx" #include "certificateextension_xmlsecimpl.hxx" #include "sanextension_mscryptimpl.hxx" -//MM : added by MM #include "oid.hxx" -//MM : end -//CP : added by CP #include <rtl/locale.h> #include <osl/nlsupport.h> #include <osl/process.h> #include <utility> -//CP : end - using namespace ::com::sun::star::uno ; using namespace ::com::sun::star::security ; using ::rtl::OUString ; @@ -241,15 +237,14 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su throw RuntimeException() ; } - // By CP , for correct encoding + // for correct encoding sal_uInt16 encoding ; rtl_Locale *pLocale = NULL ; osl_getProcessLocale( &pLocale ) ; encoding = osl_getTextEncodingFromLocale( pLocale ) ; - // CP end if(issuer[cbIssuer-1] == 0) cbIssuer--; //delimit the last 0x00; - OUString xIssuer(issuer , cbIssuer ,encoding ) ; //By CP + OUString xIssuer(issuer , cbIssuer ,encoding ) ; delete [] issuer ; return replaceTagSWithTagST(xIssuer); @@ -494,17 +489,14 @@ sal_Int64 SAL_CALL X509Certificate_MSCryptImpl :: getSomething( const Sequence< } /* XUnoTunnel extension */ + +namespace +{ + class theX509Certificate_MSCryptImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theX509Certificate_MSCryptImplUnoTunnelId > {}; +} + const Sequence< sal_Int8>& X509Certificate_MSCryptImpl :: getUnoTunnelId() { - static Sequence< sal_Int8 >* pSeq = 0 ; - if( !pSeq ) { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; - if( !pSeq ) { - static Sequence< sal_Int8> aSeq( 16 ) ; - rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; - pSeq = &aSeq ; - } - } - return *pSeq ; + return theX509Certificate_MSCryptImplUnoTunnelId::get().getSeq(); } /* XUnoTunnel extension */ @@ -516,7 +508,6 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( c return NULL ; } -// MM : added by MM ::rtl::OUString findOIDDescription(char *oid) { OUString ouOID = OUString::createFromAscii( oid ); @@ -662,5 +653,4 @@ sal_Int32 SAL_CALL X509Certificate_MSCryptImpl::getCertificateUsage( ) return usage; } -// MM : end - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx index 209a8a6ce10d..4fc3a0260d15 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,43 +61,27 @@ class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper2< virtual sal_Int16 SAL_CALL getVersion() throw ( ::com::sun::star::uno::RuntimeException) ; virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSerialNumber() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::rtl::OUString SAL_CALL getIssuerName() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::rtl::OUString SAL_CALL getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidBefore() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidAfter() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getIssuerUniqueID() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectUniqueID() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL getExtensions() throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getEncoded() throw ( ::com::sun::star::uno::RuntimeException) ; - - // MM : added by MM virtual ::rtl::OUString SAL_CALL getSubjectPublicKeyAlgorithm() throw ( ::com::sun::star::uno::RuntimeException) ; - 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 //Methods from XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (com::sun::star::uno::RuntimeException); @@ -112,3 +97,4 @@ class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper2< #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 e30eabfb279e..7e04922939e2 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,17 +33,11 @@ #include <rtl/uuid.h> #include "xmlencryption_mscryptimpl.hxx" -#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmldocumentwrapper_xmlsecimpl.hxx" -#endif -#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmlelementwrapper_xmlsecimpl.hxx" -#endif -#ifndef _SECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ #include "securityenvironment_mscryptimpl.hxx" -#endif #include "errorcallback.hxx" #include "xmlsec/xmlsec.h" @@ -368,12 +363,12 @@ Sequence< OUString > SAL_CALL XMLEncryption_MSCryptImpl :: getSupportedServiceNa Sequence< OUString > XMLEncryption_MSCryptImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLEncryption" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLEncryption")) ; return seqServiceNames ; } OUString XMLEncryption_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl")) ; } //Helper for registry @@ -388,3 +383,4 @@ Reference< XSingleServiceFactory > XMLEncryption_MSCryptImpl :: impl_createFacto return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx index fdc3d0ff41f8..539c9afff55f 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XXMLEncryption.hpp> #include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> @@ -100,3 +97,4 @@ class XMLEncryption_MSCryptImpl : public ::cppu::WeakImplHelper3< #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 034bb70c591a..2a8983216e17 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,12 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlsecurity.hxx" #include <sal/config.h> -#include <rtl/uuid.h> #include "securityenvironment_mscryptimpl.hxx" -#ifndef _XMLSECURITYCONTEXT_MSCRYPTIMPL_HXX_ #include "xmlsecuritycontext_mscryptimpl.hxx" -#endif #include "xmlstreamio.hxx" #include "xmlsec/xmlsec.h" @@ -133,126 +131,6 @@ void SAL_CALL XMLSecurityContext_MSCryptImpl::setDefaultSecurityEnvironmentIndex //dummy } -#if 0 -/* XXMLSecurityContext */ -void SAL_CALL XMLSecurityContext_MSCryptImpl :: setSecurityEnvironment( const Reference< XSecurityEnvironment >& aSecurityEnvironment ) throw( com::sun::star::security::SecurityInfrastructureException ) { - HCERTSTORE hkeyStore ; - HCERTSTORE hCertStore ; - HCRYPTKEY symKey ; - HCRYPTKEY pubKey ; - HCRYPTKEY priKey ; - unsigned int i ; - - if( !aSecurityEnvironment.is() ) - throw RuntimeException() ; - - m_xSecurityEnvironment = aSecurityEnvironment ; - - //Clear key manager - if( m_pKeysMngr != NULL ) { - xmlSecKeysMngrDestroy( m_pKeysMngr ) ; - m_pKeysMngr = NULL ; - } - - //Create key manager - Reference< XUnoTunnel > xEnvTunnel( m_xSecurityEnvironment , UNO_QUERY ) ; - if( !xEnvTunnel.is() ) { - throw RuntimeException() ; - } - - SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; - if( pSecEnv == NULL ) - throw RuntimeException() ; - - hkeyStore = pSecEnv->getCryptoSlot() ; - hCertStore = pSecEnv->getCertDb() ; - - /*- - * The following lines is based on the of xmlsec-mscrypto crypto engine - */ - m_pKeysMngr = xmlSecMSCryptoAppliedKeysMngrCreate( hkeyStore , hCertStore ) ; - if( m_pKeysMngr == NULL ) - throw RuntimeException() ; - - /*- - * Adopt symmetric key into keys manager - */ - for( i = 0 ; ( symKey = pSecEnv->getSymKey( i ) ) != NULL ; i ++ ) { - if( xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( m_pKeysMngr, symKey ) < 0 ) { - throw RuntimeException() ; - } - } - - /*- - * Adopt asymmetric public key into keys manager - */ - for( i = 0 ; ( pubKey = pSecEnv->getPubKey( i ) ) != NULL ; i ++ ) { - if( xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( m_pKeysMngr, pubKey ) < 0 ) { - throw RuntimeException() ; - } - } - - /*- - * Adopt asymmetric private key into keys manager - */ - for( i = 0 ; ( priKey = pSecEnv->getPriKey( i ) ) != NULL ; i ++ ) { - if( xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( m_pKeysMngr, priKey ) < 0 ) { - throw RuntimeException() ; - } - } - - /*- - * Adopt system default certificate store. - */ - if( pSecEnv->defaultEnabled() ) { - HCERTSTORE hSystemStore ; - - //Add system key store into the keys manager. - hSystemStore = CertOpenSystemStore( 0, "MY" ) ; - if( hSystemStore != NULL ) { - if( xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore( m_pKeysMngr, hSystemStore ) < 0 ) { - CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; - throw RuntimeException() ; - } - } - - //Add system root store into the keys manager. - hSystemStore = CertOpenSystemStore( 0, "Root" ) ; - if( hSystemStore != NULL ) { - if( xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) { - CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; - throw RuntimeException() ; - } - } - - //Add system trusted store into the keys manager. - hSystemStore = CertOpenSystemStore( 0, "Trust" ) ; - if( hSystemStore != NULL ) { - if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) { - CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; - throw RuntimeException() ; - } - } - - //Add system CA store into the keys manager. - hSystemStore = CertOpenSystemStore( 0, "CA" ) ; - if( hSystemStore != NULL ) { - if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) { - CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; - throw RuntimeException() ; - } - } - } -} - -/* XXMLSecurityContext */ -Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSecurityEnvironment() - throw (RuntimeException) -{ - return m_xSecurityEnvironment ; -} -#endif - /* XInitialization */ void SAL_CALL XMLSecurityContext_MSCryptImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { // TBD @@ -283,12 +161,12 @@ Sequence< OUString > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSupportedServ Sequence< OUString > XMLSecurityContext_MSCryptImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSecurityContext" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSecurityContext")) ; return seqServiceNames ; } OUString XMLSecurityContext_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl")) ; } //Helper for registry @@ -303,43 +181,4 @@ Reference< XSingleServiceFactory > XMLSecurityContext_MSCryptImpl :: impl_create return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } -#if 0 -/* XUnoTunnel */ -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 ) ) { - return ( sal_Int64 )this ; - } - return 0 ; -} - -/* XUnoTunnel extension */ -const Sequence< sal_Int8>& XMLSecurityContext_MSCryptImpl :: getUnoTunnelId() { - static Sequence< sal_Int8 >* pSeq = 0 ; - if( !pSeq ) { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; - if( !pSeq ) { - static Sequence< sal_Int8> aSeq( 16 ) ; - rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; - pSeq = &aSeq ; - } - } - return *pSeq ; -} - -/* XUnoTunnel extension */ -XMLSecurityContext_MSCryptImpl* XMLSecurityContext_MSCryptImpl :: getImplementation( const Reference< XInterface > xObj ) { - Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; - if( xUT.is() ) { - return ( XMLSecurityContext_MSCryptImpl* )xUT->getSomething( getUnoTunnelId() ) ; - } else - return NULL ; -} - -/* Native methods */ -xmlSecKeysMngrPtr XMLSecurityContext_MSCryptImpl :: keysManager() throw( Exception, RuntimeException ) { - return m_pKeysMngr ; -} -#endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx index b6ad409ad4be..dfc8217aa957 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,20 +35,15 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> -//#include "xmlsec/xmlsec.h" class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3< ::com::sun::star::xml::crypto::XXMLSecurityContext , @@ -135,3 +131,4 @@ class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3< #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 80db62742f24..eb1dd5615065 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,21 +33,11 @@ #include "com/sun/star/xml/crypto/SecurityOperationStatus.hdl" #include "xmlsignature_mscryptimpl.hxx" - -#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmldocumentwrapper_xmlsecimpl.hxx" -#endif - -#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmlelementwrapper_xmlsecimpl.hxx" -#endif - -#ifndef _SECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ #include "securityenvironment_mscryptimpl.hxx" -#endif #include "xmlstreamio.hxx" #include "errorcallback.hxx" - #include "xmlsec/xmlsec.h" #include "xmlsec/xmldsig.h" #include "xmlsec/crypto.h" @@ -180,7 +171,6 @@ SAL_CALL XMLSignature_MSCryptImpl :: validate( xmlSecKeysMngrPtr pMngr = NULL ; xmlSecDSigCtxPtr pDsigCtx = NULL ; xmlNodePtr pNode = NULL ; - //sal_Bool valid ; if( !aTemplate.is() ) throw RuntimeException() ; @@ -225,15 +215,6 @@ SAL_CALL XMLSignature_MSCryptImpl :: validate( throw RuntimeException() ; } - //added for test: save the result - /* - { - FILE *dstFile = fopen( "c:\\1.txt", "w" ) ; - xmlDocDump( dstFile, pNode->doc) ; - fclose( dstFile ) ; - } - */ - setErrorRecorder( ); pMngr = pSecEnv->createKeysManager() ; //i39448 @@ -246,7 +227,6 @@ SAL_CALL XMLSignature_MSCryptImpl :: validate( if( pDsigCtx == NULL ) { pSecEnv->destroyKeysManager( pMngr ) ; //i39448 - //throw XMLSignatureException() ; clearErrorRecorder(); return aTemplate; } @@ -312,12 +292,12 @@ Sequence< OUString > SAL_CALL XMLSignature_MSCryptImpl :: getSupportedServiceNam Sequence< OUString > XMLSignature_MSCryptImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignature" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignature")) ; return seqServiceNames ; } OUString XMLSignature_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl")) ; } //Helper for registry @@ -326,9 +306,7 @@ Reference< XInterface > SAL_CALL XMLSignature_MSCryptImpl :: impl_createInstance } Reference< XSingleServiceFactory > XMLSignature_MSCryptImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { - //Reference< XSingleServiceFactory > xFactory ; - //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; - //return xFactory ; return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx index 5f5178773221..d31050484548 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XXMLSignature.hpp> #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> @@ -100,3 +97,4 @@ class XMLSignature_MSCryptImpl : public ::cppu::WeakImplHelper3< #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 8044cd403c83..4d6dbd52d88d 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ void* SAL_CALL mscrypt_component_getFactory( const sal_Char* pImplName , void* p } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/certerrors.h b/xmlsecurity/source/xmlsec/nss/certerrors.h index 9b9801f21f59..d91fff52923d 100644 --- a/xmlsecurity/source/xmlsec/nss/certerrors.h +++ b/xmlsecurity/source/xmlsec/nss/certerrors.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: securityenvironment_nssimpl.cxx,v $ - * $Revision: 1.23 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -28,7 +26,6 @@ * ************************************************************************/ - {SEC_ERROR_IO, "An I/O error occurred during security authorization."}, {SEC_ERROR_LIBRARY_FAILURE, "security library failure."}, @@ -370,7 +367,12 @@ an existing cert, but that is not the same cert."}, {SEC_ERROR_BAD_INFO_ACCESS_LOCATION, "Bad information access location in cert extension"}, -{SEC_ERROR_LIBPKIX_INTERNAL, "Libpkix internal error occured during cert validation."}, +{SEC_ERROR_LIBPKIX_INTERNAL, "Libpkix internal error occurred during cert validation."}, + +#if ( NSS_VMAJOR > 3 ) || ( NSS_VMAJOR == 3 && NSS_VMINOR > 12 ) || ( NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH > 2 ) +// following 3 errors got first used in NSS 3.12.3 +// they were in the header even in 3.12.2 but there was missing the mapping in pk11err.c +// see also https://bugzilla.mozilla.org/show_bug.cgi?id=453364 {SEC_ERROR_PKCS11_GENERAL_ERROR, "A PKCS #11 module returned CKR_GENERAL_ERROR, indicating that an unrecoverable error has occurred."}, @@ -378,7 +380,15 @@ an existing cert, but that is not the same cert."}, {SEC_ERROR_PKCS11_DEVICE_ERROR, "A PKCS #11 module returned CKR_DEVICE_ERROR, indicating that a problem has occurred with the token or slot."}, +#endif + +#if ( NSS_VMAJOR > 3 ) || ( NSS_VMAJOR == 3 && NSS_VMINOR > 12 ) || ( NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH > 3 ) +// following 2 errors got added in NSS 3.12.4 + {SEC_ERROR_BAD_INFO_ACCESS_METHOD, "Unknown information access method in certificate extension."}, {SEC_ERROR_CRL_IMPORT_FAILED, "Error attempting to import a CRL."}, +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/makefile.mk b/xmlsecurity/source/xmlsec/nss/makefile.mk index 5e968a334ed5..ce088e2bb3dc 100644 --- a/xmlsecurity/source/xmlsec/nss/makefile.mk +++ b/xmlsecurity/source/xmlsec/nss/makefile.mk @@ -85,21 +85,6 @@ INCPOST += \ $(MOZ_INC)$/profile \ -I$(MOZ_INC)$/string \ -I$(MOZ_INC)$/embed_base -#.IF "$(OS)" == "LINUX" -#CFLAGS += -fPIC -g -#CFLAGSCXX += \ -# -fno-rtti -Wall -Wconversion -Wpointer-arith \ -# -Wbad-function-cast -Wcast-align -Woverloaded-virtual -Wsynth \ -# -Wno-long-long -pthread -#CDEFS += -DTRACING -#.ELIF "$(OS)" == "NETBSD" -#CFLAGS += -fPIC -#CFLAGSCXX += \ -# -fno-rtti -Wall -Wconversion -Wpointer-arith \ -# -Wbad-function-cast -Wcast-align -Woverloaded-virtual -Wsynth \ -# -Wno-long-long -#CDEFS += -DTRACING -#.ENDIF .ENDIF .IF "$(CRYPTO_ENGINE)" == "nss" diff --git a/xmlsecurity/source/xmlsec/nss/nssrenam.h b/xmlsecurity/source/xmlsec/nss/nssrenam.h index 1742e1492d35..bc3249e1bfc4 100644 --- a/xmlsecurity/source/xmlsec/nss/nssrenam.h +++ b/xmlsecurity/source/xmlsec/nss/nssrenam.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file @@ -47,3 +48,5 @@ #define PBE_GenerateBits __PBE_GenerateBits #endif /* __nssrenam_h_ */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/secerror.cxx b/xmlsecurity/source/xmlsec/nss/secerror.cxx index 4a9ee3622bc4..34c9421bf1fb 100644 --- a/xmlsecurity/source/xmlsec/nss/secerror.cxx +++ b/xmlsecurity/source/xmlsec/nss/secerror.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: securityenvironment_nssimpl.cxx,v $ - * $Revision: 1.23 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,6 +31,7 @@ #include "sslerr.h" #include "nspr.h" #include "certt.h" +#include <sal/macros.h> #include "../diagnose.hxx" @@ -60,7 +59,7 @@ const char * getCertError(PRErrorCode errNum) { static char sEmpty[] = ""; - const int numDesc = sizeof(allDesc) / sizeof(ErrDesc); + const int numDesc = SAL_N_ELEMENTS(allDesc); for (int i = 0; i < numDesc; i++) { if (allDesc[i].errNum == errNum) @@ -73,7 +72,6 @@ getCertError(PRErrorCode errNum) void printChainFailure(CERTVerifyLog *log) { - unsigned long errorFlags = 0; unsigned int depth = (unsigned int)-1; const char * specificError = NULL; const char * issuer = NULL; @@ -82,6 +80,7 @@ printChainFailure(CERTVerifyLog *log) if (log->count > 0) { xmlsec_trace("Bad certifcation path:"); + unsigned long errorFlags = 0; for (node = log->head; node; node = node->next) { if (depth != node->depth) @@ -163,3 +162,5 @@ printChainFailure(CERTVerifyLog *log) } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/secerror.hxx b/xmlsecurity/source/xmlsec/nss/secerror.hxx index 732fef5fd03e..79878d14daaa 100644 --- a/xmlsecurity/source/xmlsec/nss/secerror.hxx +++ b/xmlsecurity/source/xmlsec/nss/secerror.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: securityenvironment_nssimpl.hxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -38,3 +36,4 @@ void printChainFailure(CERTVerifyLog *log); #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 ca99ee379a9c..cb740e5d3ede 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,10 @@ #include "ocsp.h" #include <sal/config.h> +#include <sal/macros.h> #include "securityenvironment_nssimpl.hxx" #include "x509certificate_nssimpl.hxx" -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include "../diagnose.hxx" #include <sal/types.h> @@ -65,7 +67,7 @@ #include "secerror.hxx" -// MM : added for password exception +// added for password exception #include <com/sun/star/security/NoPasswordException.hpp> namespace csss = ::com::sun::star::security; using namespace xmlsecurity; @@ -120,7 +122,7 @@ char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) if ( xMSF.is() ) { uno::Reference < task::XInteractionHandler > xInteractionHandler( - xMSF->createInstance( rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler") ), uno::UNO_QUERY ); + xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler")) ), uno::UNO_QUERY ); if ( xInteractionHandler.is() ) { @@ -163,21 +165,21 @@ SecurityEnvironment_NssImpl :: ~SecurityEnvironment_NssImpl() { if( !m_tSymKeyList.empty() ) { std::list< PK11SymKey* >::iterator symKeyIt ; - for( symKeyIt = m_tSymKeyList.begin() ; symKeyIt != m_tSymKeyList.end() ; symKeyIt ++ ) + for( symKeyIt = m_tSymKeyList.begin() ; symKeyIt != m_tSymKeyList.end() ; ++symKeyIt ) PK11_FreeSymKey( *symKeyIt ) ; } if( !m_tPubKeyList.empty() ) { std::list< SECKEYPublicKey* >::iterator pubKeyIt ; - for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; pubKeyIt ++ ) + for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; ++pubKeyIt ) SECKEY_DestroyPublicKey( *pubKeyIt ) ; } if( !m_tPriKeyList.empty() ) { std::list< SECKEYPrivateKey* >::iterator priKeyIt ; - for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ ) + for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; ++priKeyIt ) SECKEY_DestroyPrivateKey( *priKeyIt ) ; } } @@ -212,12 +214,12 @@ Sequence< OUString > SAL_CALL SecurityEnvironment_NssImpl :: getSupportedService Sequence< OUString > SecurityEnvironment_NssImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.SecurityEnvironment" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.SecurityEnvironment")) ; return seqServiceNames ; } OUString SecurityEnvironment_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl")) ; } //Helper for registry @@ -226,9 +228,6 @@ Reference< XInterface > SAL_CALL SecurityEnvironment_NssImpl :: impl_createInsta } Reference< XSingleServiceFactory > SecurityEnvironment_NssImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { - //Reference< XSingleServiceFactory > xFactory ; - //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; - //return xFactory ; return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } @@ -243,17 +242,14 @@ sal_Int64 SAL_CALL SecurityEnvironment_NssImpl :: getSomething( const Sequence< } /* XUnoTunnel extension */ + +namespace +{ + class theSecurityEnvironment_NssImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSecurityEnvironment_NssImplUnoTunnelId > {}; +} + const Sequence< sal_Int8>& SecurityEnvironment_NssImpl :: getUnoTunnelId() { - static Sequence< sal_Int8 >* pSeq = 0 ; - if( !pSeq ) { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; - if( !pSeq ) { - static Sequence< sal_Int8> aSeq( 16 ) ; - rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; - pSeq = &aSeq ; - } - } - return *pSeq ; + return theSecurityEnvironment_NssImplUnoTunnelId::get().getSeq(); } /* XUnoTunnel extension */ @@ -300,7 +296,7 @@ void SecurityEnvironment_NssImpl :: adoptSymKey( PK11SymKey* aSymKey ) throw( Ex if( aSymKey != NULL ) { //First try to find the key in the list - for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; ++keyIt ) { if( *keyIt == aSymKey ) return ; } @@ -323,7 +319,7 @@ void SecurityEnvironment_NssImpl :: rejectSymKey( PK11SymKey* aSymKey ) throw( E std::list< PK11SymKey* >::iterator keyIt ; if( aSymKey != NULL ) { - for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; ++keyIt ) { if( *keyIt == aSymKey ) { symkey = *keyIt ; PK11_FreeSymKey( symkey ) ; @@ -354,7 +350,7 @@ void SecurityEnvironment_NssImpl :: adoptPubKey( SECKEYPublicKey* aPubKey ) thro if( aPubKey != NULL ) { //First try to find the key in the list - for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; ++keyIt ) { if( *keyIt == aPubKey ) return ; } @@ -377,7 +373,7 @@ void SecurityEnvironment_NssImpl :: rejectPubKey( SECKEYPublicKey* aPubKey ) thr std::list< SECKEYPublicKey* >::iterator keyIt ; if( aPubKey != NULL ) { - for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; ++keyIt ) { if( *keyIt == aPubKey ) { pubkey = *keyIt ; SECKEY_DestroyPublicKey( pubkey ) ; @@ -408,7 +404,7 @@ void SecurityEnvironment_NssImpl :: adoptPriKey( SECKEYPrivateKey* aPriKey ) thr if( aPriKey != NULL ) { //First try to find the key in the list - for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; ++keyIt ) { if( *keyIt == aPriKey ) return ; } @@ -431,7 +427,7 @@ void SecurityEnvironment_NssImpl :: rejectPriKey( SECKEYPrivateKey* aPriKey ) th std::list< SECKEYPrivateKey* >::iterator keyIt ; if( aPriKey != NULL ) { - for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; ++keyIt ) { if( *keyIt == aPriKey ) { prikey = *keyIt ; SECKEY_DestroyPrivateKey( prikey ) ; @@ -558,7 +554,7 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException if( !m_tPriKeyList.empty() ) { std::list< SECKEYPrivateKey* >::iterator priKeyIt ; - for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ ) { + for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; ++priKeyIt ) { xcert = NssPrivKeyToXCert( *priKeyIt ) ; if( xcert != NULL ) certsList.push_back( xcert ) ; @@ -571,7 +567,7 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException std::list< X509Certificate_NssImpl* >::iterator xcertIt ; Sequence< Reference< XCertificate > > certSeq( length ) ; - for( i = 0, xcertIt = certsList.begin(); xcertIt != certsList.end(); xcertIt ++, i++ ) { + for( i = 0, xcertIt = certsList.begin(); xcertIt != certsList.end(); ++xcertIt, ++i ) { certSeq[i] = *xcertIt ; } @@ -597,55 +593,14 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O if( arena == NULL ) throw RuntimeException() ; - /* - * 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; - do - { - OUString aToken = issuerName.getToken( 0, ',', nIndex ).trim(); - if (aToken.compareToAscii("S=",2) == 0) - { - newIssuerName+=OUString::createFromAscii("ST="); - newIssuerName+=aToken.copy(2); - } - else - { - newIssuerName+=aToken; - } - - if (nIndex >= 0) - { - newIssuerName+=OUString::createFromAscii(","); - } - } while ( nIndex >= 0 ); - */ - - /* end */ - - //Create cert info from issue and serial + // 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() ) ; nmIssuer = CERT_AsciiToName( chIssuer ) ; if( nmIssuer == NULL ) { PL_strfree( chIssuer ) ; PORT_FreeArena( arena, PR_FALSE ) ; - - /* - * i40394 - * - * mmi : no need to throw exception - * just return "no found" - */ - //throw RuntimeException() ; - return NULL; + return NULL; // no need for exception cf. i40394 } derIssuer = SEC_ASN1EncodeItem( arena, NULL, ( void* )nmIssuer, SEC_ASN1_GET( CERT_NameTemplate ) ) ; @@ -852,9 +807,13 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, CERT_DisableOCSPDefaultResponder(certDb); CERTValOutParam cvout[5]; CERTValInParam cvin[3]; + int ncvinCount=0; - cvin[0].type = cert_pi_useAIACertFetch; - cvin[0].value.scalar.b = PR_TRUE; +#if ( NSS_VMAJOR > 3 ) || ( NSS_VMAJOR == 3 && NSS_VMINOR > 12 ) || ( NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH > 0 ) + cvin[ncvinCount].type = cert_pi_useAIACertFetch; + cvin[ncvinCount].value.scalar.b = PR_TRUE; + ncvinCount++; +#endif PRUint64 revFlagsLeaf[2]; PRUint64 revFlagsChain[2]; @@ -884,7 +843,6 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, rev.leafTests.preferred_methods = NULL; 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; @@ -898,15 +856,16 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, rev.chainTests.preferred_methods = NULL; rev.chainTests.cert_rev_method_independent_flags = CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST; -// | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE; - cvin[1].type = cert_pi_revocationFlags; - cvin[1].value.pointer.revocation = &rev; + cvin[ncvinCount].type = cert_pi_revocationFlags; + cvin[ncvinCount].value.pointer.revocation = &rev; + ncvinCount++; // does not work, not implemented yet in 3.12.4 -// cvin[2].type = cert_pi_keyusage; -// cvin[2].value.scalar.ui = KU_DIGITAL_SIGNATURE; - cvin[2].type = cert_pi_end; +// cvin[ncvinCount].type = cert_pi_keyusage; +// cvin[ncvinCount].value.scalar.ui = KU_DIGITAL_SIGNATURE; +// ncvinCount++; + cvin[ncvinCount].type = cert_pi_end; cvout[0].type = cert_po_trustAnchor; cvout[0].value.pointer.cert = NULL; @@ -935,7 +894,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, arUsages[3] = UsageDescription( certificateUsageEmailSigner, "certificateUsageEmailSigner" ); arUsages[4] = UsageDescription( certificateUsageEmailRecipient, "certificateUsageEmailRecipient" ); - int numUsages = sizeof(arUsages) / sizeof(UsageDescription); + int numUsages = SAL_N_ELEMENTS(arUsages); for (int i = 0; i < numUsages; i++) { xmlsec_trace("Testing usage %d of %d: %s (0x%x)", i + 1, @@ -996,7 +955,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, //Destroying the temporary certificates std::vector<CERTCertificate*>::const_iterator cert_i; - for (cert_i = vecTmpNSSCertificates.begin(); cert_i != vecTmpNSSCertificates.end(); cert_i++) + for (cert_i = vecTmpNSSCertificates.begin(); cert_i != vecTmpNSSCertificates.end(); ++cert_i) { xmlsec_trace("Destroying temporary certificate"); CERT_DestroyCertificate(*cert_i); @@ -1166,3 +1125,5 @@ void SecurityEnvironment_NssImpl::destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr xmlSecKeysMngrDestroy( pKeysMngr ) ; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx index 8b2192a00b1f..3488692e023e 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase4.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/security/XCertificate.hpp> @@ -137,33 +134,25 @@ private : virtual void setCertDb( CERTCertDBHandle* aCertDb ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void adoptSymKey( PK11SymKey* aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void rejectSymKey( PK11SymKey* aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual PK11SymKey* getSymKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void adoptPubKey( SECKEYPublicKey* aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void rejectPubKey( SECKEYPublicKey* aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual SECKEYPublicKey* getPubKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual void adoptPriKey( SECKEYPrivateKey* aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual void rejectPriKey( SECKEYPrivateKey* aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - virtual SECKEYPrivateKey* getPriKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL getPersonalCertificates() throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::com::sun::star::uno::Sequence< sal_Int8 >& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::rtl::OUString& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL buildCertificatePath( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& beginCert ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromRaw( const ::com::sun::star::uno::Sequence< sal_Int8 >& rawCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; - 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 ) ; @@ -175,9 +164,8 @@ private: void updateSlots(); virtual void addCryptoSlot( PK11SlotInfo* aSlot ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; - - } ; #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 5c56124c880a..1e521cf272fd 100644 --- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,6 +84,7 @@ using ::rtl::OString; #define SECURITY_ENVIRONMENT "com.sun.star.xml.crypto.SecurityEnvironment" #define SECURITY_CONTEXT "com.sun.star.xml.crypto.XMLSecurityContext" + int nProduct = 4; SEInitializer_NssImpl::SEInitializer_NssImpl( const css::uno::Reference< css::lang::XMultiServiceFactory > &rxMSF ) { @@ -194,3 +196,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl::getSupportedServ return SEInitializer_NssImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx index 469d19bcb331..776c2ffd4a78 100644 --- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,4 @@ SAL_CALL SEInitializer_NssImpl_createInstance( const ::com::sun::star::uno::Refe #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index 5028edb391d1..61a52adf7735 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,25 +36,17 @@ #include "nss.h" #include "secder.h" -//MM : added by MM #include "hasht.h" #include "secoid.h" #include "pk11func.h" -//MM : end - - #include <sal/config.h> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include "x509certificate_nssimpl.hxx" -#ifndef _CERTIFICATEEXTENSION_NSSIMPL_HXX_ #include "certificateextension_xmlsecimpl.hxx" -#endif -#ifndef _SANEXTENSION_NSSIMPL_HXX_ #include "sanextension_nssimpl.hxx" -#endif using namespace ::com::sun::star::uno ; using namespace ::com::sun::star::security ; @@ -332,17 +325,14 @@ sal_Int64 SAL_CALL X509Certificate_NssImpl :: getSomething( const Sequence< sal_ } /* XUnoTunnel extension */ + +namespace +{ + class theX509Certificate_NssImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theX509Certificate_NssImplUnoTunnelId > {}; +} + const Sequence< sal_Int8>& X509Certificate_NssImpl :: getUnoTunnelId() { - static Sequence< sal_Int8 >* pSeq = 0 ; - if( !pSeq ) { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; - if( !pSeq ) { - static Sequence< sal_Int8> aSeq( 16 ) ; - rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; - pSeq = &aSeq ; - } - } - return *pSeq ; + return theX509Certificate_NssImplUnoTunnelId::get().getSeq(); } /* XUnoTunnel extension */ @@ -355,7 +345,6 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref return NULL ; } -// MM : added by MM ::rtl::OUString getAlgorithmDescription(SECAlgorithmID *aid) { SECOidTag tag; @@ -371,23 +360,15 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref if( pCert != NULL ) { unsigned char fingerprint[20]; - //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; } else @@ -490,5 +471,4 @@ sal_Int32 SAL_CALL X509Certificate_NssImpl::getCertificateUsage( ) return usage; } -// MM : end - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx index c486cb4a9e8c..b84e977e7b2a 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,15 +57,12 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2< virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSerialNumber( ) throw ( ::com::sun::star::uno::RuntimeException) ; virtual ::rtl::OUString SAL_CALL getIssuerName( ) throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::rtl::OUString SAL_CALL getSubjectName( ) throw ( ::com::sun::star::uno::RuntimeException) ; virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidBefore( ) throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidAfter( ) throw ( ::com::sun::star::uno::RuntimeException) ; virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getIssuerUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException) ; - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException) ; virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL getExtensions( ) throw ( ::com::sun::star::uno::RuntimeException) ; @@ -73,7 +71,6 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2< virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getEncoded( ) throw ( ::com::sun::star::uno::RuntimeException) ; - // MM : added by MM virtual ::rtl::OUString SAL_CALL getSubjectPublicKeyAlgorithm() throw ( ::com::sun::star::uno::RuntimeException) ; @@ -90,7 +87,6 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2< throw ( ::com::sun::star::uno::RuntimeException) ; virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ; - // MM : end //Methods from XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (com::sun::star::uno::RuntimeException); @@ -106,3 +102,4 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2< #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 65da3caaf174..71c443b437c3 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,17 +32,11 @@ #include <rtl/uuid.h> #include "xmlencryption_nssimpl.hxx" -#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmldocumentwrapper_xmlsecimpl.hxx" -#endif -#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmlelementwrapper_xmlsecimpl.hxx" -#endif -#ifndef _SECURITYENVIRONMENT_NSSIMPL_HXX_ #include "securityenvironment_nssimpl.hxx" -#endif #include "errorcallback.hxx" #include <sal/types.h> @@ -104,12 +99,6 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt( throw RuntimeException() ; } -#if 0 - XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ; - if( pSecCtxt == NULL ) - throw RuntimeException() ; -#endif - SecurityEnvironment_NssImpl* pSecEnv = reinterpret_cast<SecurityEnvironment_NssImpl*>( sal::static_int_cast<sal_uIntPtr>(xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))) ; @@ -135,7 +124,7 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt( throw RuntimeException() ; } - //MM : Get the element to be encrypted + // Get the element to be encrypted Reference< XXMLElementWrapper > xTarget = aTemplate->getTarget() ; if( !xTarget.is() ) { throw XMLEncryptionException() ; @@ -155,17 +144,11 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt( } pContent = pTarget->getNativeElement() ; - //MM : end if( pContent == NULL ) { throw XMLEncryptionException() ; } - /* MM : remove the following 2 lines - xmlUnlinkNode(pContent); - xmlAddNextSibling(pEncryptedData, pContent); - */ - //remember the position of the element to be signed sal_Bool isParentRef = sal_True; xmlNodePtr pParent = pEncryptedData->parent; @@ -201,32 +184,6 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt( pEncryptedData = pTemplate->getNativeElement() ; //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; - while (pCipherData != NULL && stricmp((const char *)(pCipherData->name), "CipherData")) - { - pCipherData = pCipherData->next; - } - - if( pCipherData == NULL ) { - xmlSecEncCtxDestroy( pEncCtx ) ; - throw XMLEncryptionException() ; - } - - xmlNodePtr pCipherValue = pCipherData->children; - while (pCipherValue != NULL && stricmp((const char *)(pCipherValue->name), "CipherValue")) - { - pCipherValue = pCipherValue->next; - } - - if( pCipherValue == NULL ) { - xmlSecEncCtxDestroy( pEncCtx ) ; - throw XMLEncryptionException() ; - } - - pContent = pCipherValue->children; - */ //Encrypt the template if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 ) @@ -404,12 +361,12 @@ Sequence< OUString > SAL_CALL XMLEncryption_NssImpl :: getSupportedServiceNames( Sequence< OUString > XMLEncryption_NssImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLEncryption" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLEncryption")) ; return seqServiceNames ; } OUString XMLEncryption_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl")) ; } //Helper for registry @@ -424,3 +381,4 @@ Reference< XSingleServiceFactory > XMLEncryption_NssImpl :: impl_createFactory( return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx index 42484532fcae..1b859734db39 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XXMLEncryption.hpp> #include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> @@ -100,3 +97,4 @@ class XMLEncryption_NssImpl : public ::cppu::WeakImplHelper3< #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 ca881d0ee92b..f0dd15c75fac 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <rtl/uuid.h> #include "securityenvironment_nssimpl.hxx" -#ifndef _XMLSECURITYCONTEXT_NSSIMPL_HXX_ #include "xmlsecuritycontext_nssimpl.hxx" -#endif #include "xmlstreamio.hxx" #include <sal/types.h> @@ -80,11 +79,7 @@ XMLSecurityContext_NssImpl :: XMLSecurityContext_NssImpl( const Reference< XMult } XMLSecurityContext_NssImpl :: ~XMLSecurityContext_NssImpl() { -#if 0 //i39448 - if( m_pKeysMngr != NULL ) { - xmlSecKeysMngrDestroy( m_pKeysMngr ) ; - } -#endif + //i39448 xmlDisableStreamInputCallbacks() ; xmlSecCryptoShutdown() ; @@ -151,86 +146,7 @@ void SAL_CALL XMLSecurityContext_NssImpl::setDefaultSecurityEnvironmentIndex( sa m_nDefaultEnvIndex = nDefaultEnvIndex; } -#if 0 //i39448 : old methods should be deleted -/* XXMLSecurityContext */ -void SAL_CALL XMLSecurityContext_NssImpl :: setSecurityEnvironment( const Reference< XSecurityEnvironment >& aSecurityEnvironment ) throw( com::sun::star::security::SecurityInfrastructureException ) { - PK11SlotInfo* slot ; - CERTCertDBHandle* handler ; - //xmlSecKeyPtr key ; - //xmlSecKeyDataPtr keyData ; - PK11SymKey* symKey ; - SECKEYPublicKey* pubKey ; - SECKEYPrivateKey* priKey ; - unsigned int i ; - - if( !aSecurityEnvironment.is() ) - throw RuntimeException() ; - - m_xSecurityEnvironment = aSecurityEnvironment ; - - //Clear key manager - if( m_pKeysMngr != NULL ) { - xmlSecKeysMngrDestroy( m_pKeysMngr ) ; - m_pKeysMngr = NULL ; - } - - //Create key manager - Reference< XUnoTunnel > xEnvTunnel( m_xSecurityEnvironment , UNO_QUERY ) ; - if( !xEnvTunnel.is() ) { - throw RuntimeException() ;^1 - } - - SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; - if( pSecEnv == NULL ) - throw RuntimeException() ; - - //todo -// slot = pSecEnv->getCryptoSlot() ; - handler = pSecEnv->getCertDb() ; - - /*- - * The following lines is based on the private version of xmlSec-NSS - * crypto engine - */ - m_pKeysMngr = xmlSecNssAppliedKeysMngrCreate( slot , handler ) ; - if( m_pKeysMngr == NULL ) - throw RuntimeException() ; - - /*- - * Adopt symmetric key into keys manager - */ - for( i = 0 ; ( symKey = pSecEnv->getSymKey( i ) ) != NULL ; i ++ ) { - if( xmlSecNssAppliedKeysMngrSymKeyLoad( m_pKeysMngr, symKey ) < 0 ) { - throw RuntimeException() ; - } - } - - /*- - * Adopt asymmetric public key into keys manager - */ - for( i = 0 ; ( pubKey = pSecEnv->getPubKey( i ) ) != NULL ; i ++ ) { - if( xmlSecNssAppliedKeysMngrPubKeyLoad( m_pKeysMngr, pubKey ) < 0 ) { - throw RuntimeException() ; - } - } - - /*- - * Adopt asymmetric private key into keys manager - */ - for( i = 0 ; ( priKey = pSecEnv->getPriKey( i ) ) != NULL ; i ++ ) { - if( xmlSecNssAppliedKeysMngrPriKeyLoad( m_pKeysMngr, priKey ) < 0 ) { - throw RuntimeException() ; - } - } -} - -/* XXMLSecurityContext */ -Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_NssImpl :: getSecurityEnvironment() - throw (RuntimeException) -{ - return m_xSecurityEnvironment ; -} -#endif +//i39448 : old methods deleted /* XInitialization */ @@ -263,12 +179,12 @@ Sequence< OUString > SAL_CALL XMLSecurityContext_NssImpl :: getSupportedServiceN Sequence< OUString > XMLSecurityContext_NssImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSecurityContext" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSecurityContext")) ; return seqServiceNames ; } OUString XMLSecurityContext_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl")) ; } //Helper for registry @@ -283,43 +199,5 @@ Reference< XSingleServiceFactory > XMLSecurityContext_NssImpl :: impl_createFact return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } -#if 0 //not useful any longer -/* XUnoTunnel */ -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 ) ) { - return ( sal_Int64 )this ; - } - return 0 ; -} -/* XUnoTunnel extension */ -const Sequence< sal_Int8>& XMLSecurityContext_NssImpl :: getUnoTunnelId() { - static Sequence< sal_Int8 >* pSeq = 0 ; - if( !pSeq ) { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; - if( !pSeq ) { - static Sequence< sal_Int8> aSeq( 16 ) ; - rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; - pSeq = &aSeq ; - } - } - return *pSeq ; -} - -/* XUnoTunnel extension */ -XMLSecurityContext_NssImpl* XMLSecurityContext_NssImpl :: getImplementation( const Reference< XInterface > xObj ) { - Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; - if( xUT.is() ) { - return ( XMLSecurityContext_NssImpl* )xUT->getSomething( getUnoTunnelId() ) ; - } else - return NULL ; -} - -/* Native methods */ -xmlSecKeysMngrPtr XMLSecurityContext_NssImpl :: keysManager() throw( Exception, RuntimeException ) { - return m_pKeysMngr ; -} - -#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx index b75f2d0c0c72..685f83ec304d 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> @@ -137,3 +134,4 @@ class XMLSecurityContext_NssImpl : public ::cppu::WeakImplHelper3< #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 5f03b54580df..47e20b7af03b 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,21 +32,13 @@ #include <rtl/uuid.h> #include "xmlsignature_nssimpl.hxx" -#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmldocumentwrapper_xmlsecimpl.hxx" -#endif -#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ #include "xmlelementwrapper_xmlsecimpl.hxx" -#endif -#ifndef _SECURITYENVIRONMENT_NSSIMPL_HXX_ #include "securityenvironment_nssimpl.hxx" -#endif -#ifndef _XMLSECURITYCONTEXT_NSSIMPL_HXX_ #include "xmlsecuritycontext_nssimpl.hxx" -#endif #include "xmlstreamio.hxx" #include "errorcallback.hxx" @@ -133,11 +126,7 @@ SAL_CALL XMLSignature_NssImpl :: generate( throw RuntimeException() ; } -#if 0 //i39448 : the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext - XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ; - if( pSecCtxt == NULL ) - throw RuntimeException() ; -#endif + //i39448 : the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext SecurityEnvironment_NssImpl* pSecEnv = reinterpret_cast<SecurityEnvironment_NssImpl*>( @@ -332,12 +321,12 @@ Sequence< OUString > SAL_CALL XMLSignature_NssImpl :: getSupportedServiceNames() Sequence< OUString > XMLSignature_NssImpl :: impl_getSupportedServiceNames() { ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; Sequence< OUString > seqServiceNames( 1 ) ; - seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignature" ) ; + seqServiceNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignature")) ; return seqServiceNames ; } OUString XMLSignature_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { - return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl" ) ; + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl")) ; } //Helper for registry @@ -352,3 +341,4 @@ Reference< XSingleServiceFactory > XMLSignature_NssImpl :: impl_createFactory( c return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx index 44ed88b0a1bf..3a8cfecd4eb0 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,10 @@ #include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/Exception.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/crypto/XXMLSignature.hpp> #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> @@ -100,3 +97,4 @@ class XMLSignature_NssImpl : public ::cppu::WeakImplHelper3< #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 03d32451759c..171c7bc365a3 100644 --- a/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx +++ b/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,3 +104,4 @@ void* SAL_CALL nss_component_getFactory( const sal_Char* pImplName , void* pServ } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx index 6e381334136e..6b09fea26718 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.cxx +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -431,20 +432,6 @@ void SAXHelper::setDocumentLocator( const cssu::Reference< cssxs::XLocator > &) 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 - //} - //if( m_pSaxLocatorHdl != NULL ) { - // //Deallocate the memory - //} - - //m_pSaxLocatorHdl = new Sax_Locator( xLocator ) ; - //m_pSaxLocator = { m_pSaxLocatorHdl->getPublicId , m_pSaxLocatorHdl->getSystemId , m_pSaxLocatorHdl->getLineNumber , m_pSaxLocatorHdl->getColumnNumber } ; - - //m_pSaxHandler->setDocumentLocator( m_pParserCtxt , m_pSaxLocator ) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/saxhelper.hxx b/xmlsecurity/source/xmlsec/saxhelper.hxx index fab6157b6922..a18943d5043e 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.hxx +++ b/xmlsecurity/source/xmlsec/saxhelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,3 +87,4 @@ class SAXHelper #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx index 341f66b9ef1f..987a76dff9fb 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,16 +35,10 @@ #include <xmloff/attrlist.hxx> #include "xmlelementwrapper_xmlsecimpl.hxx" -//#include <malloc.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -/* - * Deleted by AF -#include <memory.h> - */ - #include <sys/types.h> #include <sys/stat.h> @@ -128,9 +123,6 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -226,9 +218,6 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -330,9 +319,6 @@ void XMLDocumentWrapper_XmlSecImpl::sendEndElement( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -381,9 +367,6 @@ void XMLDocumentWrapper_XmlSecImpl::sendNode( * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -433,9 +416,6 @@ rtl::OString XMLDocumentWrapper_XmlSecImpl::getNodeQName(const xmlNodePtr pNode) * RESULT * name - the node's qualified name * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -475,9 +455,6 @@ xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const cssu::Reference< c * RESULT * node - the node wrapped in the XXMLElementWrapper interface * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -546,9 +523,6 @@ sal_Int32 XMLDocumentWrapper_XmlSecImpl::recursiveDelete( * The node in the m_aReservedNodes list must be in the tree order, otherwise * the result is unpredictable. * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -626,9 +600,6 @@ void XMLDocumentWrapper_XmlSecImpl::getNextReservedNode() * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -663,9 +634,6 @@ void XMLDocumentWrapper_XmlSecImpl::removeNode(const xmlNodePtr pNode) const * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -708,9 +676,6 @@ void XMLDocumentWrapper_XmlSecImpl::buildIDAttr(xmlNodePtr pNode) const * RESULT * empty * - * HISTORY - * 14.06.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -747,9 +712,6 @@ void XMLDocumentWrapper_XmlSecImpl::rebuildIDLink(xmlNodePtr pNode) const * RESULT * empty * - * HISTORY - * 14.06.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -1151,3 +1113,4 @@ cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getSuppo return XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx index d2051fcf1406..de4f5cb25769 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,8 +36,6 @@ #include <cppuhelper/implbase4.hxx> #include "saxhelper.hxx" -//#include "libxml/parserInternals.h" -//#include "libxslt/xslt.h" #define NODEPOSITION_NORMAL 1 #define NODEPOSITION_STARTELEMENT 2 @@ -61,11 +60,6 @@ class XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper4 * 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 - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -282,3 +276,4 @@ SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx index f9de04c16d5f..cc00a33f1bdb 100644 --- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -145,9 +146,6 @@ xmlNodePtr XMLElementWrapper_XmlSecImpl::getNativeElement( ) const * RESULT * pNode - the libxml2 node wrapped by this object * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -174,9 +172,6 @@ void XMLElementWrapper_XmlSecImpl::setNativeElement(const xmlNodePtr pNode) * RESULT * empty * - * HISTORY - * 05.01.2004 - implemented - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -185,3 +180,4 @@ void XMLElementWrapper_XmlSecImpl::setNativeElement(const xmlNodePtr pNode) m_pElement = pNode; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx index e90513266ec5..02a97be563d9 100644 --- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,10 +52,6 @@ class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper3 * Used as a wrapper class to transfer a libxml2 node structure * between different UNO components. * - * HISTORY - * 05.01.2004 - Interface supported: XXMLElementWrapper, XUnoTunnel - * XServiceInfo - * * AUTHOR * Michael Mi * Email: michael.mi@sun.com @@ -106,3 +103,4 @@ SAL_CALL XMLElementWrapper_XmlSecImpl_createInstance( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx index d5ba439467fe..b75083e5e022 100644 --- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx +++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -163,19 +164,8 @@ int xmlStreamClose( void * context ) int xmlEnableStreamInputCallbacks() { - int cbs = 0 ; if( !( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) ) { - //Register the callbacks into libxml2 - //cbs = xmlRegisterInputCallbacks( - // xmlStreamMatch, - // xmlStreamOpen, - // xmlStreamRead, - // xmlStreamClose ) ; - //if( cbs < 0 ) { - // return -1 ; - //} - //Register the callbacks into xmlSec //In order to make the xmlsec io finding the callbacks firstly, //I put the callbacks at the very begining. @@ -185,7 +175,7 @@ int xmlEnableStreamInputCallbacks() xmlSecIOCleanupCallbacks() ; //Register my classbacks. - cbs = xmlSecIORegisterCallbacks( + int cbs = xmlSecIORegisterCallbacks( xmlStreamMatch, xmlStreamOpen, xmlStreamRead, @@ -242,3 +232,4 @@ void xmlDisableStreamInputCallbacks() { enableXmlStreamIO &= ~XMLSTREAMIO_INITIALIZED ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.hxx b/xmlsecurity/source/xmlsec/xmlstreamio.hxx index 3cb2e33528ab..eb61e9897606 100644 --- a/xmlsecurity/source/xmlsec/xmlstreamio.hxx +++ b/xmlsecurity/source/xmlsec/xmlstreamio.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _XMLSTREAMIO_XMLSECIMPL_HXX_ #define _XMLSTREAMIO_XMLSECIMPL_HXX_ -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.hxx> -#endif #include <com/sun/star/xml/crypto/XUriBinding.hpp> int xmlEnableStreamInputCallbacks( void ) ; @@ -44,3 +43,4 @@ int xmlUnregisterStreamInputCallbacks( void ) ; #endif //_XMLSTREAMIO_XMLSECIMPL_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx index 3fba8c69820f..a2f19665a5fc 100644 --- a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx +++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,13 +100,13 @@ extern void* nss_component_getFactory( const sal_Char*, void*, void* ); extern void* mscrypt_component_getFactory( const sal_Char*, void*, void* ); #endif -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment **) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* pRegistryKey ) +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* pRegistryKey ) { void* pRet = 0; Reference< XInterface > xFactory ; @@ -154,3 +155,4 @@ void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceM } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/test_docs/certs/end_certs/User_35_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_35_Root_11.crt index 6902605756af..0092d16c7a60 100644 --- a/xmlsecurity/test_docs/certs/end_certs/User_35_Root_11.crt +++ b/xmlsecurity/test_docs/certs/end_certs/User_35_Root_11.crt @@ -23,14 +23,14 @@ Certificate: 55:9b:90:91:f4:ce:56:04:d5 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Key Usage: + X509v3 Key Usage: Digital Signature, Non Repudiation, Key Encipherment - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 91:47:AC:29:95:5D:EF:72:14:8F:82:45:07:E2:94:49:75:C6:7D:73 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 - X509v3 Subject Alternative Name: + X509v3 Subject Alternative Name: DNS:alt.openoffice.org, IP Address:192.168.7.1, IP Address:13:0:0:0:0:0:0:17, email:my@other.address, Registered ID:1.2.3.4, othername:<unsupported>, DirName:/C=DE/O=OpenOffice.org/OU=Development/CN=User 32 Root 11, URI:http://my.url.here/ Signature Algorithm: sha1WithRSAEncryption 6e:80:e6:1e:86:3d:d2:65:a6:17:fa:80:2d:2e:dc:85:32:05: diff --git a/xmlsecurity/test_docs/documents/aia_ca_issuers.odt b/xmlsecurity/test_docs/documents/aia_ca_issuers.odt Binary files differindex 8c34889df75d..8c34889df75d 100755..100644 --- a/xmlsecurity/test_docs/documents/aia_ca_issuers.odt +++ b/xmlsecurity/test_docs/documents/aia_ca_issuers.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp.odt b/xmlsecurity/test_docs/documents/aia_ocsp.odt Binary files differindex 6a1b48c6ae44..6a1b48c6ae44 100755..100644 --- a/xmlsecurity/test_docs/documents/aia_ocsp.odt +++ b/xmlsecurity/test_docs/documents/aia_ocsp.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt Binary files differindex 248fcceddc43..248fcceddc43 100755..100644 --- a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt +++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt Binary files differindex 2e0dbd6f7af3..2e0dbd6f7af3 100755..100644 --- a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt +++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt Binary files differindex 3519e4a818e6..3519e4a818e6 100755..100644 --- a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt +++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt diff --git a/xmlsecurity/test_docs/documents/crl.odt b/xmlsecurity/test_docs/documents/crl.odt Binary files differindex 06e412fa3ca4..06e412fa3ca4 100755..100644 --- a/xmlsecurity/test_docs/documents/crl.odt +++ b/xmlsecurity/test_docs/documents/crl.odt diff --git a/xmlsecurity/test_docs/documents/crl_revoked_chain.odt b/xmlsecurity/test_docs/documents/crl_revoked_chain.odt Binary files differindex 851fc87e7693..851fc87e7693 100755..100644 --- a/xmlsecurity/test_docs/documents/crl_revoked_chain.odt +++ b/xmlsecurity/test_docs/documents/crl_revoked_chain.odt diff --git a/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt b/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt Binary files differindex a97598d554bd..a97598d554bd 100755..100644 --- a/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt +++ b/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt Binary files differindex f82a02a4545c..f82a02a4545c 100755..100644 --- a/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt +++ b/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt diff --git a/xmlsecurity/test_docs/documents/crldp.odt b/xmlsecurity/test_docs/documents/crldp.odt Binary files differindex 5cbf289de34f..5cbf289de34f 100755..100644 --- a/xmlsecurity/test_docs/documents/crldp.odt +++ b/xmlsecurity/test_docs/documents/crldp.odt diff --git a/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt b/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt Binary files differindex 20c28d9252e7..20c28d9252e7 100755..100644 --- a/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt +++ b/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt b/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt Binary files differindex d3f59e6015a1..d3f59e6015a1 100755..100644 --- a/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt +++ b/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt b/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt Binary files differindex 8c6416b808ba..8c6416b808ba 100755..100644 --- a/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt +++ b/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt b/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt Binary files differindex fce479cc66b2..fce479cc66b2 100755..100644 --- a/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt +++ b/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt Binary files differindex 53d1e01e7ae3..53d1e01e7ae3 100755..100644 --- a/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt +++ b/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt diff --git a/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt b/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt Binary files differindex 1f69a324823b..1f69a324823b 100755..100644 --- a/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt +++ b/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt diff --git a/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt b/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt Binary files differindex 53a29310e9f2..53a29310e9f2 100755..100644 --- a/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt +++ b/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt diff --git a/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt b/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt Binary files differindex 4d34bc0f580a..4d34bc0f580a 100755..100644 --- a/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt +++ b/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt diff --git a/xmlsecurity/test_docs/documents/dn_quoting.odt b/xmlsecurity/test_docs/documents/dn_quoting.odt Binary files differindex ca17f6aab62e..ca17f6aab62e 100755..100644 --- a/xmlsecurity/test_docs/documents/dn_quoting.odt +++ b/xmlsecurity/test_docs/documents/dn_quoting.odt diff --git a/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt Binary files differindex 798f25a35312..798f25a35312 100755..100644 --- a/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt +++ b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt diff --git a/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt Binary files differindex 591f9aa4d63d..591f9aa4d63d 100755..100644 --- a/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt +++ b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt diff --git a/xmlsecurity/test_docs/documents/incomplete_path.odt b/xmlsecurity/test_docs/documents/incomplete_path.odt Binary files differindex cb0763b0a124..cb0763b0a124 100755..100644 --- a/xmlsecurity/test_docs/documents/incomplete_path.odt +++ b/xmlsecurity/test_docs/documents/incomplete_path.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt Binary files differindex f0555b1a2da4..f0555b1a2da4 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt Binary files differindex b2e24fc6177c..b2e24fc6177c 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt Binary files differindex 640a80dced51..640a80dced51 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt Binary files differindex 35847216be74..35847216be74 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt Binary files differindex 575f3a12d084..575f3a12d084 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt Binary files differindex 75a417cab6f7..75a417cab6f7 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt Binary files differindex f7d71762fd88..f7d71762fd88 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt Binary files differindex 9984aa1bbb27..9984aa1bbb27 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt Binary files differindex 5ad7b68abbbb..5ad7b68abbbb 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt Binary files differindex d126a8dff529..d126a8dff529 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt b/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt Binary files differindex dd475c354957..dd475c354957 100755..100644 --- a/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt +++ b/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt diff --git a/xmlsecurity/test_docs/documents/ocsp_crl.odt b/xmlsecurity/test_docs/documents/ocsp_crl.odt Binary files differindex f8ab95c046de..f8ab95c046de 100755..100644 --- a/xmlsecurity/test_docs/documents/ocsp_crl.odt +++ b/xmlsecurity/test_docs/documents/ocsp_crl.odt diff --git a/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt b/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt Binary files differindex 4d7c5cd8094d..4d7c5cd8094d 100755..100644 --- a/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt +++ b/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/stateOrProvinceName.odt b/xmlsecurity/test_docs/documents/stateOrProvinceName.odt Binary files differindex 0979ae5a9d86..0979ae5a9d86 100755..100644 --- a/xmlsecurity/test_docs/documents/stateOrProvinceName.odt +++ b/xmlsecurity/test_docs/documents/stateOrProvinceName.odt diff --git a/xmlsecurity/test_docs/documents/valid_no_revocation.odt b/xmlsecurity/test_docs/documents/valid_no_revocation.odt Binary files differindex f7c9bbf5ed40..f7c9bbf5ed40 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_no_revocation.odt +++ b/xmlsecurity/test_docs/documents/valid_no_revocation.odt diff --git a/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt b/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt Binary files differindex d26eb58f025c..d26eb58f025c 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt +++ b/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt b/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt Binary files differindex 5d6c053c2b7c..5d6c053c2b7c 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt +++ b/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt Binary files differindex cb6401c1641f..cb6401c1641f 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt Binary files differindex 09b63b40a3e0..09b63b40a3e0 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt Binary files differindex e810d785d1b1..e810d785d1b1 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt Binary files differindex 6c2bbd045a0e..6c2bbd045a0e 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt Binary files differindex b8b036cc8fa7..b8b036cc8fa7 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt Binary files differindex 6ba0ec52a9b7..6ba0ec52a9b7 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt Binary files differindex de1c635c198b..de1c635c198b 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt Binary files differindex f6575ec88578..f6575ec88578 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt Binary files differindex 41f676f6376e..41f676f6376e 100755..100644 --- a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt +++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt diff --git a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java index c67e41549c5f..0881ff5e13e3 100755 --- a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java +++ b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: WeakReference.java,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/xmlsecurity/tools/demo/mozprofile.cxx b/xmlsecurity/tools/demo/mozprofile.cxx index 928e84fd61bb..4c08e3a82e5a 100644 --- a/xmlsecurity/tools/demo/mozprofile.cxx +++ b/xmlsecurity/tools/demo/mozprofile.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,3 +107,4 @@ int SAL_CALL main( int argc, char **argv ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/multisigdemo.cxx b/xmlsecurity/tools/demo/multisigdemo.cxx index ff8142f9252d..356616451ed6 100644 --- a/xmlsecurity/tools/demo/multisigdemo.cxx +++ b/xmlsecurity/tools/demo/multisigdemo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -234,3 +235,5 @@ int SAL_CALL main( int argc, char **argv ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/performance.cxx b/xmlsecurity/tools/demo/performance.cxx index 061091611de7..c8ee45907703 100644 --- a/xmlsecurity/tools/demo/performance.cxx +++ b/xmlsecurity/tools/demo/performance.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlsecurity.hxx" -#include <stdio.h> -#include <string.h> - #include <rtl/ustring.hxx> #include <cppuhelper/bootstrap.hxx> #include <cppuhelper/servicefactory.hxx> @@ -60,7 +58,6 @@ #include <com/sun/star/xml/crypto/sax/XSecuritySAXEventKeeper.hpp> #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> #include <com/sun/star/xml/crypto/XXMLSignature.hpp> -#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> #include <com/sun/star/xml/csax/XMLAttribute.hpp> #include <com/sun/star/xml/crypto/XSEInitializer.hpp> #include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp> @@ -79,23 +76,15 @@ #include <xmloff/attrlist.hxx> -//#include <malloc.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -/* - * Can not build under solaris. - * Delete the memory.h including by AF -#include <memory.h> -*/ - #include <sys/types.h> #include <sys/stat.h> #include <osl/time.h> - #ifndef INCLUDED_VECTOR #include <vector> #define INCLUDED_VECTOR @@ -255,7 +244,7 @@ public: struct AncestorEvent { - AncestorEvent( sal_Int32 nAttrNum ):aAttributeList(nAttrNum){}; + AncestorEvent(sal_Int32 nAttrNum) : aAttributeList(nAttrNum), bIsStartElement(false) {}; bool bIsStartElement; rtl::OUString ouName; @@ -368,27 +357,30 @@ private: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler); - void XSecTester::sendAncestorStartElementEvent( + void sendAncestorStartElementEvent( 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( + void 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 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 ){}; + XSecTester(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory >& rxMSF) + : mxMSF(rxMSF), m_bIsExporting(false), m_bIsBlocking(false), + m_bIsInsideCollectedElement(false), m_bIsSAXEventKeeperOnTheSAXChain(false) + { + }; + virtual ~XSecTester(){}; /* XSignatureCreationResultListener */ @@ -476,16 +468,16 @@ rtl::OUString XSecTester::parseFile( if (bIsJavaBased) { - SEInitializer_comp = rtl::OUString::createFromAscii( SEINITIALIZER_JAVA_COMPONENT ); - XMLSignature_comp = rtl::OUString::createFromAscii( XMLSIGNATURE_JAVA_COMPONENT); - m_ouXMLDocumentWrapperComponentName = rtl::OUString::createFromAscii( XMLDOCUMENTWRAPPER_JAVA_COMPONENT ); + SEInitializer_comp = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SEINITIALIZER_JAVA_COMPONENT )); + XMLSignature_comp = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XMLSIGNATURE_JAVA_COMPONENT)); + m_ouXMLDocumentWrapperComponentName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XMLDOCUMENTWRAPPER_JAVA_COMPONENT )); tokenPath = m_ouJavaCryptokenDir; } else { - SEInitializer_comp = rtl::OUString::createFromAscii( SEINITIALIZER_C_COMPONENT ); - XMLSignature_comp = rtl::OUString::createFromAscii( XMLSIGNATURE_C_COMPONENT); - m_ouXMLDocumentWrapperComponentName = rtl::OUString::createFromAscii( XMLDOCUMENT_C_COMPONENT ); + SEInitializer_comp = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SEINITIALIZER_C_COMPONENT )); + XMLSignature_comp = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XMLSIGNATURE_C_COMPONENT)); + m_ouXMLDocumentWrapperComponentName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XMLDOCUMENT_C_COMPONENT )); tokenPath = m_ouCCryptokenDir; } @@ -533,10 +525,10 @@ rtl::OUString XSecTester::parseFile( m_bIsBlocking = false; m_bIsInsideCollectedElement = false; - OSL_ASSERT(m_vSignatureList.size() == 0); - OSL_ASSERT(m_vUnsolvedReferenceURIs.size() == 0); - OSL_ASSERT(m_vUnsolvedReferenceKeeperIds.size() == 0); - OSL_ASSERT(m_vUnsolvedReferenceRefNums.size() == 0); + OSL_ASSERT(m_vSignatureList.empty()); + OSL_ASSERT(m_vUnsolvedReferenceURIs.empty()); + OSL_ASSERT(m_vUnsolvedReferenceKeeperIds.empty()); + OSL_ASSERT(m_vUnsolvedReferenceRefNums.empty()); OSL_ASSERT(m_stCurrentPath.empty()); OSL_ASSERT(m_stCurrentPathType.empty()); OSL_ASSERT(m_vAncestorEvents.empty()); @@ -591,13 +583,13 @@ rtl::OUString XSecTester::parseFile( } else { - ouMessage += rtl::OUString::createFromAscii( "N/A" ); + ouMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("N/A")); } } else { - ouMessage += rtl::OUString::createFromAscii( "-" ); + ouMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")); } return ouMessage; @@ -743,7 +735,7 @@ rtl::OUString SAL_CALL XSecTester::transfer_without_sec( xJavaFilterParser, cssu::UNO_QUERY ); if ( !xJavaFilterParser.is() ) - return rtl::OUString::createFromAscii( "NO JAVA" ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NO JAVA")); /* connect the SAX Parser, the Java Flat Filter and the SAX Writer */ xJavaFilterParser->setDocumentHandler( xSaxWriterHandler ); @@ -897,7 +889,7 @@ SignatureEntity::SignatureEntity( m_xSAXEventKeeper->setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId); m_xReferenceListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( - mxMSF->createInstance( rtl::OUString::createFromAscii( SIGNATURECREATOR_COMPONENT )), + mxMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SIGNATURECREATOR_COMPONENT ))), cssu::UNO_QUERY); cssu::Reference<cssl::XInitialization> xInitialization(m_xReferenceListener, cssu::UNO_QUERY); @@ -936,7 +928,7 @@ SignatureEntity::SignatureEntity( m_xSAXEventKeeper->setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId); m_xReferenceListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( - mxMSF->createInstance( rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT )), + mxMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SIGNATUREVERIFIER_COMPONENT ))), cssu::UNO_QUERY); cssu::Reference<cssl::XInitialization> xInitialization(m_xReferenceListener, cssu::UNO_QUERY); @@ -1193,7 +1185,7 @@ bool XSecTester::foundSecurityRelated() cssu::UNO_QUERY); m_xSAXEventKeeper = cssu::Reference< cssxc::sax::XSecuritySAXEventKeeper > - (mxMSF->createInstance( rtl::OUString::createFromAscii( SAXEVENTKEEPER_COMPONENT )), + (mxMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SAXEVENTKEEPER_COMPONENT ))), cssu::UNO_QUERY); cssu::Reference<cssl::XInitialization> xInitialization(m_xSAXEventKeeper, cssu::UNO_QUERY); @@ -1291,9 +1283,9 @@ void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl:: { (*ii_referenceRefNums) = nRefNum; - ii_referenceURIs++; - ii_referenceKeeperIds++; - ii_referenceRefNums++; + ++ii_referenceURIs; + ++ii_referenceKeeperIds; + ++ii_referenceRefNums; } if (bIsFindingKey) @@ -1303,9 +1295,9 @@ void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl:: } else { - ii_referenceURIs++; - ii_referenceKeeperIds++; - ii_referenceRefNums++; + ++ii_referenceURIs; + ++ii_referenceKeeperIds; + ++ii_referenceRefNums; } } } @@ -1521,9 +1513,9 @@ void XSecTester::checkReference( void XSecTester::endMission() { - while (m_vSignatureList.size() > 0) + while (!m_vSignatureList.empty()) { - if (m_vSignatureList.size()>0) + if (!m_vSignatureList.empty()) { SignatureEntity * pSignatureEntity = m_vSignatureList.at(0); m_vSignatureList.erase(m_vSignatureList.begin()); @@ -1532,7 +1524,7 @@ void XSecTester::endMission() } } - while (m_vUnsolvedReferenceURIs.size()>0) + while (!m_vUnsolvedReferenceURIs.empty()) { int nKeeperId = m_vUnsolvedReferenceKeeperIds.at(0); m_xSAXEventKeeper->removeElementCollector(nKeeperId); @@ -1617,7 +1609,7 @@ std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElem if (next != m_vAncestorEvents.end()) { - next++; + ++next; } } @@ -1644,7 +1636,7 @@ void XSecTester::flushAncestorEvents( else { sendAncestorEndElementEvent((*ii)->ouName, xDocumentHandler); - ii++; + ++ii; } } } @@ -1652,7 +1644,7 @@ void XSecTester::flushAncestorEvents( /* free the ancestor events list */ std::vector< AncestorEvent* >::iterator jj; - while (m_vAncestorEvents.size()>0) + while (!m_vAncestorEvents.empty()) { jj = m_vAncestorEvents.begin(); delete *jj; @@ -1779,7 +1771,7 @@ int main( int argc, char **argv ) * export the file with signautre/encryption (C++) */ outputFileName1 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-ex.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-ex.xml")); ouTime_C = pTester->export_xml(ouInputFileName, outputFileName1, sal_False); nPosition1 = ouTime_C.lastIndexOf('\t'); ouRemark_C = ouTime_C.copy(nPosition1 + 1); @@ -1789,7 +1781,7 @@ int main( int argc, char **argv ) * export the file with signautre/encryption (Java) */ outputFileName1 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-ex2.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-ex2.xml")); ouTime_Java = pTester->export_xml(ouInputFileName, outputFileName1, sal_True); nPosition1 = ouTime_Java.lastIndexOf('\t'); ouRemark_Java = ouTime_Java.copy(nPosition1 + 1); @@ -1799,14 +1791,14 @@ int main( int argc, char **argv ) * export the file without signautre/encryption */ outputFileName2 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-ex-no.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-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) + - rtl::OUString::createFromAscii("-ex-jf.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-ex-jf.xml")); ouTime_JavaForwardOnly = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_True); /* @@ -1829,7 +1821,7 @@ int main( int argc, char **argv ) * import the file with signautre/encryption (C++) */ outputFileName1 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-im.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-im.xml")); ouTime_C = pTester->import_xml(ouInputFileName, outputFileName1, sal_False); nPosition1 = ouTime_C.lastIndexOf('\t'); ouRemark_C = ouTime_C.copy(nPosition1 + 1); @@ -1839,7 +1831,7 @@ int main( int argc, char **argv ) * import the file with signautre/encryption (Java) */ outputFileName1 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-im2.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-im2.xml")); ouTime_Java = pTester->import_xml(ouInputFileName, outputFileName1, sal_True); nPosition1 = ouTime_Java.lastIndexOf('\t'); ouRemark_Java = ouTime_Java.copy(nPosition1 + 1); @@ -1849,7 +1841,7 @@ int main( int argc, char **argv ) * import the file without signautre/encryption */ outputFileName2 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-im-no.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-im-no.xml")); ouTime_NoSecurity = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_False); /* @@ -1857,7 +1849,7 @@ int main( int argc, char **argv ) */ outputFileName2 = ouInputFileName.copy(0, nPosition) + - rtl::OUString::createFromAscii("-im-jf.xml"); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-im-jf.xml")); ouTime_JavaForwardOnly = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_True); /* @@ -1878,3 +1870,5 @@ int main( int argc, char **argv ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/signdemo.cxx b/xmlsecurity/tools/demo/signdemo.cxx index 3cfad147beb3..a3c59345cfba 100644 --- a/xmlsecurity/tools/demo/signdemo.cxx +++ b/xmlsecurity/tools/demo/signdemo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -155,3 +156,4 @@ int SAL_CALL main( int argc, char **argv ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/util.cxx b/xmlsecurity/tools/demo/util.cxx index 5f9fccb9f7d9..ca339bbf5bd1 100644 --- a/xmlsecurity/tools/demo/util.cxx +++ b/xmlsecurity/tools/demo/util.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,7 +61,7 @@ cssu::Reference< cssl::XMultiServiceFactory > CreateDemoServiceFactory() "serviceManager - " "Cannot create simple registry" ) ; - xSimpleRegistry->open(rtl::OUString::createFromAscii( "demo.rdb" ), sal_True, sal_False); + xSimpleRegistry->open(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("demo.rdb")), sal_True, sal_False); OSL_ENSURE( xSimpleRegistry->isValid() , "serviceManager - " "Cannot open xml security registry rdb" ) ; @@ -109,3 +110,5 @@ cssu::Reference< cssl::XMultiServiceFactory > CreateDemoServiceFactory() return xOutputStream; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/util.hxx b/xmlsecurity/tools/demo/util.hxx index 7ac5bb69a21a..6f88fd24935f 100644 --- a/xmlsecurity/tools/demo/util.hxx +++ b/xmlsecurity/tools/demo/util.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ long QueryVerifySignature(); ::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, sal_Bool nType); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/util2.cxx b/xmlsecurity/tools/demo/util2.cxx index f0115c419aa8..0b68f09c5f89 100644 --- a/xmlsecurity/tools/demo/util2.cxx +++ b/xmlsecurity/tools/demo/util2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -169,68 +170,68 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer, rtl::OUString result; - result += rtl::OUString::createFromAscii( "Security Id : " ) + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Security Id : ")) +rtl::OUString::valueOf(infor.nSecurityId) - +rtl::OUString::createFromAscii( "\n" ); - result += rtl::OUString::createFromAscii( "Status : [" ) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Status : [")) +rtl::OUString::valueOf((sal_Int32)(infor.nStatus)) - +rtl::OUString::createFromAscii( "] " ) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("] ")) +rtl::OUString::createFromAscii(status[infor.nStatus]) - +rtl::OUString::createFromAscii( "\n" ); + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); const SignatureReferenceInformations& rInfors = infor.vSignatureReferenceInfors; int i; int size = rInfors.size(); - result += rtl::OUString::createFromAscii( "--References :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--References :\n")); for (i=0; i<size; i++) { - result += rtl::OUString::createFromAscii( "---URI : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("---URI : ")); result += rInfors[i].ouURI; - result += rtl::OUString::createFromAscii( "\n" ); - result += rtl::OUString::createFromAscii( "---DigestValue : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("---DigestValue : ")); result += rInfors[i].ouDigestValue; - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); } if (infor.ouX509IssuerName.getLength()>0) { - result += rtl::OUString::createFromAscii( "--X509IssuerName :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--X509IssuerName :\n")); result += infor.ouX509IssuerName; - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); } if (infor.ouX509SerialNumber.getLength()>0) { - result += rtl::OUString::createFromAscii( "--X509SerialNumber :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--X509SerialNumber :\n")); result += infor.ouX509SerialNumber; - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); } if (infor.ouX509Certificate.getLength()>0) { - result += rtl::OUString::createFromAscii( "--X509Certificate :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--X509Certificate :\n")); result += infor.ouX509Certificate; - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); } if (infor.ouSignatureValue.getLength()>0) { - result += rtl::OUString::createFromAscii( "--SignatureValue :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--SignatureValue :\n")); result += infor.ouSignatureValue; - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); } - result += rtl::OUString::createFromAscii( "--Date :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--Date :\n")); ::rtl::OUStringBuffer buffer; convertDateTime( buffer, infor.stDateTime ); result += buffer.makeStringAndClear(); - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); if (infor.ouX509IssuerName.getLength()>0 && infor.ouX509SerialNumber.getLength()>0 && xSecurityEnvironment.is()) { - result += rtl::OUString::createFromAscii( "--Certificate Path :\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--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() ) @@ -246,68 +247,68 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer, for( int i = 0; i < xCertPath.getLength(); i++ ) { result += xCertPath[i]->getSubjectName(); - result += rtl::OUString::createFromAscii( "\n Subject public key algorithm : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n Subject public key algorithm : ")); result += xCertPath[i]->getSubjectPublicKeyAlgorithm(); - result += rtl::OUString::createFromAscii( "\n Signature algorithm : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n Signature algorithm : ")); result += xCertPath[i]->getSignatureAlgorithm(); - result += rtl::OUString::createFromAscii( "\n Subject public key value : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n Subject public key value : ")); cssu::Sequence< sal_Int8 > keyValue = xCertPath[i]->getSubjectPublicKeyValue(); result += printHexString(keyValue); - result += rtl::OUString::createFromAscii( "\n Thumbprint (SHA1) : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n Thumbprint (SHA1) : ")); cssu::Sequence< sal_Int8 > SHA1Thumbprint = xCertPath[i]->getSHA1Thumbprint(); result += printHexString(SHA1Thumbprint); - result += rtl::OUString::createFromAscii( "\n Thumbprint (MD5) : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n Thumbprint (MD5) : ")); cssu::Sequence< sal_Int8 > MD5Thumbprint = xCertPath[i]->getMD5Thumbprint(); result += printHexString(MD5Thumbprint); - result += rtl::OUString::createFromAscii( "\n <<\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n <<\n")); } - result += rtl::OUString::createFromAscii( "\n Key Usage : " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n Key Usage : ")); sal_Int32 usage = xCert->getCertificateUsage(); if (usage & ::com::sun::star::security::KeyUsage::DIGITAL_SIGNATURE) { - result += rtl::OUString::createFromAscii( "DIGITAL_SIGNATURE " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DIGITAL_SIGNATURE ")); } if (usage & ::com::sun::star::security::KeyUsage::NON_REPUDIATION) { - result += rtl::OUString::createFromAscii( "NON_REPUDIATION " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NON_REPUDIATION ")); } if (usage & ::com::sun::star::security::KeyUsage::KEY_ENCIPHERMENT) { - result += rtl::OUString::createFromAscii( "KEY_ENCIPHERMENT " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_ENCIPHERMENT ")); } if (usage & ::com::sun::star::security::KeyUsage::DATA_ENCIPHERMENT) { - result += rtl::OUString::createFromAscii( "DATA_ENCIPHERMENT " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA_ENCIPHERMENT ")); } if (usage & ::com::sun::star::security::KeyUsage::KEY_AGREEMENT) { - result += rtl::OUString::createFromAscii( "KEY_AGREEMENT " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_AGREEMENT ")); } if (usage & ::com::sun::star::security::KeyUsage::KEY_CERT_SIGN) { - result += rtl::OUString::createFromAscii( "KEY_CERT_SIGN " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KEY_CERT_SIGN ")); } if (usage & ::com::sun::star::security::KeyUsage::CRL_SIGN) { - result += rtl::OUString::createFromAscii( "CRL_SIGN " ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CRL_SIGN ")); } - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); } - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); return result; } @@ -325,7 +326,7 @@ void convertDateTime( ::rtl::OUStringBuffer& rBuffer, result += getSignatureInformation( infor, xSecurityEnvironment ); } - result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")); return result; } @@ -424,3 +425,5 @@ long QueryVerifySignature() fscanf( stdin, "%c", &answer); return (answer == 'n')?0:1; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/demo/verifydemo.cxx b/xmlsecurity/tools/demo/verifydemo.cxx index 2ea9c8d94a94..d96d539cee10 100644 --- a/xmlsecurity/tools/demo/verifydemo.cxx +++ b/xmlsecurity/tools/demo/verifydemo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -107,3 +108,4 @@ int SAL_CALL main( int argc, char **argv ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/certmngr.cxx b/xmlsecurity/tools/standalone/csfit/certmngr.cxx index 56dc1b5ae1ae..d0096a9c284e 100644 --- a/xmlsecurity/tools/standalone/csfit/certmngr.cxx +++ b/xmlsecurity/tools/standalone/csfit/certmngr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,7 +106,7 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[2] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[2] ) ) ; OSL_ENSURE( xManager.is() , "ServicesManager - " "Cannot get service manager" ) ; @@ -113,7 +114,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Signer - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -187,3 +188,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/decrypter.cxx b/xmlsecurity/tools/standalone/csfit/decrypter.cxx index 9c2422c19bb5..fb65f5fcf098 100644 --- a/xmlsecurity/tools/standalone/csfit/decrypter.cxx +++ b/xmlsecurity/tools/standalone/csfit/decrypter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -135,11 +136,11 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[4] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[4] ) ) ; //Create encryption template Reference< XInterface > tplElement = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( tplElement.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -163,7 +164,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Encryption template Reference< XInterface > enctpl = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLEncryptionTemplate"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLEncryptionTemplate")), xContext ) ; OSL_ENSURE( enctpl.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; @@ -179,7 +180,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Decryptor - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -206,7 +207,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl")), xContext ) ; OSL_ENSURE( xmlsecctx.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -221,7 +222,7 @@ int SAL_CALL main( int argc, char **argv ) //Get encrypter Reference< XInterface > xmlencrypter = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl")), xContext ) ; OSL_ENSURE( xmlencrypter.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; @@ -270,3 +271,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/encrypter.cxx b/xmlsecurity/tools/standalone/csfit/encrypter.cxx index 37821b6ed54e..63b2b4a6703e 100644 --- a/xmlsecurity/tools/standalone/csfit/encrypter.cxx +++ b/xmlsecurity/tools/standalone/csfit/encrypter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -143,11 +144,11 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[6] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[6] ) ) ; //Create encryption template Reference< XInterface > tplElement = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( tplElement.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -171,7 +172,7 @@ int SAL_CALL main( int argc, char **argv ) //Create encryption target element Reference< XInterface > tarElement = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( tarElement.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -196,7 +197,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Encryption template Reference< XInterface > enctpl = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLEncryptionTemplate"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLEncryptionTemplate")), xContext ) ; OSL_ENSURE( enctpl.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; @@ -213,7 +214,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Encryptor - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -241,7 +242,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl")), xContext ) ; OSL_ENSURE( xmlsecctx.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -255,7 +256,7 @@ int SAL_CALL main( int argc, char **argv ) //Get encrypter Reference< XInterface > xmlencrypter = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl")), xContext ) ; OSL_ENSURE( xmlencrypter.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; @@ -307,3 +308,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/helper.cxx b/xmlsecurity/tools/standalone/csfit/helper.cxx index 23c9e5908758..8136b679c6b2 100644 --- a/xmlsecurity/tools/standalone/csfit/helper.cxx +++ b/xmlsecurity/tools/standalone/csfit/helper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,21 +94,21 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext Reference< XMultiComponentFactory > xUsedServiceManager = NULL ; Reference< XComponentContext > xUsedComponentContext = NULL ; - OSL_ENSURE( !sUnoUrl.equalsAscii( "" ) , + OSL_ENSURE( sUnoUrl.getLength() , "serviceManager - " "No uno URI specified" ) ; - OSL_ENSURE( !sRdbUrl.equalsAscii( "" ) , + OSL_ENSURE( sRdbUrl.getLength() , "serviceManager - " "No rdb URI specified" ) ; - if( sUnoUrl.equalsAscii( "local" ) ) { + if( sUnoUrl.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "local" ) ) ) { Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry(); OSL_ENSURE( xSimpleRegistry.is() , "serviceManager - " "Cannot create simple registry" ) ; - //xSimpleRegistry->open(OUString::createFromAscii("xmlsecurity.rdb"), sal_False, sal_False); + //xSimpleRegistry->open(OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity.rdb")), sal_False, sal_False); xSimpleRegistry->open(sRdbUrl, sal_True, sal_False); OSL_ENSURE( xSimpleRegistry->isValid() , "serviceManager - " @@ -136,10 +137,10 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "Cannot get multi-service factory" ) ; Sequence< Any > args( 2 ) ; - args[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ) ; - args[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ) ; + args[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL )) ; + args[ 1 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE )) ; if( ! ::ucb::ContentBroker::initialize( xSvmg , args ) ) { - throw RuntimeException( OUString::createFromAscii( "Cannot inlitialize ContentBroker" ) , Reference< XInterface >() , Any() ) ; + throw RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM("Cannot inlitialize ContentBroker")) , Reference< XInterface >() , Any() ) ; } } ********************************************************************/ @@ -158,7 +159,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "Cannot create intial service manager" ) ; Reference< XInterface > urlResolver = - xLocalServiceManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver") , xLocalComponentContext ) ; + xLocalServiceManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.UnoUrlResolver")) , xLocalComponentContext ) ; OSL_ENSURE( urlResolver.is() , "serviceManager - " "Cannot get service instance of \"bridge.UnoUrlResolver\"" ) ; @@ -182,7 +183,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "Cannot get interface of \"XNamingService\" from URL resolver" ) ; Reference< XInterface > serviceManager = - xNamingService->getRegisteredObject( OUString::createFromAscii( "StarOffice.ServiceManager" ) ) ; + xNamingService->getRegisteredObject( OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice.ServiceManager")) ) ; OSL_ENSURE( serviceManager.is() , "serviceManager - " "Cannot get service instance of \"StarOffice.ServiceManager\"" ) ; @@ -197,7 +198,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "serviceManager - " "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; - xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xUsedComponentContext ; OSL_ENSURE( xUsedComponentContext.is() , "serviceManager - " "Cannot create remote component context" ) ; @@ -212,7 +213,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "serviceManager - " "Cannot get interface of \"XPropertySet\" from URL resolver" ) ; - xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xUsedComponentContext ; OSL_ENSURE( xUsedComponentContext.is() , "serviceManager - " "Cannot create remote component context" ) ; @@ -236,7 +237,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "serviceManager - " "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; - xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xUsedComponentContext ; OSL_ENSURE( xUsedComponentContext.is() , "serviceManager - " "Cannot create remote component context" ) ; @@ -264,3 +265,4 @@ char* PriPK11PasswordFunc( return passwd ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/helper.hxx b/xmlsecurity/tools/standalone/csfit/helper.hxx index 14a116444b63..a0f19532222a 100644 --- a/xmlsecurity/tools/standalone/csfit/helper.hxx +++ b/xmlsecurity/tools/standalone/csfit/helper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,8 +45,6 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XImporter.hpp> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -239,3 +238,4 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext char* PriPK11PasswordFunc( PK11SlotInfo *slot , PRBool retry , void* arg ) ; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/signer.cxx b/xmlsecurity/tools/standalone/csfit/signer.cxx index 689b86ea369c..fc4e4d743943 100644 --- a/xmlsecurity/tools/standalone/csfit/signer.cxx +++ b/xmlsecurity/tools/standalone/csfit/signer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -220,14 +221,14 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[4] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[4] ) ) ; OSL_ENSURE( xManager.is() , "ServicesManager - " "Cannot get service manager" ) ; //Create signature template Reference< XInterface > element = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( element.is() , "Signer - " "Cannot get service instance of \"wrapper.XMLElementWrapper\"" ) ; @@ -252,7 +253,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Signature template Reference< XInterface > signtpl = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignatureTemplate" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignatureTemplate")) , xContext ) ; OSL_ENSURE( signtpl.is() , "Signer - " "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; @@ -272,7 +273,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Signer - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -298,7 +299,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Signer - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -312,7 +313,7 @@ int SAL_CALL main( int argc, char **argv ) //Generate XML signature Reference< XInterface > xmlsigner = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl")), xContext ) ; OSL_ENSURE( xmlsigner.is() , "Signer - " "Cannot get service instance of \"xsec.XMLSignature\"" ) ; @@ -368,3 +369,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/csfit/verifier.cxx b/xmlsecurity/tools/standalone/csfit/verifier.cxx index 54eaaa926a46..43c72a102c30 100644 --- a/xmlsecurity/tools/standalone/csfit/verifier.cxx +++ b/xmlsecurity/tools/standalone/csfit/verifier.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -207,11 +208,11 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[3] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[3] ) ) ; //Create signature template Reference< XInterface > element = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( element.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -236,7 +237,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Signature template Reference< XInterface > signtpl = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLSignatureTemplate"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignatureTemplate")), xContext ) ; OSL_ENSURE( signtpl.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; @@ -256,7 +257,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Verifier - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -282,7 +283,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -296,7 +297,7 @@ int SAL_CALL main( int argc, char **argv ) //Generate XML signature Reference< XInterface > xmlsigner = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl")), xContext ) ; OSL_ENSURE( xmlsigner.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLSignature\"" ) ; @@ -338,3 +339,4 @@ done : return 0 ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx b/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx index 2208eb2e6177..fee83746faff 100644 --- a/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx +++ b/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /** -- C++ Source File -- **/ // MARKER(update_precomp.py): autogen include statement, do not remove @@ -62,7 +63,7 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[1] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[1] ) ) ; OSL_ENSURE( xManager.is() , "ServicesManager - " "Cannot get service manager" ) ; @@ -70,7 +71,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Signer - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -150,3 +151,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx index c0864ffb7b2e..a481824ad52e 100644 --- a/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx +++ b/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /** -- C++ Source File -- **/ // MARKER(update_precomp.py): autogen include statement, do not remove @@ -109,11 +110,11 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[4] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[4] ) ) ; //Create encryption template Reference< XInterface > tplElement = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.xsec.XMLElementWrapper" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.xsec.XMLElementWrapper")) , xContext ) ; OSL_ENSURE( tplElement.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -137,7 +138,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Encryption template Reference< XInterface > enctpl = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.XMLEncryptionTemplate"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.xsec.XMLEncryptionTemplate")), xContext ) ; OSL_ENSURE( enctpl.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; @@ -153,7 +154,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.SecurityEnvironment"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.xsec.SecurityEnvironment")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Decryptor - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -180,7 +181,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.XMLSecurityContext"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.xsec.XMLSecurityContext")), xContext ) ; OSL_ENSURE( xmlsecctx.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -195,7 +196,7 @@ int SAL_CALL main( int argc, char **argv ) //Get encrypter Reference< XInterface > xmlencrypter = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.XMLEncryption"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.xsec.XMLEncryption")), xContext ) ; OSL_ENSURE( xmlencrypter.is() , "Decryptor - " "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; @@ -244,3 +245,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx index 7402d5c3984f..3f0e98ca8a50 100644 --- a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx +++ b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /** -- C++ Source File -- **/ // MARKER(update_precomp.py): autogen include statement, do not remove @@ -124,11 +125,11 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[5] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[5] ) ) ; //Create encryption template Reference< XInterface > tplElement = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( tplElement.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -152,7 +153,7 @@ int SAL_CALL main( int argc, char **argv ) //Create encryption target element Reference< XInterface > tarElement = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( tarElement.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -177,7 +178,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Encryption template Reference< XInterface > enctpl = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLEncryptionTemplate"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLEncryptionTemplate")), xContext ) ; OSL_ENSURE( enctpl.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; @@ -194,7 +195,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Encryptor - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -228,7 +229,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl")), xContext ) ; OSL_ENSURE( xmlsecctx.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -242,7 +243,7 @@ int SAL_CALL main( int argc, char **argv ) //Get encrypter Reference< XInterface > xmlencrypter = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl")), xContext ) ; OSL_ENSURE( xmlencrypter.is() , "Encryptor - " "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; @@ -306,3 +307,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/helper.cxx b/xmlsecurity/tools/standalone/mscsfit/helper.cxx index 86cacafa4a8b..4415b9c4a96a 100644 --- a/xmlsecurity/tools/standalone/mscsfit/helper.cxx +++ b/xmlsecurity/tools/standalone/mscsfit/helper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "helper.hxx" #include "osl/diagnose.h" #include "rtl/ustring.h" @@ -61,21 +62,21 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext Reference< XMultiComponentFactory > xUsedServiceManager = NULL ; Reference< XComponentContext > xUsedComponentContext = NULL ; - OSL_ENSURE( !sUnoUrl.equalsAscii( "" ) , + OSL_ENSURE( sUnoUrl.getLength() , "serviceManager - " "No uno URI specified" ) ; - OSL_ENSURE( !sRdbUrl.equalsAscii( "" ) , + OSL_ENSURE( sRdbUrl.getLength() , "serviceManager - " "No rdb URI specified" ) ; - if( sUnoUrl.equalsAscii( "local" ) ) { + if( sUnoUrl.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "local" ) ) ) { Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry(); OSL_ENSURE( xSimpleRegistry.is() , "serviceManager - " "Cannot create simple registry" ) ; - //xSimpleRegistry->open(OUString::createFromAscii("xmlsecurity.rdb"), sal_False, sal_False); + //xSimpleRegistry->open(OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity.rdb")), sal_False, sal_False); xSimpleRegistry->open(sRdbUrl, sal_True, sal_False); OSL_ENSURE( xSimpleRegistry->isValid() , "serviceManager - " @@ -104,10 +105,10 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "Cannot get multi-service factory" ) ; Sequence< Any > args( 2 ) ; - args[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ) ; - args[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ) ; + args[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL )) ; + args[ 1 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE )) ; if( ! ::ucb::ContentBroker::initialize( xSvmg , args ) ) { - throw RuntimeException( OUString::createFromAscii( "Cannot inlitialize ContentBroker" ) , Reference< XInterface >() , Any() ) ; + throw RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM("Cannot inlitialize ContentBroker")) , Reference< XInterface >() , Any() ) ; } } ********************************************************************/ @@ -129,7 +130,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "Cannot create intial service manager" ) ; Reference< XInterface > urlResolver = - xLocalServiceManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver") , xLocalComponentContext ) ; + xLocalServiceManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.UnoUrlResolver")) , xLocalComponentContext ) ; OSL_ENSURE( urlResolver.is() , "serviceManager - " "Cannot get service instance of \"bridge.UnoUrlResolver\"" ) ; @@ -153,7 +154,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "Cannot get interface of \"XNamingService\" from URL resolver" ) ; Reference< XInterface > serviceManager = - xNamingService->getRegisteredObject( OUString::createFromAscii( "StarOffice.ServiceManager" ) ) ; + xNamingService->getRegisteredObject( OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice.ServiceManager")) ) ; OSL_ENSURE( serviceManager.is() , "serviceManager - " "Cannot get service instance of \"StarOffice.ServiceManager\"" ) ; @@ -168,7 +169,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "serviceManager - " "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; - xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xUsedComponentContext ; OSL_ENSURE( xUsedComponentContext.is() , "serviceManager - " "Cannot create remote component context" ) ; @@ -183,7 +184,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "serviceManager - " "Cannot get interface of \"XPropertySet\" from URL resolver" ) ; - xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xUsedComponentContext ; OSL_ENSURE( xUsedComponentContext.is() , "serviceManager - " "Cannot create remote component context" ) ; @@ -207,7 +208,7 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext "serviceManager - " "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; - xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xUsedComponentContext ; OSL_ENSURE( xUsedComponentContext.is() , "serviceManager - " "Cannot create remote component context" ) ; @@ -218,3 +219,4 @@ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext return xUsedServiceManager ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/helper.hxx b/xmlsecurity/tools/standalone/mscsfit/helper.hxx index 0f95ef50c4ab..01d92511e96a 100644 --- a/xmlsecurity/tools/standalone/mscsfit/helper.hxx +++ b/xmlsecurity/tools/standalone/mscsfit/helper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <stdio.h> #include <rtl/ustring.hxx> @@ -13,8 +14,6 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XImporter.hpp> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -202,3 +201,4 @@ Reference< XOutputStream > createStreamToFile( const OUString sFile ) ; */ Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext >& xContext , OUString sUnoUrl , OUString sRdbUrl ) throw( RuntimeException , Exception ) ; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/makefile.mk b/xmlsecurity/tools/standalone/mscsfit/makefile.mk index 1ab4575b5226..ce8be66850cf 100644 --- a/xmlsecurity/tools/standalone/mscsfit/makefile.mk +++ b/xmlsecurity/tools/standalone/mscsfit/makefile.mk @@ -31,7 +31,6 @@ PRJNAME=xmlsecurity TARGET=xmlsecurity-mscxsfit ENABLE_EXCEPTIONS=TRUE NO_BSYMBOLIC=TRUE -#TARGETTYPE=CUI LIBTARGET=NO @@ -109,21 +108,6 @@ APP4STDLIBS+= -lstdc++ APP4STDLIBS+= \ $(SHARE_LIBS) -## -## The 4th application -## -#APP5TARGET= decrypter -#APP5OBJS= \ -# $(SHARE_OBJS) \ -# $(OBJ)$/decrypter.obj -# -#.IF "$(OS)" == "LINUX" -#APP5STDLIBS+= -lstdc++ -#.ENDIF -# -#APP5STDLIBS+= \ -# $(SHARE_LIBS) - # # The 5th application # diff --git a/xmlsecurity/tools/standalone/mscsfit/signer.cxx b/xmlsecurity/tools/standalone/mscsfit/signer.cxx index 29542ee27492..270fb23bf076 100644 --- a/xmlsecurity/tools/standalone/mscsfit/signer.cxx +++ b/xmlsecurity/tools/standalone/mscsfit/signer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /** -- C++ Source File -- **/ // MARKER(update_precomp.py): autogen include statement, do not remove @@ -177,14 +178,14 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[3] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[3] ) ) ; OSL_ENSURE( xManager.is() , "ServicesManager - " "Cannot get service manager" ) ; //Create signature template Reference< XInterface > element = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( element.is() , "Signer - " "Cannot get service instance of \"wrapper.XMLElementWrapper\"" ) ; @@ -209,7 +210,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Signature template Reference< XInterface > signtpl = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignatureTemplate" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignatureTemplate")) , xContext ) ; OSL_ENSURE( signtpl.is() , "Signer - " "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; @@ -229,7 +230,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Signer - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -260,7 +261,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Signer - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -274,7 +275,7 @@ int SAL_CALL main( int argc, char **argv ) //Generate XML signature Reference< XInterface > xmlsigner = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl")), xContext ) ; OSL_ENSURE( xmlsigner.is() , "Signer - " "Cannot get service instance of \"xsec.XMLSignature\"" ) ; @@ -340,3 +341,4 @@ done: return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/tools/standalone/mscsfit/verifier.cxx b/xmlsecurity/tools/standalone/mscsfit/verifier.cxx index fa4325718fd1..6af44f0975c9 100644 --- a/xmlsecurity/tools/standalone/mscsfit/verifier.cxx +++ b/xmlsecurity/tools/standalone/mscsfit/verifier.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /** -- C++ Source File -- **/ // MARKER(update_precomp.py): autogen include statement, do not remove @@ -57,7 +58,6 @@ int SAL_CALL main( int argc, char **argv ) 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] ) ; @@ -180,11 +180,11 @@ int SAL_CALL main( int argc, char **argv ) Reference< XMultiComponentFactory > xManager = NULL ; Reference< XComponentContext > xContext = NULL ; - xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[2] ) ) ; + xManager = serviceManager( xContext , OUString(RTL_CONSTASCII_USTRINGPARAM("local")), OUString::createFromAscii( argv[2] ) ) ; //Create signature template Reference< XInterface > element = - xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl")) , xContext ) ; OSL_ENSURE( element.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; @@ -209,7 +209,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Signature template Reference< XInterface > signtpl = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLSignatureTemplate"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.crypto.XMLSignatureTemplate")), xContext ) ; OSL_ENSURE( signtpl.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; @@ -229,7 +229,7 @@ int SAL_CALL main( int argc, char **argv ) //Create security environment //Build Security Environment Reference< XInterface > xsecenv = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Verifier - " "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; @@ -260,7 +260,7 @@ int SAL_CALL main( int argc, char **argv ) //Build XML Security Context Reference< XInterface > xmlsecctx = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl")), xContext ) ; OSL_ENSURE( xsecenv.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; @@ -274,7 +274,7 @@ int SAL_CALL main( int argc, char **argv ) //Generate XML signature Reference< XInterface > xmlsigner = - xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl"), xContext ) ; + xManager->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl")), xContext ) ; OSL_ENSURE( xmlsigner.is() , "Verifier - " "Cannot get service instance of \"xsec.XMLSignature\"" ) ; @@ -326,3 +326,4 @@ done : return 0 ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/util/makefile.mk b/xmlsecurity/util/makefile.mk index 4f60f4babe0e..de84faa27bcd 100644 --- a/xmlsecurity/util/makefile.mk +++ b/xmlsecurity/util/makefile.mk @@ -30,8 +30,6 @@ PRJ=.. PRJNAME=xmlsecurity TARGET=xmlsecurity -# Disable '-z defs' due to broken libxpcom. -#LINKFLAGSDEFS=$(0) USE_DEFFILE=TRUE # --- Settings ----------------------------------------------------- @@ -113,6 +111,9 @@ SHL2STDLIBS += $(NSPR_LIB) .IF "$(NSS_LIB)" != "" SHL2STDLIBS += $(NSS_LIB) .ENDIF +.IF "$(MOZ_NSS_LIBS)" != "" +SHL2STDLIBS += $(MOZ_NSS_LIBS) +.ENDIF .ENDIF .IF "$(CRYPTO_ENGINE)" == "mscrypto" diff --git a/xmlsecurity/util/target.pmk b/xmlsecurity/util/target.pmk index e46a4a0d817a..42451acf2af9 100644 --- a/xmlsecurity/util/target.pmk +++ b/xmlsecurity/util/target.pmk @@ -26,7 +26,6 @@ #************************************************************************* .IF "$(GUI)" == "WNT" CRYPTO_ENGINE = mscrypto -#CRYPTO_ENGINE = nss .ELSE CRYPTO_ENGINE = nss .ENDIF diff --git a/xmlsecurity/workben/makefile.mk b/xmlsecurity/workben/makefile.mk index 2430a36431c8..e538f09352a2 100644 --- a/xmlsecurity/workben/makefile.mk +++ b/xmlsecurity/workben/makefile.mk @@ -56,7 +56,6 @@ APP1STDLIBS= $(CPPULIB) \ $(TOOLSLIB) \ $(SVTOOLLIB) \ $(SALLIB) \ - $(VOSLIB) \ $(SOTLIB) \ $(VCLLIB) \ $(SFXLIB) \ diff --git a/xmlsecurity/workben/signaturetest.cxx b/xmlsecurity/workben/signaturetest.cxx index 005122b8cce7..c0d788639452 100644 --- a/xmlsecurity/workben/signaturetest.cxx +++ b/xmlsecurity/workben/signaturetest.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,9 +83,6 @@ void Main(); #define LISTBOXHEIGHT 120 -// #define TEST_IMPLEMENTATION_DIRECTLY - - // ----------------------------------------------------------------------- SAL_IMPLEMENT_MAIN() @@ -95,7 +93,7 @@ void Main(); uno::Reference< uno::XComponentContext > xCtx( cppu::defaultBootstrap_InitialComponentContext() ); if ( !xCtx.is() ) { - DBG_ERROR( "Error creating initial component context!" ); + OSL_FAIL( "Error creating initial component context!" ); return -1; } @@ -103,25 +101,25 @@ void Main(); if ( !xMSF.is() ) { - DBG_ERROR( "No service manager!" ); + OSL_FAIL( "No service manager!" ); return -1; } // Init USB uno::Sequence< uno::Any > aArgs( 2 ); - aArgs[ 0 ] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ); - aArgs[ 1 ] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ); + aArgs[ 0 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL )); + aArgs[ 1 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE )); sal_Bool bSuccess = ::ucb::ContentBroker::initialize( xMSF, aArgs ); if ( !bSuccess ) { - DBG_ERROR( "Error creating UCB!" ); + OSL_FAIL( "Error creating UCB!" ); return -1; } } catch ( uno::Exception const & ) { - DBG_ERROR( "Exception during creation of initial component context!" ); + OSL_FAIL( "Exception during creation of initial component context!" ); return -1; } comphelper::setProcessServiceFactory( xMSF ); @@ -208,11 +206,7 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) : maCryptoCheckBox( this ) { -#ifdef TEST_IMPLEMENTATION_DIRECTLY - Size aOutputSize( 400, 600 ); -#else Size aOutputSize( 400, 400 ); -#endif SetOutputSizePixel( aOutputSize ); SetText( String( RTL_CONSTASCII_USTRINGPARAM( "XML Signature Test" ) ) ); @@ -243,55 +237,6 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) : nY += EDITHEIGHT*3; -#ifdef TEST_IMPLEMENTATION_DIRECTLY - - maTest1Line.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); - maTest1Line.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Test simple files" ) ) ); - maTest1Line.Show(); - - nY += EDITHEIGHT*3/2; - - maFixedTextXMLFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); - maFixedTextXMLFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "XML File:" ) ) ); - maFixedTextXMLFileName.Show(); - - maEditXMLFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); - maEditXMLFileName.Show(); - - nY += EDITHEIGHT*3/2; - - maFixedTextBINFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); - maFixedTextBINFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Binary File:" ) ) ); - maFixedTextBINFileName.Show(); - - maEditBINFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); - maEditBINFileName.Show(); - - nY += EDITHEIGHT*3/2; - - maFixedTextSIGFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); - maFixedTextSIGFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Signature File:" ) ) ); - maFixedTextSIGFileName.Show(); - - maEditSIGFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); - maEditSIGFileName.Show(); - - nY += EDITHEIGHT*2; - - maSignButton.SetPosSizePixel( TEXTFIELDSTARTX, nY, BUTTONWIDTH, BUTTONHEIGHT ); - maSignButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Sign" ) ) ); - maSignButton.SetClickHdl( LINK( this, MyWin, SignButtonHdl ) ); - maSignButton.Show(); - - maVerifyButton.SetPosSizePixel( TEXTFIELDSTARTX+BUTTONWIDTH+BUTTONSPACE, nY, BUTTONWIDTH, BUTTONHEIGHT ); - maVerifyButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Verify" ) ) ); - maVerifyButton.SetClickHdl( LINK( this, MyWin, VerifyButtonHdl ) ); - maVerifyButton.Show(); - - nY += EDITHEIGHT*3; - -#endif // TEST_IMPLEMENTATION_DIRECTLY - maTest2Line.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); maTest2Line.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Test Office Document" ) ) ); maTest2Line.Show(); @@ -410,142 +355,4 @@ IMPL_LINK( MyWin, VerifyDigitalSignaturesHdl, Button*, EMPTYARG ) return 0; } - -#ifdef TEST_IMPLEMENTATION_DIRECTLY - -IMPL_LINK( MyWin, DigitalSignaturesWithTokenHdl, Button*, EMPTYARG ) -{ - String aDocFileName = maEditDOCFileName.GetText(); - String aTokenFileName = maEditTokenName.GetText(); - - DigitalSignaturesDialog aSignaturesDialog( this, comphelper::getProcessServiceFactory(), SignatureModeDocumentContent, false ); - - bool bInit = aSignaturesDialog.Init( aTokenFileName ); - if ( !bInit ) - { - ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error initializing security context!" ) ) ).Execute(); - return 0; - } - - uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL( - aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() ); - - aSignaturesDialog.SetStorage( xStore ); - - aSignaturesDialog.Execute(); - - return 0; -} - -IMPL_LINK( MyWin, SignButtonHdl, Button*, EMPTYARG ) -{ - String aXMLFileName = maEditXMLFileName.GetText(); - String aBINFileName = maEditBINFileName.GetText(); - String aSIGFileName = maEditSIGFileName.GetText(); - - String aTokenFileName; - if ( !maCryptoCheckBox.IsChecked() ) - aTokenFileName = maEditTokenName.GetText(); - - XMLSignatureHelper aSignatureHelper( comphelper::getProcessServiceFactory() ); - bool bInit = aSignatureHelper.Init( aTokenFileName ); - - if ( !bInit ) - { - ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error initializing security context!" ) ) ).Execute(); - return 0; - } - - uno::Reference< ::com::sun::star::security::XCertificate > xCertToUse; - CertificateChooser aChooser( this, aSignatureHelper.GetSecurityEnvironment(), SignatureInformations() ); - if ( aChooser.Execute() ) - xCertToUse = aChooser.GetSelectedCertificate(); - - if ( !xCertToUse.is() ) - return 0; - - - aSignatureHelper.StartMission(); - - 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, sal_True ); - uno::Reference< io::XOutputStream > xOutputStream = new utl::OOutputStreamHelper( xLockBytes ); - bool bDone = aSignatureHelper.CreateAndWriteSignature( xOutputStream ); - - aSignatureHelper.EndMission(); - - if ( !bDone ) - { - ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error creating Signature!" ) ) ).Execute(); - } - else - { - rtl::OUString aInfo( String( RTL_CONSTASCII_USTRINGPARAM( "Signature successfully created!\n\n" ) ) ); - // aInfo += getSignatureInformationmations( aSignatureHelper.getAllSignatureInformation(), aSignatureHelper.GetSecurityEnvironment() ); - - - InfoBox( this, aInfo ).Execute(); - } - - // Check for more detailed results... - - return 0; -} - -IMPL_LINK( MyWin, VerifyButtonHdl, Button*, EMPTYARG ) -{ - String aXMLFileName = maEditXMLFileName.GetText(); - String aBINFileName = maEditBINFileName.GetText(); - String aSIGFileName = maEditSIGFileName.GetText(); - - String aTokenFileName; - if ( !maCryptoCheckBox.IsChecked() ) - aTokenFileName = maEditTokenName.GetText(); - - XMLSignatureHelper aSignatureHelper( comphelper::getProcessServiceFactory() ); - bool bInit = aSignatureHelper.Init( aTokenFileName ); - - if ( !bInit ) - { - ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error initializing security context!" ) ) ).Execute(); - return 0; - } - - aSignatureHelper.SetStartVerifySignatureHdl( LINK( this, MyWin, StartVerifySignatureHdl ) ); - - aSignatureHelper.StartMission(); - - SvFileStream* pStream = new SvFileStream( aSIGFileName, STREAM_READ ); - pStream->Seek( STREAM_SEEK_TO_END ); - sal_uLong nBytes = pStream->Tell(); - pStream->Seek( STREAM_SEEK_TO_BEGIN ); - SvLockBytesRef xLockBytes = new SvLockBytes( pStream, sal_True ); - uno::Reference< io::XInputStream > xInputStream = new utl::OInputStreamHelper( xLockBytes, nBytes ); - bool bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream ); - xInputStream->closeInput(); - - aSignatureHelper.EndMission(); - - if ( !bDone ) - ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error in Signature!" ) ) ).Execute(); - else - InfoBox( this, String( RTL_CONSTASCII_USTRINGPARAM( "Signatures verified without any problems!" ) ) ).Execute(); - - return 0; -} - -IMPL_LINK( MyWin, StartVerifySignatureHdl, void*, EMPTYARG ) -{ - QueryBox aQueryBox( this, WB_YES_NO|WB_DEF_YES, String( RTL_CONSTASCII_USTRINGPARAM( "Found Signature - Verify?" ) ) ); - return ( aQueryBox.Execute() == RET_YES ) ? 1 : 0; -} - - -#endif // #ifdef TEST_IMPLEMENTATION_DIRECTLY +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |