Enable properties in ext4enc
Enables OwnerInfo and pattern suppression
Bug: 18151196
Change-Id: I46144e16cb00319deeb5492ab82c67f5dd43d6d3
diff --git a/cryptfs.c b/cryptfs.c
index 7398995..13ccd6c 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -3578,6 +3578,10 @@
/* Return the value of the specified field. */
int cryptfs_getfield(const char *fieldname, char *value, int len)
{
+ if (e4crypt_crypto_complete(DATA_MNT_POINT) == 0) {
+ return e4crypt_get_field(DATA_MNT_POINT, fieldname, value, len);
+ }
+
char temp_value[PROPERTY_VALUE_MAX];
/* CRYPTO_GETFIELD_OK is success,
* CRYPTO_GETFIELD_ERROR_NO_FIELD is value not set,
@@ -3639,6 +3643,10 @@
/* Set the value of the specified field. */
int cryptfs_setfield(const char *fieldname, const char *value)
{
+ if (e4crypt_crypto_complete(DATA_MNT_POINT) == 0) {
+ return e4crypt_set_field(DATA_MNT_POINT, fieldname, value);
+ }
+
char encrypted_state[PROPERTY_VALUE_MAX];
/* 0 is success, negative values are error */
int rc = CRYPTO_SETFIELD_ERROR_OTHER;