summaryrefslogtreecommitdiffstats
path: root/xmlsecurity
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index cb740e5d3ede..6842a698fe08 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -135,11 +135,13 @@ char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ )
if ( pPasswordRequest->isPassword() )
{
- ByteString aPassword = ByteString( String( pPasswordRequest->getPassword() ), gsl_getSystemTextEncoding() );
- sal_uInt16 nLen = aPassword.Len();
+ rtl::OString aPassword(rtl::OUStringToOString(
+ pPasswordRequest->getPassword(),
+ osl_getThreadTextEncoding()));
+ sal_Int32 nLen = aPassword.getLength();
char* pPassword = (char*) PORT_Alloc( nLen+1 ) ;
pPassword[nLen] = 0;
- memcpy( pPassword, aPassword.GetBuffer(), nLen );
+ memcpy( pPassword, aPassword.getStr(), nLen );
return pPassword;
}
}