Skip to content

Commit 01363f2

Browse files
committed
Call BCPGOutputStream.finish for clarity
1 parent ff83bf5 commit 01363f2

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ public void close()
404404
//
405405
BCPGOutputStream bOut = new BCPGOutputStream(genOut, PacketTags.MOD_DETECTION_CODE, 20);
406406

407+
// For clarity; really only required if using partial body lengths
408+
bOut.finish();
407409
bOut.flush();
408410

409411
byte[] dig = digestCalc.getDigest();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,9 @@ public void encode(OutputStream outStream)
840840
{
841841
Util.encodePGPSignatures(out, pub.subSigs, false);
842842
}
843+
844+
// For clarity; really only required if using partial body lengths
845+
out.finish();
843846
}
844847

845848
/**

0 commit comments

Comments
 (0)