Skip to content

Commit

Permalink
8258186: Replace use of JNI_COMMIT mode with mode 0
Browse files Browse the repository at this point in the history
Reviewed-by: xuelei, alanb
  • Loading branch information
Valerie Peng committed Dec 23, 2020
1 parent e46edb5 commit cd94606
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
*/

/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
Expand Down Expand Up @@ -173,7 +173,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1Encrypt
(*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT);
}
if (directOut == 0 && outBufP != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT);
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, 0);
}
return ckEncryptedLen;
}
Expand Down Expand Up @@ -239,7 +239,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptUpdate
(*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT);
}
if (directOut == 0 && outBufP != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT);
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, 0);
}
return ckEncryptedPartLen;
}
Expand Down Expand Up @@ -284,7 +284,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptFinal
&ckLastEncryptedPartLen);

if (directOut == 0) {
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT);
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, 0);
}

ckAssertReturnValueOK(env, rv);
Expand Down Expand Up @@ -408,7 +408,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1Decrypt
(*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT);
}
if (directOut == 0 && outBufP != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT);
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, 0);
}
return ckOutLen;
}
Expand Down Expand Up @@ -472,7 +472,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptUpdate
(*env)->ReleasePrimitiveArrayCritical(env, jIn, inBufP, JNI_ABORT);
}
if (directOut == 0 && outBufP != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT);
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, 0);
}
return ckDecryptedPartLen;
}
Expand Down Expand Up @@ -518,7 +518,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptFinal
&ckLastPartLen);

if (directOut == 0) {
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, JNI_COMMIT);
(*env)->ReleasePrimitiveArrayCritical(env, jOut, outBufP, 0);

}

Expand Down

1 comment on commit cd94606

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.