From 02cb1fc65b9ecd1f520eec742bd8aade4eae889d Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 2 Jul 2014 12:57:17 +1000 Subject: [PATCH] Allocate cipher with EVP_CIPHER_CTX_new. Thanks @Adam- for the tip. --- native/src/main/c/NativeCipherImpl.cpp | 2 +- native/src/main/resources/native-cipher.so | Bin 8333 -> 8348 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/native/src/main/c/NativeCipherImpl.cpp b/native/src/main/c/NativeCipherImpl.cpp index 1c2981dd..70aff5c8 100644 --- a/native/src/main/c/NativeCipherImpl.cpp +++ b/native/src/main/c/NativeCipherImpl.cpp @@ -6,7 +6,7 @@ typedef unsigned char byte; jlong JNICALL Java_net_md_15_bungee_NativeCipherImpl_init(JNIEnv* env, jobject obj, jboolean forEncryption, jbyteArray key) { jbyte *keyBytes = env->GetByteArrayElements(key, NULL); - EVP_CIPHER_CTX *cipherCtx = new EVP_CIPHER_CTX(); + EVP_CIPHER_CTX *cipherCtx = EVP_CIPHER_CTX_new(); EVP_CipherInit(cipherCtx, EVP_aes_128_cfb8(), (byte*) keyBytes, (byte*) keyBytes, forEncryption); env->ReleaseByteArrayElements(key, keyBytes, JNI_ABORT); diff --git a/native/src/main/resources/native-cipher.so b/native/src/main/resources/native-cipher.so index 9fd92de91ea498ce0f52cb7d9085ec67b136f2c1..3bea4ebbfd73b6fa5776ac010d8f12cd30e6900f 100755 GIT binary patch delta 2278 zcmZ`)eQZ-z6uIgAx zxIt2ug^r^p5}5dpO#cwfi~;|lbA0R%BtZOtXhKB^twA%u#6`t=?(2OBQ_r${?(cW* zJ@?$x^X}>MAM~f3{8&+c`67S9L{!lE@1gCia&p%=Q37p{Ec8lYnbaHpc*Ht&}UXBUv(~<)ReuSIc zO#8y7uWru1c>3sPKkR?~yU5w2*WubRn90}jfg;$;S3`z(a!yu|$ue!&SboSlSH zLE=85BQzk_#XDh~cltsYt(7>)TC1lJDI3qDwvl2IU>7hlJ`PF2JuAatl(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