diff options
| -rw-r--r-- | src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java | 12 | ||||
| -rw-r--r-- | src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java | 10 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java b/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java index 31886cf..aa053bf 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java +++ b/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java @@ -20,6 +20,10 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { ECPublicKey publicKey; ECParameterSpec params; + public NativeKeyAgreementSpi() { + + } + @Override protected void engineInit(Key key, SecureRandom random) throws InvalidKeyException { if (!(key instanceof ECPrivateKey)) { @@ -77,6 +81,10 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { private abstract static class SimpleKeyAgreementSpi extends NativeKeyAgreementSpi { + public SimpleKeyAgreementSpi() { + + } + @Override protected byte[] engineGenerateSecret() throws IllegalStateException { byte[] pubkey; @@ -99,6 +107,10 @@ public abstract class NativeKeyAgreementSpi extends KeyAgreementSpi { private abstract static class ExtendedKeyAgreementSpi extends NativeKeyAgreementSpi { + public ExtendedKeyAgreementSpi() { + + } + @Override protected byte[] engineGenerateSecret() throws IllegalStateException { return generateSecret(publicKey, privateKey, params); diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java b/src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java index f580d74..fef2930 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java +++ b/src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java @@ -12,10 +12,14 @@ public abstract class NativeProvider extends Provider { public NativeProvider(String name, double version, String info) { super(name, version, info); - AccessController.doPrivileged((PrivilegedAction<Object>) () -> { + if (System.getSecurityManager() == null) { setup(); - return null; - }); + } else { + AccessController.doPrivileged((PrivilegedAction<Object>) () -> { + setup(); + return null; + }); + } } abstract void setup(); |
