diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:32:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:33:41 +0100 |
commit | c5f1e8c3bbf6bb534b387cdafd1983204f82dd37 (patch) | |
tree | 489056e0c5d332f3eeb948cdd11053330ef5b822 /xmlsecurity/source/xmlsec/nss | |
parent | f701cce539c58874c07ef7487075b29143cc9ed1 (diff) |
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I42fdc042ed7317b5b6c337e7b38966e616f8e24b
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/ciphercontext.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx index fbf99a799e67..1a5b47319c8f 100644 --- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx +++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx @@ -157,7 +157,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c { int nResultLen = 0; aResult.realloc( aToConvert.getLength() + m_nBlockSize ); - if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nResultLen, aResult.getLength(), const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( aToConvert.getConstArray() ) ), aToConvert.getLength() ) != SECSuccess ) + if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nResultLen, aResult.getLength(), reinterpret_cast< const unsigned char* >( aToConvert.getConstArray() ), aToConvert.getLength() ) != SECSuccess ) { m_bBroken = true; Dispose(); @@ -221,7 +221,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis { int nPrefResLen = 0; aResult.realloc( m_aLastBlock.getLength() + m_nBlockSize ); - if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nPrefResLen, aResult.getLength(), const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( m_aLastBlock.getConstArray() ) ), m_aLastBlock.getLength() ) != SECSuccess ) + if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nPrefResLen, aResult.getLength(), reinterpret_cast< const unsigned char* >( m_aLastBlock.getConstArray() ), m_aLastBlock.getLength() ) != SECSuccess ) { m_bBroken = true; Dispose(); diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index cfa3b8a9a896..0355e27bb7a6 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -437,7 +437,7 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O // Create cert info from issue and serial OString ostr = OUStringToOString( issuerName , RTL_TEXTENCODING_UTF8 ) ; - chIssuer = PL_strndup( ( char* )ostr.getStr(), ( int )ostr.getLength() ) ; + chIssuer = PL_strndup( ostr.getStr(), ( int )ostr.getLength() ) ; nmIssuer = CERT_AsciiToName( chIssuer ) ; if( nmIssuer == NULL ) { PL_strfree( chIssuer ) ; @@ -508,7 +508,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_NssImpl :: buildCerti //Get the system clock time timeboundary = PR_Now() ; - certChain = CERT_GetCertChainFromCert( ( CERTCertificate* )cert, timeboundary, certUsageAnyCA ) ; + certChain = CERT_GetCertChainFromCert( const_cast<CERTCertificate*>(cert), timeboundary, certUsageAnyCA ) ; } else { certChain = NULL ; } @@ -844,13 +844,13 @@ sal_Int32 SecurityEnvironment_NssImpl::getCertificateCharacters( if (cert->slot != NULL) { - priKey = PK11_FindPrivateKeyFromCert( cert->slot, ( CERTCertificate* )cert, NULL ) ; + priKey = PK11_FindPrivateKeyFromCert( cert->slot, const_cast<CERTCertificate*>(cert), NULL ) ; } if(priKey == NULL) { for (CIT_SLOTS is = m_Slots.begin(); is != m_Slots.end(); is++) { - priKey = PK11_FindPrivateKeyFromCert(*is, (CERTCertificate*)cert, NULL); + priKey = PK11_FindPrivateKeyFromCert(*is, const_cast<CERTCertificate*>(cert), NULL); if (priKey) break; } |