Skip to content

Commit a07114a

Browse files
committed
Use the proper method to update a signature with salt
Fixes #1780 Using update() instead of sigOut.write() caused some preprocessing on the salt value in some cases (Cleartext Signature Framework line endings), which resulted in broken signature verification.
1 parent 93f7239 commit a07114a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pg/src/main/java/org/bouncycastle/openpgp/PGPSignature.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,18 @@ private void checkSaltSize()
195195
}
196196

197197
private void updateWithSalt()
198+
throws PGPException
198199
{
199200
if (getVersion() == SignaturePacket.VERSION_6)
200201
{
201-
update(sigPck.getSalt());
202+
try
203+
{
204+
sigOut.write(sigPck.getSalt());
205+
}
206+
catch (IOException e)
207+
{
208+
throw new PGPException("Could not update with salt.", e);
209+
}
202210
}
203211
}
204212

0 commit comments

Comments
 (0)