bcgit / bc-java

Bouncy Castle Java Distribution (Mirror)
https://www.bouncycastle.org/java.html
MIT License
2.32k stars 1.14k forks source link

tests run out of memory #1774

Open mouse07410 opened 3 months ago

mouse07410 commented 3 months ago

In testAEADProtectedPGPSecretKey

Java heap space 

java.lang.OutOfMemoryError: Java heap space 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator$Block.<init>(Argon2BytesGenerator.java:630) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator$Block.<init>(Argon2BytesGenerator.java:621) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator.initMemory(Argon2BytesGenerator.java:153) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator.doInit(Argon2BytesGenerator.java:144) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator.init(Argon2BytesGenerator.java:74) 
at org.bouncycastle.openpgp.operator.PGPUtil.makeKeyFromPassPhrase(PGPUtil.java:75) 
at org.bouncycastle.openpgp.operator.PGPUtil.makeKeyFromPassPhrase(PGPUtil.java:211) 
at org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor.makeKeyFromPassPhrase(PBESecretKeyDecryptor.java:26) 
at org.bouncycastle.openpgp.PGPSecretKey.extractKeyData(PGPSecretKey.java:550) 
at org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey(PGPSecretKey.java:688) 
at org.bouncycastle.openpgp.test.AEADProtectedPGPSecretKeyTest.unlockTestVector(AEADProtectedPGPSecretKeyTest.java:109)
at org.bouncycastle.openpgp.test.AEADProtectedPGPSecretKeyTest.performTest(AEADProtectedPGPSecretKeyTest.java:61) 
at org.bouncycastle.util.test.SimpleTest.perform(SimpleTest.java:190) 
at org.bouncycastle.openpgp.test.AEADWithArgon2Test.testAEADProtectedPGPSecretKey(AEADWithArgon2Test.java:21) 
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) 
at junit.extensions.TestSetup$1.protect(TestSetup.java:23) 
at junit.extensions.TestSetup.run(TestSetup.java:27) 

and in testArgon2:

Java heap space 

java.lang.OutOfMemoryError: Java heap space 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator$Block.<init>(Argon2BytesGenerator.java:630) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator$Block.<init>(Argon2BytesGenerator.java:621) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator.initMemory(Argon2BytesGenerator.java:153) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator.doInit(Argon2BytesGenerator.java:144) 
at org.bouncycastle.crypto.generators.Argon2BytesGenerator.init(Argon2BytesGenerator.java:74) 
at org.bouncycastle.openpgp.operator.PGPUtil.makeKeyFromPassPhrase(PGPUtil.java:75) 
at org.bouncycastle.openpgp.operator.PGPUtil.makeKeyFromPassPhrase(PGPUtil.java:211) 
at org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.makeKeyFromPassPhrase(PBEDataDecryptorFactory.java:43) 
at org.bouncycastle.openpgp.PGPPBEEncryptedData.getSessionKey(PGPPBEEncryptedData.java:165) 
at org.bouncycastle.openpgp.PGPPBEEncryptedData.getDataStream(PGPPBEEncryptedData.java:202) 
at org.bouncycastle.openpgp.test.Argon2S2KTest.decryptSymmetricallyEncryptedMessage(Argon2S2KTest.java:176) 
at org.bouncycastle.openpgp.test.Argon2S2KTest.testDecryptAES128Message(Argon2S2KTest.java:137) 
at org.bouncycastle.openpgp.test.Argon2S2KTest.performTest(Argon2S2KTest.java:99) 
at org.bouncycastle.util.test.SimpleTest.perform(SimpleTest.java:190) 
at org.bouncycastle.openpgp.test.Argon2Test.testArgon2(Argon2Test.java:21) 
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) 
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)