summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/gpg
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-12 12:18:07 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-08-23 09:10:49 +0200
commit24c17dab2f10ad1b7ba342fbd40dc65b7d8f9b24 (patch)
tree5449a884fc53cf66fe1f02dfa21a5abd268bc3c1 /xmlsecurity/source/gpg
parentdd7d90055545cb20aa5c12c0be44cccaefdeac47 (diff)
tdf#39593 extract UnoTunnelId comparison to template function
Change-Id: Ia2b5dea273c8de7b8c54e74780193a8d4cba7b45 Reviewed-on: https://gerrit.libreoffice.org/73874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmlsecurity/source/gpg')
-rw-r--r--xmlsecurity/source/gpg/CertificateImpl.cxx2
-rw-r--r--xmlsecurity/source/gpg/SecurityEnvironment.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx
index 3b005629ba7a..525706e26748 100644
--- a/xmlsecurity/source/gpg/CertificateImpl.cxx
+++ b/xmlsecurity/source/gpg/CertificateImpl.cxx
@@ -197,7 +197,7 @@ sal_Int32 SAL_CALL CertificateImpl::getCertificateUsage()
/* XUnoTunnel */
sal_Int64 SAL_CALL CertificateImpl::getSomething(const Sequence< sal_Int8 >& aIdentifier)
{
- if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( isUnoTunnelId<CertificateImpl>(aIdentifier) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;
diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
index 42fa728d83f4..468738f34c33 100644
--- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx
+++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
@@ -92,7 +92,7 @@ SecurityEnvironmentGpg::~SecurityEnvironmentGpg()
/* XUnoTunnel */
sal_Int64 SAL_CALL SecurityEnvironmentGpg::getSomething( const Sequence< sal_Int8 >& aIdentifier )
{
- if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+ if( isUnoTunnelId<SecurityEnvironmentGpg>(aIdentifier) ) {
return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
}
return 0 ;