svl/source/crypto/cryptosign.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d2d8f8bf82558d9aa548fb9f13bed410e0baf79b
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 26 12:22:36 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Jan 27 17:44:36 2024 +0100

    tdf#159381 TimeStamp(RFC3161) create problem by asn1 format error.
    
    DER rules say that BOOLEAN values are either FALSE (0x00)
    or TRUE (0xff)
    
    Change-Id: I59f57557fbc4d6447e0d8e994b04adda1ee8c1a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162597
    Tested-by: Noel Grandin <[email protected]>
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx
index a234afccbc27..3fe6ae90ab34 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;
 

Reply via email to