Lines Matching refs:salt
133 unsigned char *key, unsigned char *salt) in put_crypt_ftr_and_key() argument
196 if (salt) { in put_crypt_ftr_and_key()
207 if ( (cnt = write(fd, salt, SALT_LEN)) != SALT_LEN) { in put_crypt_ftr_and_key()
232 unsigned char *key, unsigned char *salt) in get_crypt_ftr_and_key() argument
331 if ( (cnt = read(fd, salt, SALT_LEN)) != SALT_LEN) { in get_crypt_ftr_and_key()
551 static void pbkdf2(char *passwd, unsigned char *salt, unsigned char *ikey) in pbkdf2() argument
554 PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd), salt, SALT_LEN, in pbkdf2()
558 static int encrypt_master_key(char *passwd, unsigned char *salt, in encrypt_master_key() argument
567 pbkdf2(passwd, salt, ikey); in encrypt_master_key()
595 static int decrypt_master_key(char *passwd, unsigned char *salt, in decrypt_master_key() argument
604 pbkdf2(passwd, salt, ikey); in decrypt_master_key()
627 static int create_encrypted_random_key(char *passwd, unsigned char *master_key, unsigned char *salt) in create_encrypted_random_key() argument
637 read(fd, salt, SALT_LEN); in create_encrypted_random_key()
641 return encrypt_master_key(passwd, salt, key_buf, master_key); in create_encrypted_random_key()
795 unsigned char salt[SALT_LEN]; in do_crypto_complete() local
808 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) { in do_crypto_complete()
842 unsigned char salt[SALT_LEN]; in test_mount_encrypted_fs() local
858 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) { in test_mount_encrypted_fs()
867 decrypt_master_key(passwd, salt, encrypted_master_key, decrypted_master_key); in test_mount_encrypted_fs()
944 unsigned char key[32], salt[32]; in cryptfs_setup_volume() local
951 get_crypt_ftr_and_key(saved_data_blkdev, &sd_crypt_ftr, key, salt); in cryptfs_setup_volume()
995 unsigned char salt[SALT_LEN]; in cryptfs_verify_passwd() local
1018 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) { in cryptfs_verify_passwd()
1027 decrypt_master_key(passwd, salt, encrypted_master_key, decrypted_master_key); in cryptfs_verify_passwd()
1198 unsigned char salt[SALT_LEN]; in cryptfs_enable() local
1370 if (create_encrypted_random_key(passwd, master_key, salt)) { in cryptfs_enable()
1376 put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, master_key, salt); in cryptfs_enable()
1378 decrypt_master_key(passwd, salt, master_key, decrypted_master_key); in cryptfs_enable()
1513 unsigned char salt[SALT_LEN]; in cryptfs_changepw() local
1529 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) { in cryptfs_changepw()
1534 encrypt_master_key(newpw, salt, saved_master_key, encrypted_master_key); in cryptfs_changepw()
1537 put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt); in cryptfs_changepw()