diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-03-02 19:50:45 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-03-02 19:50:45 +0100 |
commit | b4282c788b1d80495b3d7aa678169404c0c07f92 (patch) | |
tree | 98e08fa62ce0d8d91cf5c05352e578aa33b66359 /xmlsecurity/source | |
parent | aa2ce3cd21e1d777021b937edd2ec1b54bcec29e (diff) | |
parent | 2d0ed664c378d9f38a24f9631bcda6b8b363ebed (diff) |
CWS-TOOLING: integrate CWS jl145
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 34 |
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() ; } } |