summaryrefslogtreecommitdiffstats
path: root/crypto/jb
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/jb')
-rw-r--r--crypto/jb/cryptfs.c23
-rw-r--r--crypto/jb/cryptfs.h1
2 files changed, 22 insertions, 2 deletions
diff --git a/crypto/jb/cryptfs.c b/crypto/jb/cryptfs.c
index 4e5706b64..f9c0d7489 100644
--- a/crypto/jb/cryptfs.c
+++ b/crypto/jb/cryptfs.c
@@ -1354,13 +1354,32 @@ int cryptfs_crypto_complete(void)
#define FSTAB_PREFIX "/fstab."
+int cryptfs_check_footer(void)
+{
+ int rc = -1;
+ char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)];
+ char propbuf[PROPERTY_VALUE_MAX];
+ struct crypt_mnt_ftr crypt_ftr;
+
+ property_get("ro.hardware", propbuf, "");
+ snprintf(fstab_filename, sizeof(fstab_filename), FSTAB_PREFIX"%s", propbuf);
+
+ fstab = fs_mgr_read_fstab(fstab_filename);
+ if (!fstab) {
+ printf("failed to open %s\n", fstab_filename);
+ return -1;
+ }
+
+ rc = get_crypt_ftr_and_key(&crypt_ftr);
+
+ return rc;
+}
+
int cryptfs_check_passwd(char *passwd)
{
int rc = -1;
char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)];
char propbuf[PROPERTY_VALUE_MAX];
- int i;
- int flags;
property_get("ro.hardware", propbuf, "");
snprintf(fstab_filename, sizeof(fstab_filename), FSTAB_PREFIX"%s", propbuf);
diff --git a/crypto/jb/cryptfs.h b/crypto/jb/cryptfs.h
index 162159eb0..d815814d3 100644
--- a/crypto/jb/cryptfs.h
+++ b/crypto/jb/cryptfs.h
@@ -139,6 +139,7 @@ extern "C" {
typedef void (*kdf_func)(char *passwd, unsigned char *salt, unsigned char *ikey, void *params);
int cryptfs_crypto_complete(void);
+ int cryptfs_check_footer(void);
int cryptfs_check_passwd(char *pw);
int cryptfs_verify_passwd(char *newpw);
int cryptfs_restart(void);