# HG changeset patch # User shade # Date 1560499377 -7200 # Node ID c3b354fdbaa4de8a0649ec9d022719291d704154 # Parent c53db49c7a2f0479079a4d04f037849d2dc3d864 8225695: 32-bit build failures after JDK-8080462 (Update SunPKCS11 provider with PKCS11 v2.40 support) Reviewed-by: alanb diff -r c53db49c7a2f -r c3b354fdbaa4 src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c Fri Jun 14 03:50:25 2019 +0200 +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c Fri Jun 14 10:02:57 2019 +0200 @@ -51,6 +51,7 @@ #include #include #include +#include "jlong.h" #include "sun_security_pkcs11_wrapper_PKCS11.h" @@ -96,8 +97,8 @@ Java_sun_security_pkcs11_wrapper_PKCS11_freeMechanism (JNIEnv *env, jclass thisClass, jlong ckpMechanism) { if (ckpMechanism != 0L) { - freeCKMechanismPtr((CK_MECHANISM_PTR) ckpMechanism); - TRACE1("DEBUG PKCS11_freeMechanism: free pMech = %x\n", (jlong)ckpMechanism); + freeCKMechanismPtr(jlong_to_ptr(ckpMechanism)); + TRACE1("DEBUG PKCS11_freeMechanism: free pMech = %x\n", ckpMechanism); } return 0L; } diff -r c53db49c7a2f -r c3b354fdbaa4 src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c Fri Jun 14 03:50:25 2019 +0200 +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c Fri Jun 14 10:02:57 2019 +0200 @@ -91,8 +91,8 @@ (ckpMechanism->pParameter == NULL)) { freeCKMechanismPtr(ckpMechanism); } else { - (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); - TRACE1("DEBUG C_SignInit: stored pMech = 0x%lX\n", (jlong)ckpMechanism); + (*env)->SetLongField(env, jMechanism, mech_pHandleID, ptr_to_jlong(ckpMechanism)); + TRACE1("DEBUG C_SignInit: stored pMech = 0x%lX\n", ptr_to_jlong(ckpMechanism)); } TRACE0("FINISHED\n"); } @@ -303,8 +303,8 @@ (ckpMechanism->pParameter == NULL)) { freeCKMechanismPtr(ckpMechanism); } else { - (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); - TRACE1("DEBUG C_SignRecoverInit, stored pMech = 0x%lX\n", (jlong)ckpMechanism); + (*env)->SetLongField(env, jMechanism, mech_pHandleID, ptr_to_jlong(ckpMechanism)); + TRACE1("DEBUG C_SignRecoverInit, stored pMech = 0x%lX\n", ptr_to_jlong(ckpMechanism)); } TRACE0("FINISHED\n"); } @@ -413,8 +413,8 @@ (ckpMechanism->pParameter == NULL)) { freeCKMechanismPtr(ckpMechanism); } else { - (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); - TRACE1("DEBUG C_VerifyInit: stored pMech = 0x%lX\n", (jlong)ckpMechanism); + (*env)->SetLongField(env, jMechanism, mech_pHandleID, ptr_to_jlong(ckpMechanism)); + TRACE1("DEBUG C_VerifyInit: stored pMech = 0x%lX\n", ptr_to_jlong(ckpMechanism)); } TRACE0("FINISHED\n"); } @@ -601,8 +601,8 @@ (ckpMechanism->pParameter == NULL)) { freeCKMechanismPtr(ckpMechanism); } else { - (*env)->SetLongField(env, jMechanism, mech_pHandleID, (jlong)ckpMechanism); - TRACE1("DEBUG C_VerifyRecoverInit: stored pMech = 0x%lX\n", (jlong)ckpMechanism); + (*env)->SetLongField(env, jMechanism, mech_pHandleID, ptr_to_jlong(ckpMechanism)); + TRACE1("DEBUG C_VerifyRecoverInit: stored pMech = 0x%lX\n", ptr_to_jlong(ckpMechanism)); } TRACE0("FINISHED\n"); }