Don't break on setting default password
Bug: 22329642
Change-Id: I58dac4dba8e65c7015d50ca0c3575f77f550a215
diff --git a/cryptfs.c b/cryptfs.c
index a905ff6..1a63a5b 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -3237,7 +3237,9 @@
int cryptfs_changepw(int crypt_type, const char *newpw)
{
if (e4crypt_crypto_complete(DATA_MNT_POINT) == 0) {
- return e4crypt_change_password(DATA_MNT_POINT, crypt_type, newpw);
+ return e4crypt_change_password(DATA_MNT_POINT, crypt_type,
+ crypt_type == CRYPT_TYPE_DEFAULT ? DEFAULT_PASSWORD
+ : newpw);
}
struct crypt_mnt_ftr crypt_ftr;