Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Signature failures cause NoSuchMethodException on Android Lollipop #17

Open
dkonigsberg opened this issue Mar 9, 2017 · 0 comments
Open

Comments

@dkonigsberg
Copy link

Inside curve25519-jni.c, the following code is used to throw an AssertionError when certain signature functions fail:
(*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/AssertionError"), "Signature failed!");

This works on older versions of Android (e.g. KitKat), however it causes a NoSuchMethodException on newer versions of Android (e.g. Lollipop). This is because AssertionError does not actually have a constructor that takes a String. (Just one that takes an Object, which it internally converts to a string.)

A simple fix would be to pick a different exception that has a String-only constructor. A more complicated fix would be to construct the AssertionError object manually, prior to throwing it.

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

No branches or pull requests

1 participant