From a62afead6e8dfabb80c9dbeafc5b3b1edbc5aa80 Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Wed, 19 Jun 2024 18:08:11 +0200 Subject: [PATCH] Fix bool marshalling --- .../System.Security.Cryptography.Native.Android/pal_x509.c | 6 +++--- .../System.Security.Cryptography.Native.Android/pal_x509.h | 2 +- .../pal_x509store.c | 2 +- .../pal_x509store.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.c index 3baf304959d63..99c6e522a203c 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.c +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.c @@ -362,12 +362,12 @@ jobject /*X509Certificate*/ AndroidCryptoNative_X509GetCertificateForPrivateKeyE return ToGRef(env, cert); } -bool AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry(jobject entry) +int32_t AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry(jobject entry) { if (!entry) - return false; + return 0; JNIEnv* env = GetJNIEnv(); - return (*env)->IsInstanceOf(env, entry, g_PrivateKeyEntryClass); + return (*env)->IsInstanceOf(env, entry, g_PrivateKeyEntryClass) ? 1 : 0; } diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.h index 388da7a76438e..e840087624cd0 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.h +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.h @@ -65,4 +65,4 @@ PALEXPORT jobject /*X509Certificate*/ AndroidCryptoNative_X509GetCertificateForP /* Checks if the given entry is a private key entry */ -PALEXPORT bool AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry(jobject entry); +PALEXPORT int32_t AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry(jobject entry); diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.c index 1440b2463bcf4..d66617f2d64ae 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.c +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.c @@ -492,7 +492,7 @@ jobject AndroidCryptoNative_X509StoreGetPrivateKeyEntry(jobject /*KeyStore*/ sto return privateKeyEntry; } -bool AndroidCryptoNative_X509StoreDeleteEntry(jobject /*KeyStore*/ store, const char* hashString) +int32_t AndroidCryptoNative_X509StoreDeleteEntry(jobject /*KeyStore*/ store, const char* hashString) { int32_t ret = FAIL; diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.h index 65555e73c2dfd..b76d7e78cb94a 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.h +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.h @@ -79,4 +79,4 @@ PALEXPORT jobject AndroidCryptoNative_X509StoreGetPrivateKeyEntry(jobject /*KeyS /* Removes an entry from the keystore for the given alias */ -PALEXPORT bool AndroidCryptoNative_X509StoreDeleteEntry(jobject /*KeyStore*/ store, const char* hashString); +PALEXPORT int32_t AndroidCryptoNative_X509StoreDeleteEntry(jobject /*KeyStore*/ store, const char* hashString);