From 7efb68197eaedf736e2d41cbf33ba2c701e00dce Mon Sep 17 00:00:00 2001 From: Peter Burow Date: Fri, 20 Aug 2004 07:41:20 +0000 Subject: fix: #i33090# isLocationTrusted() implemented --- .../source/component/documentdigitalsignatures.cxx | 30 +++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 5d1358999015..beb01f2a74f6 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -2,9 +2,9 @@ * * $RCSfile: documentdigitalsignatures.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mmi $ $Date: 2004-08-12 02:29:20 $ + * last change: $Author: pb $ $Date: 2004-08-20 08:41:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,16 +75,16 @@ #ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_ #include #endif +#ifndef _URLOBJ_HXX +#include +#endif #ifndef INCLUDED_SVTOOLS_SECURITYOPTIONS_HXX #include #endif - - using namespace ::com::sun::star; using namespace ::com::sun::star; - DocumentDigitalSignatures::DocumentDigitalSignatures( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory> rxMSF ) { mxMSF = rxMSF; @@ -239,7 +239,25 @@ void DocumentDigitalSignatures::ShowCertificate( const ::com::sun::star::uno::Re ::sal_Bool DocumentDigitalSignatures::isLocationTrusted( const ::rtl::OUString& Location ) throw (::com::sun::star::uno::RuntimeException) { - return sal_False; + sal_Bool bFound = sal_False; + INetURLObject aLocObj( Location ); + + SvtSecurityOptions aSecOpt; + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSecURLs = aSecOpt.GetSecureURLs(); + sal_Int32 nCnt = aSecURLs.getLength(); + const ::rtl::OUString* pSecURLs = aSecURLs.getConstArray(); + const ::rtl::OUString* pSecURLsEnd = pSecURLs + aSecURLs.getLength(); + for ( ; pSecURLs != pSecURLsEnd; ++pSecURLs ) + { + INetURLObject aSecURL( *pSecURLs ); + if ( aSecURL == aLocObj ) + { + bFound = sal_True; + break; + } + } + + return bFound; } void DocumentDigitalSignatures::addAuthorToTrustedSources( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& Author ) throw (::com::sun::star::uno::RuntimeException) -- cgit v1.2.3