summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
diff options
context:
space:
mode:
authortono <tono@openoffice.org>2010-03-24 06:43:30 +0900
committertono <tono@openoffice.org>2010-03-24 06:43:30 +0900
commite28e96bb5f5baf528e819d36eb9ce4747456bfea (patch)
tree4491117900c2d998a4f4f51b2567221b9cdca339 /xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
parent97412488d9fcd77c21dbeb821dec122008cd2e32 (diff)
parent94bf193db97db0d4ccf6491f8886fdca44e4b252 (diff)
mingwport29: merge with DEV300 m75
Diffstat (limited to 'xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx')
-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 d746f6831e4a..9c505800388f 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -260,24 +260,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 ,
@@ -289,22 +292,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() ;
}
}