Compare commits

...

2 Commits

Author SHA1 Message Date
Matéo Duparc c0600c2624
libcryfs: Fix password length bug 2022-09-21 19:09:59 +02:00
Matéo Duparc 7bc65e9bde
libcryfs: Update Boost-for-Android 2022-09-20 16:15:20 +02:00
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ cryfs_init(JNIEnv *env, jstring jbaseDir, jstring jlocalStateDir, jbyteArray jpa
credentials.givenHash.size = env->GetArrayLength(jgivenHash);
} else {
jbyte* password = env->GetByteArrayElements(jpassword, NULL);
credentials.password = string(reinterpret_cast<const char*>(password));
credentials.password = string(reinterpret_cast<const char*>(password), env->GetArrayLength(jpassword));
env->ReleaseByteArrayElements(jpassword, password, 0);
if (jreturnedHash != NULL) {
credentials.returnedHash = &returnedHash;
@ -86,7 +86,7 @@ extern "C" jboolean cryfs_change_encryption_key(JNIEnv* env, jstring jbaseDir, j
} else {
jbyte* currentPassword = env->GetByteArrayElements(jcurrentPassword, NULL);
currentKeyProvider = std::make_unique<CryPresetPasswordBasedKeyProvider>(
reinterpret_cast<const char*>(currentPassword),
string(reinterpret_cast<const char*>(currentPassword), env->GetArrayLength(jcurrentPassword)),
cpputils::make_unique_ref<SCrypt>(SCrypt::DefaultSettings),
nullptr
);
@ -95,7 +95,7 @@ extern "C" jboolean cryfs_change_encryption_key(JNIEnv* env, jstring jbaseDir, j
struct SizedData returnedHash = {nullptr, 0};
jbyte* newPassword = env->GetByteArrayElements(jnewPassword, NULL);
cpputils::unique_ref<CryKeyProvider> newKeyProvider = cpputils::make_unique_ref<CryPresetPasswordBasedKeyProvider>(
reinterpret_cast<const char*>(newPassword),
string(reinterpret_cast<const char*>(newPassword), env->GetArrayLength(jnewPassword)),
cpputils::make_unique_ref<SCrypt>(SCrypt::DefaultSettings),
jreturnedHash == NULL ? nullptr : &returnedHash
);

@ -1 +1 @@
Subproject commit 0e12fbd30cb70b668a117c0913a303acfdaae04f
Subproject commit 4067aed71278e292d1b78d8a13431f01f80012f1