Skip to content

Commit

Permalink
Fix trimming zeroes in timestamp signature
Browse files Browse the repository at this point in the history
DEVSIX-7968

Autoported commit.
Original commit hash: [4a450b052]
  • Loading branch information
Eugene Bochilo authored and iText-CI committed Dec 21, 2023
1 parent 01a79cd commit c49378c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions itext/itext.sign/itext/signatures/LtvVerification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
2 changes: 1 addition & 1 deletion port-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b51c25ba7752003b9c0fed59d223e4865e643e90
4a450b052fd7754561a7ced40a191e407ac5585b

0 comments on commit c49378c

Please sign in to comment.