summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2009-12-08 15:52:14 +0100
committerJoachim Lingner <jl@openoffice.org>2009-12-08 15:52:14 +0100
commitcbb9a21b81b0753fac59d4e12963492a3c1bbcdc (patch)
tree29b9058e310d70fe3935ae8329be98a3efd42ce8 /xmlsecurity/source
parentd3af929cd34466863ef2699e3398b1fd0ffae337 (diff)
jl145: #i97653# subject name of certificate are not correct displayed if they use special characters
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx34
1 files changed, 16 insertions, 18 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index e01fe5109190..eeca856c4d84 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -263,24 +263,27 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
}
}
-::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) {
- if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) {
- char* subject ;
+::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException)
+{
+ if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL )
+ {
+ wchar_t* subject ;
DWORD cbSubject ;
- cbSubject = CertNameToStr(
+ cbSubject = CertNameToStrW(
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING ,
&( m_pCertContext->pCertInfo->Subject ),
CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG ,
NULL, 0
) ;
- if( cbSubject != 0 ) {
- subject = new char[ cbSubject ] ;
+ if( cbSubject != 0 )
+ {
+ subject = new wchar_t[ cbSubject ] ;
if( subject == NULL )
throw RuntimeException() ;
- cbSubject = CertNameToStr(
+ cbSubject = CertNameToStrW(
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING ,
&( m_pCertContext->pCertInfo->Subject ),
CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG ,
@@ -292,22 +295,17 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
throw RuntimeException() ;
}
- // By CP , for correct encoding
- sal_uInt16 encoding ;
- rtl_Locale *pLocale = NULL ;
- osl_getProcessLocale( &pLocale ) ;
- encoding = osl_getTextEncodingFromLocale( pLocale ) ;
- // CP end
-
- if(subject[cbSubject-1] == 0) cbSubject--; //delimit the last 0x00;
- OUString xSubject(subject , cbSubject ,encoding ) ; //By CP
+ OUString xSubject(subject);
delete [] subject ;
return replaceTagSWithTagST(xSubject);
- } else {
+ } else
+ {
return OUString() ;
}
- } else {
+ }
+ else
+ {
return OUString() ;
}
}