cryptfs: Don't use bare integers for key size

Rather than use an integer and have a comment, we use a named
constant for sizing these master key buffers.  This will help
avoid confusion when we switch to allowing different sized
master keys.

Bug: 73079191
Test: Build
Change-Id: Ifaffdd94d337bb2d5a178f818dfe00f9386ae03b
gugelfrei
Greg Kaiser 6 years ago
parent c0de9c7dba
commit 00eda38635

@ -1604,8 +1604,7 @@ static int do_crypto_complete(const char *mount_point)
static int test_mount_encrypted_fs(struct crypt_mnt_ftr* crypt_ftr, static int test_mount_encrypted_fs(struct crypt_mnt_ftr* crypt_ftr,
const char *passwd, const char *mount_point, const char *label) const char *passwd, const char *mount_point, const char *label)
{ {
/* Allocate enough space for a 256 bit key, but we may use less */ unsigned char decrypted_master_key[KEY_LEN_BYTES];
unsigned char decrypted_master_key[32];
char crypto_blkdev[MAXPATHLEN]; char crypto_blkdev[MAXPATHLEN];
char real_blkdev[MAXPATHLEN]; char real_blkdev[MAXPATHLEN];
char tmp_mount_point[64]; char tmp_mount_point[64];
@ -1862,8 +1861,7 @@ int cryptfs_check_passwd(const char *passwd)
int cryptfs_verify_passwd(const char *passwd) int cryptfs_verify_passwd(const char *passwd)
{ {
struct crypt_mnt_ftr crypt_ftr; struct crypt_mnt_ftr crypt_ftr;
/* Allocate enough space for a 256 bit key, but we may use less */ unsigned char decrypted_master_key[KEY_LEN_BYTES];
unsigned char decrypted_master_key[32];
char encrypted_state[PROPERTY_VALUE_MAX]; char encrypted_state[PROPERTY_VALUE_MAX];
int rc; int rc;

Loading…
Cancel
Save