Skip to content

Commit 7b73cad

Browse files
glenner003iText-CI
authored andcommitted
Fix signature size calculation in PadesTwoPhaseSigningHelper
DEVSIX-8115 Autoported commit. Original commit hash: [c02f3a1c4]
1 parent 8c62694 commit 7b73cad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

itext/itext.sign/itext/signatures/PadesTwoPhaseSigningHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public virtual CMSContainer CreateCMSContainerWithoutSignature(IX509Certificate[
342342
cms.SetSignerInfo(signerInfo);
343343
IMessageDigest messageDigest = iText.Bouncycastleconnector.BouncyCastleFactoryCreator.GetFactory().CreateIDigest
344344
(DigestAlgorithms.GetDigest(digestAlgorithmOid));
345-
int realSignatureSize = messageDigest.GetDigestLength() + (int)cms.GetSizeEstimation();
345+
int realSignatureSize = (messageDigest.GetDigestLength() + (int)cms.GetSizeEstimation()) * 2 + 2;
346346
if (tsaClient != null) {
347347
realSignatureSize += tsaClient.GetTokenSizeEstimate();
348348
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0988b64c687cd07e2787e25871df7e82f97fb5de
1+
c02f3a1c49366516edd50b61e0cc90f41d109455

0 commit comments

Comments
 (0)