From 5a7157d319477830426797532e02ac39d3b859f4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:29:03 +0200 Subject: Merging upstream version 4:24.2.1. Signed-off-by: Daniel Baumann --- svl/source/crypto/cryptosign.cxx | 5 +++-- svl/source/passwordcontainer/passwordcontainer.cxx | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'svl/source') diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index a234afccbc..3fe6ae90ab 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -1037,6 +1037,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) ts_digest.len = aTsHashResult.size(); unsigned char cOne = 1; + unsigned char cTRUE = 0xff; // under DER rules true is 0xff, false is 0x00 src.version.type = siUnsignedInteger; src.version.data = &cOne; src.version.len = sizeof(cOne); @@ -1056,8 +1057,8 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) src.nonce.len = sizeof(nNonce); src.certReq.type = siUnsignedInteger; - src.certReq.data = &cOne; - src.certReq.len = sizeof(cOne); + src.certReq.data = &cTRUE; + src.certReq.len = sizeof(cTRUE); src.extensions = nullptr; diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 333e2921b4..90b27c29f7 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -654,7 +654,10 @@ OUString PasswordContainer::createIV() { rtlRandomPool randomPool = mRandomPool.get(); unsigned char iv[RTL_DIGEST_LENGTH_MD5]; - rtl_random_getBytes(randomPool, iv, RTL_DIGEST_LENGTH_MD5); + if (rtl_random_getBytes(randomPool, iv, RTL_DIGEST_LENGTH_MD5) != rtl_Random_E_None) + { + throw uno::RuntimeException("rtl_random_getBytes failed"); + } OUStringBuffer aBuffer; for (sal_uInt8 i : iv) { -- cgit v1.2.3