diff options
Diffstat (limited to 'comphelper/source/misc/xmlsechelper.cxx')
-rw-r--r-- | comphelper/source/misc/xmlsechelper.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/comphelper/source/misc/xmlsechelper.cxx b/comphelper/source/misc/xmlsechelper.cxx index d0b4b3074ca9..86df56cfc0e5 100644 --- a/comphelper/source/misc/xmlsechelper.cxx +++ b/comphelper/source/misc/xmlsechelper.cxx @@ -260,25 +260,16 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) #endif - OUString GetContentPart( const OUString& _rRawString ) + OUString GetContentPart( const OUString& _rRawString, const css::security::CertificateKind &rKind ) { char const * aIDs[] = { "CN", "OU", "O", "E", nullptr }; - bool shouldBeParsed = false; - int i = 0; - while ( aIDs[i] ) - { - if (_rRawString.startsWith(OUString::createFromAscii(aIDs[i++]))) - { - shouldBeParsed = true; - break; - } - } - if (!shouldBeParsed) + // tdf#131733 Don't process OpenPGP certs, only X509 + if (rKind == css::security::CertificateKind_OPENPGP ) return _rRawString; OUString retVal; - i = 0; + int i = 0; vector< pair< OUString, OUString > > vecAttrValueOfDN = parseDN(_rRawString); while ( aIDs[i] ) { @@ -290,7 +281,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) if (!retVal.isEmpty()) break; } - return retVal; + return retVal.isEmpty() ? _rRawString : retVal; } OUString GetHexString( const css::uno::Sequence< sal_Int8 >& _rSeq, const char* _pSep, sal_uInt16 _nLineBreak ) |