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

Bouncycastle throw ClassCastException after upgrade to 1.59 #847

Open
yurem opened this Issue Jul 11, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@yurem
Contributor

yurem commented Jul 11, 2018

Here is sample stack trace after test requestClaimsIndividuallyRequestObjectSigningAlgES256UserInfoSignedResponseAlgES256 execution:

1:17:12.659 [main] ERROR org.xdi.oxauth.model.jws.AbstractJwsSigner - java.lang.ClassCastException: org.bouncycastle.math.ec.ECFieldElement$Fp cannot be cast to org.bouncycastle.math.ec.custom.sec.SecP256R1FieldElement
java.security.SignatureException: java.lang.ClassCastException: org.bouncycastle.math.ec.ECFieldElement$Fp cannot be cast to org.bouncycastle.math.ec.custom.sec.SecP256R1FieldElement
	at org.xdi.oxauth.model.jws.ECDSASigner.validateSignature(ECDSASigner.java:158) ~[classes/:?]
	at org.xdi.oxauth.model.jws.AbstractJwsSigner.validate(AbstractJwsSigner.java:54) [classes/:?]
	at org.xdi.oxauth.ws.rs.IndividualClaimsRequestsTest.requestClaimsIndividuallyRequestObjectSigningAlgES256UserInfoSignedResponseAlgES256(IndividualClaimsRequestsTest.java:1328) [test-classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) [testng-6.14.3.jar:?]
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:583) [testng-6.14.3.jar:?]
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719) [testng-6.14.3.jar:?]
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989) [testng-6.14.3.jar:?]
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) [testng-6.14.3.jar:?]
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) [testng-6.14.3.jar:?]
	at org.testng.TestRunner.privateRun(TestRunner.java:648) [testng-6.14.3.jar:?]
	at org.testng.TestRunner.run(TestRunner.java:505) [testng-6.14.3.jar:?]
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:455) [testng-6.14.3.jar:?]
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450) [testng-6.14.3.jar:?]
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415) [testng-6.14.3.jar:?]
	at org.testng.SuiteRunner.run(SuiteRunner.java:364) [testng-6.14.3.jar:?]
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [testng-6.14.3.jar:?]
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84) [testng-6.14.3.jar:?]
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208) [testng-6.14.3.jar:?]
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1137) [testng-6.14.3.jar:?]
	at org.testng.TestNG.runSuites(TestNG.java:1049) [testng-6.14.3.jar:?]
	at org.testng.TestNG.run(TestNG.java:1017) [testng-6.14.3.jar:?]
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114) [testng-remote.jar:?]
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) [testng-remote.jar:?]
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) [testng-remote.jar:?]
Caused by: java.lang.ClassCastException: org.bouncycastle.math.ec.ECFieldElement$Fp cannot be cast to org.bouncycastle.math.ec.custom.sec.SecP256R1FieldElement
	at org.bouncycastle.math.ec.custom.sec.SecP256R1Point.add(Unknown Source) ~[bcprov-jdk15on-1.59.jar:1.59.0]
	at org.bouncycastle.math.ec.WNafUtil.precompute(Unknown Source) ~[bcprov-jdk15on-1.59.jar:1.59.0]
	at org.bouncycastle.math.ec.ECAlgorithms.implShamirsTrickWNaf(Unknown Source) ~[bcprov-jdk15on-1.59.jar:1.59.0]
	at org.bouncycastle.math.ec.ECAlgorithms.sumOfTwoMultiplies(Unknown Source) ~[bcprov-jdk15on-1.59.jar:1.59.0]
	at org.bouncycastle.crypto.signers.ECDSASigner.verifySignature(Unknown Source) ~[bcprov-jdk15on-1.59.jar:1.59.0]
	at org.bouncycastle.jcajce.provider.asymmetric.util.DSABase.engineVerify(Unknown Source) ~[bcprov-jdk15on-1.59.jar:1.59.0]
	at java.security.Signature$Delegate.engineVerify(Signature.java:1223) ~[?:1.8.0_162]
	at java.security.Signature.verify(Signature.java:656) ~[?:1.8.0_162]
	at org.xdi.oxauth.model.jws.ECDSASigner.validateSignature(ECDSASigner.java:146) ~[classes/:?]
	... 27 more
FAILED: requestClaimsIndividuallyRequestObjectSigningAlgES256UserInfoSignedResponseAlgES256("test_user", "test_user_password", "https://ce-dev5.gluu.org/oxauth-rp/home.htm https://client.example.com/cb https://client.example.com/cb1 https://client.example.com/cb2", "https://ce-dev5.gluu.org/oxauth-rp/home.htm", "https://ce-dev5.gluu.org/oxauth/sectoridentifier/@!2128.9AFB.B310.EB30!0001!690B.5F8F!0012!D426.70FD", "547b2838-a848-4671-8a47-d5361738f2ae", "CN=oxAuth CA Certificates", "profiles/default/client_keystore.jks", "secret", "https://ce-dev5.gluu.org/oxauth-client/test/resources/jwks.json")
java.lang.AssertionError: expected [true] but found [false]
	at org.testng.Assert.fail(Assert.java:96)
	at org.testng.Assert.failNotEquals(Assert.java:776)
	at org.testng.Assert.assertTrue(Assert.java:44)
	at org.testng.Assert.assertTrue(Assert.java:54)
	at org.xdi.oxauth.ws.rs.IndividualClaimsRequestsTest.requestClaimsIndividuallyRequestObjectSigningAlgES256UserInfoSignedResponseAlgES256(IndividualClaimsRequestsTest.java:1328)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:648)
	at org.testng.TestRunner.run(TestRunner.java:505)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
	at org.testng.SuiteRunner.run(SuiteRunner.java:364)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
	at org.testng.TestNG.runSuites(TestNG.java:1049)
	at org.testng.TestNG.run(TestNG.java:1017)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

@yurem yurem added this to the 4.0 milestone Jul 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment