From c49378c78001f2c11fa322f28bea7fedf06d1065 Mon Sep 17 00:00:00 2001 From: Eugene Bochilo Date: Thu, 21 Dec 2023 01:39:36 +0000 Subject: [PATCH] Fix trimming zeroes in timestamp signature DEVSIX-7968 Autoported commit. Original commit hash: [4a450b052] --- itext/itext.sign/itext/signatures/LtvVerification.cs | 9 +-------- port-hash | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/itext/itext.sign/itext/signatures/LtvVerification.cs b/itext/itext.sign/itext/signatures/LtvVerification.cs index cb92ee2d23..640e15a299 100644 --- a/itext/itext.sign/itext/signatures/LtvVerification.cs +++ b/itext/itext.sign/itext/signatures/LtvVerification.cs @@ -427,14 +427,7 @@ private PdfName GetSignatureHashKey(String signatureName) { PdfSignature sig = sgnUtil.GetSignature(signatureName); PdfString contents = sig.GetContents(); byte[] bc = PdfEncodings.ConvertToBytes(contents.GetValue(), null); - byte[] bt = null; - if (PdfName.ETSI_RFC3161.Equals(sig.GetSubFilter())) { - using (IAsn1InputStream din = BOUNCY_CASTLE_FACTORY.CreateASN1InputStream(new MemoryStream(bc))) { - IAsn1Object pkcs = din.ReadObject(); - bc = pkcs.GetEncoded(); - } - } - bt = HashBytesSha1(bc); + byte[] bt = HashBytesSha1(bc); return new PdfName(ConvertToHex(bt)); } diff --git a/port-hash b/port-hash index 4f552e4f8b..f35038423f 100644 --- a/port-hash +++ b/port-hash @@ -1 +1 @@ -b51c25ba7752003b9c0fed59d223e4865e643e90 +4a450b052fd7754561a7ced40a191e407ac5585b