File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
pg/src/main/java/org/bouncycastle/openpgp Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -216,9 +216,6 @@ private OutputStream open(
216216
217217 pOut = new BCPGOutputStream (out , !useOldFormat );
218218
219- defAlgorithm = dataEncryptorBuilder .getAlgorithm ();
220- rand = dataEncryptorBuilder .getSecureRandom ();
221-
222219 byte [] sessionKey ; // session key, either protected by - or directly derived from session key encryption mechanism.
223220 byte [] sessionInfo ; // sessionKey with prepended alg-id, appended checksum
224221
@@ -284,11 +281,11 @@ private OutputStream open(
284281
285282 try
286283 {
284+ BCPGHeaderObject encOut ;
287285 if (dataEncryptor instanceof PGPAEADDataEncryptor )
288286 {
289287 PGPAEADDataEncryptor encryptor = (PGPAEADDataEncryptor )dataEncryptor ;
290288 long ivOrSaltLen ;
291- BCPGHeaderObject encOut ;
292289 // OpenPGP V5 style AEAD
293290 if (isV5StyleAEAD )
294291 {
@@ -321,10 +318,9 @@ private OutputStream open(
321318 }
322319 else
323320 {
324- BCPGHeaderObject encOut ;
325321 if (digestCalc != null )
326322 {
327- encOut = new SymmetricEncIntegrityPacket ();
323+ encOut = SymmetricEncIntegrityPacket . createVersion1Packet ();
328324 if (useOldFormat )
329325 {
330326 throw new PGPException ("symmetric-enc-integrity packets not supported in old PGP format" );
You can’t perform that action at this time.
0 commit comments