Clean up JNI code, add stack trace to check up on Jenkins test.
This commit is contained in:
parent
2e80bf30dd
commit
3f7850dc5a
@ -49,19 +49,12 @@ void Java_net_md_15_bungee_NativeCipherImpl_free
|
|||||||
void Java_net_md_15_bungee_NativeCipherImpl_cipher
|
void Java_net_md_15_bungee_NativeCipherImpl_cipher
|
||||||
(JNIEnv* env, jobject obj, jboolean forEncryption, jlong key, jlong iv, jlong in, jlong out, jint length)
|
(JNIEnv* env, jobject obj, jboolean forEncryption, jlong key, jlong iv, jlong in, jlong out, jint length)
|
||||||
{
|
{
|
||||||
AES_KEY *aes_key = (AES_KEY*)key;
|
|
||||||
size_t buffer_length = (size_t) length;
|
|
||||||
|
|
||||||
BYTE *input = (BYTE*) in;
|
|
||||||
BYTE *output = (BYTE*) out;
|
|
||||||
BYTE* jni_iv = (BYTE*) iv;
|
|
||||||
|
|
||||||
AES_cfb8_encrypt(
|
AES_cfb8_encrypt(
|
||||||
input, // input buffer
|
(BYTE*) in, // input buffer
|
||||||
output, // output buffer
|
(BYTE*) out, // output buffer
|
||||||
buffer_length, // readable bytes
|
(size_t) length, // readable bytes
|
||||||
aes_key, // encryption key
|
(AES_KEY*) key, // encryption key
|
||||||
jni_iv, // IV
|
(BYTE*) iv, // IV
|
||||||
NULL, // not needed
|
NULL, // not needed
|
||||||
forEncryption ? AES_ENCRYPT : AES_DECRYPT // encryption mode
|
forEncryption ? AES_ENCRYPT : AES_DECRYPT // encryption mode
|
||||||
);
|
);
|
||||||
|
@ -44,6 +44,7 @@ public class NativeCipher implements BungeeCipher
|
|||||||
loaded = true;
|
loaded = true;
|
||||||
} catch ( Throwable t )
|
} catch ( Throwable t )
|
||||||
{
|
{
|
||||||
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user