Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HttpEce to use BC provider when calling KeyAgreement #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frmans
Copy link

@frmans frmans commented May 9, 2023

Since there already is a dependency to BouncyCastle in Utils.java it doesn't add any more restrictions doing this, also this solves the following issue #5

Since there already is a dependency to BouncyCastle in Utils.java it doesn't add any more restrictions doing this, also this solves the following issue web-push-libs#5
@dofs197
Copy link

dofs197 commented Jul 3, 2023

This is useful patch. It helped me to reveal the problem under wildfly: https://issues.redhat.com/browse/WFLY-4576

java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
	at javax.crypto.JceSecurity.getInstance(JceSecurity.java:105)
	at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:230)
	at nl.martijndwars.webpush.HttpEce.extractDH(HttpEce.java:360)
...
Caused by: java.lang.SecurityException: Cannot verify jar:vfs:/content/runawfe.ear/lib/bcprov-debug-jdk18on-1.73.jar!/
	at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:448)
...
Caused by: java.security.PrivilegedActionException: java.util.zip.ZipException: zip file is empty
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:426)
	... 75 more
Caused by: java.util.zip.ZipException: zip file is empty
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:225)
	... 77 more
	Suppressed: java.nio.file.NoSuchFileException: /tmp/jar_cache2337284540188290599.tmp
		at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
		... 86 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants