summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-15 13:12:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-15 18:03:51 +0200
commit6e267990695548db227c918679b907c60263cb81 (patch)
tree96bca33746fe1a26a348a35c74a1dee8977c349d /xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
parent11bfced0a4f1d5f3ccaf8e1c87c11733ca71f29d (diff)
loplugin:ostr in xmlsecurity
Change-Id: Ifb936c230f68447b3bb5993705adb5e5b790371f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167668 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss/ciphercontext.cxx')
-rw-r--r--xmlsecurity/source/xmlsec/nss/ciphercontext.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
index c6031b7e1566..19e4e3ab991f 100644
--- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
+++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
@@ -41,7 +41,7 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI
if (!xResult->m_pSlot)
{
SAL_WARN("xmlsecurity.nss", "PK11_GetBestSlot failed");
- throw uno::RuntimeException("PK11_GetBestSlot failed");
+ throw uno::RuntimeException(u"PK11_GetBestSlot failed"_ustr);
}
SECItem aKeyItem = { siBuffer,
@@ -52,7 +52,7 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI
if (!xResult->m_pSymKey)
{
SAL_WARN("xmlsecurity.nss", "PK11_ImportSymKey failed");
- throw uno::RuntimeException("PK11_ImportSymKey failed");
+ throw uno::RuntimeException(u"PK11_ImportSymKey failed"_ustr);
}
if (nNSSCipherID == CKM_AES_GCM)
@@ -68,7 +68,7 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI
if (!xResult->m_pSecParam)
{
SAL_WARN("xmlsecurity.nss", "SECITEM_AllocItem failed");
- throw uno::RuntimeException("SECITEM_AllocItem failed");
+ throw uno::RuntimeException(u"SECITEM_AllocItem failed"_ustr);
}
assert(aInitializationVector.getLength() == nAESGCMIVSize);
xResult->m_AESGCMIV = aInitializationVector;
@@ -92,14 +92,14 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI
if (!xResult->m_pSecParam)
{
SAL_WARN("xmlsecurity.nss", "PK11_ParamFromIV failed");
- throw uno::RuntimeException("PK11_ParamFromIV failed");
+ throw uno::RuntimeException(u"PK11_ParamFromIV failed"_ustr);
}
xResult->m_pContext = PK11_CreateContextBySymKey( nNSSCipherID, bEncryption ? CKA_ENCRYPT : CKA_DECRYPT, xResult->m_pSymKey, xResult->m_pSecParam);
if (!xResult->m_pContext)
{
SAL_WARN("xmlsecurity.nss", "PK11_CreateContextBySymKey failed");
- throw uno::RuntimeException("PK11_CreateContextBySymKey failed");
+ throw uno::RuntimeException(u"PK11_CreateContextBySymKey failed"_ustr);
}
}
@@ -111,7 +111,7 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI
if (SAL_MAX_INT8 < xResult->m_nBlockSize)
{
SAL_WARN("xmlsecurity.nss", "PK11_GetBlockSize unexpected result");
- throw uno::RuntimeException("PK11_GetBlockSize unexpected result");
+ throw uno::RuntimeException(u"PK11_GetBlockSize unexpected result"_ustr);
}
return xResult;
}
@@ -160,7 +160,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c
if (SAL_MAX_INT32 - nAESGCMIVSize - nAESGCMTagSize <= static_cast<size_t>(m_aLastBlock.getLength()) + static_cast<size_t>(aData.getLength()))
{
m_bBroken = true;
- throw uno::RuntimeException("overflow");
+ throw uno::RuntimeException(u"overflow"_ustr);
}
m_aLastBlock.realloc(m_aLastBlock.getLength() + aData.getLength());
memcpy(m_aLastBlock.getArray() + m_aLastBlock.getLength() - aData.getLength(), aData.getConstArray(), aData.getLength());
@@ -228,7 +228,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("PK11_CipherOp failed");
+ throw uno::RuntimeException(u"PK11_CipherOp failed"_ustr);
}
m_nConverted += aToConvert.getLength();
@@ -268,7 +268,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("PK11_Encrypt failed");
+ throw uno::RuntimeException(u"PK11_Encrypt failed"_ustr);
}
assert(outLen == sal::static_int_cast<unsigned>(aResult.getLength() - nAESGCMIVSize));
}
@@ -278,7 +278,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("inconsistent IV");
+ throw uno::RuntimeException(u"inconsistent IV"_ustr);
}
aResult.realloc(m_aLastBlock.getLength() - nAESGCMIVSize - nAESGCMTagSize);
if (PK11_Decrypt(m_pSymKey, CKM_AES_GCM, m_pSecParam,
@@ -289,7 +289,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("PK11_Decrypt failed");
+ throw uno::RuntimeException(u"PK11_Decrypt failed"_ustr);
}
assert(outLen == sal::static_int_cast<unsigned>(aResult.getLength()));
}
@@ -297,7 +297,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("incorrect size of input");
+ throw uno::RuntimeException(u"incorrect size of input"_ustr);
}
Dispose();
return aResult;
@@ -309,7 +309,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
// if it is decryption, the amount of data should be rounded to the block size even in case of padding
if ( ( !m_bPadding || !m_bEncryption ) && nSizeForPadding )
- throw uno::RuntimeException("The data should contain complete blocks only." );
+ throw uno::RuntimeException(u"The data should contain complete blocks only."_ustr );
if ( m_bW3CPadding && m_bEncryption )
{
@@ -327,7 +327,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
if (rtl_random_getBytes(nullptr, pLastBlock + nOldLastBlockLen, nPaddingSize - 1) != rtl_Random_E_None)
{
- throw uno::RuntimeException("rtl_random_getBytes failed");
+ throw uno::RuntimeException(u"rtl_random_getBytes failed"_ustr);
}
}
pLastBlock[m_aLastBlock.getLength() - 1] = static_cast< sal_Int8 >( nPaddingSize );
@@ -345,7 +345,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("PK11_CipherOp failed");
+ throw uno::RuntimeException(u"PK11_CipherOp failed"_ustr);
}
aResult.realloc( nPrefResLen );
@@ -359,7 +359,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("PK11_DigestFinal failed");
+ throw uno::RuntimeException(u"PK11_DigestFinal failed"_ustr);
}
aResult.realloc( nPrefixLen + nFinalLen );
@@ -376,7 +376,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
m_bBroken = true;
Dispose();
- throw uno::RuntimeException("incorrect size of padding");
+ throw uno::RuntimeException(u"incorrect size of padding"_ustr);
}
aResult.realloc(aResult.getLength() - aResult[aResult.getLength()-1]);