Lines Matching full:salt
129 /* key or salt can be NULL, in which case just skip writing that value. Useful to
133 unsigned char *key, unsigned char *salt)
196 if (salt) {
197 /* Compute the offset from the last write to the salt */
203 SLOGE("Cannot seek to real block device salt \n");
207 if ( (cnt = write(fd, salt, SALT_LEN)) != SALT_LEN) {
208 SLOGE("Cannot write salt for real block device %s\n", fname);
232 unsigned char *key, unsigned char *salt)
327 SLOGE("Cannot seek to real block device salt\n");
331 if ( (cnt = read(fd, salt, SALT_LEN)) != SALT_LEN) {
332 SLOGE("Cannot read salt for real block device %s\n", fname);
551 static void pbkdf2(char *passwd, unsigned char *salt, unsigned char *ikey)
554 PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd), salt, SALT_LEN,
558 static int encrypt_master_key(char *passwd, unsigned char *salt,
567 pbkdf2(passwd, salt, ikey);
595 static int decrypt_master_key(char *passwd, unsigned char *salt,
604 pbkdf2(passwd, salt, ikey);
627 static int create_encrypted_random_key(char *passwd, unsigned char *master_key, unsigned char *salt)
637 read(fd, salt, SALT_LEN);
641 return encrypt_master_key(passwd, salt, key_buf, master_key);
795 unsigned char salt[SALT_LEN];
808 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
842 unsigned char salt[SALT_LEN];
858 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
867 decrypt_master_key(passwd, salt, encrypted_master_key, decrypted_master_key);
944 unsigned char key[32], salt[32];
951 get_crypt_ftr_and_key(saved_data_blkdev, &sd_crypt_ftr, key, salt);
995 unsigned char salt[SALT_LEN];
1018 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
1027 decrypt_master_key(passwd, salt, encrypted_master_key, decrypted_master_key);
1198 unsigned char salt[SALT_LEN];
1370 if (create_encrypted_random_key(passwd, master_key, salt)) {
1376 put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, master_key, salt);
1378 decrypt_master_key(passwd, salt, master_key, decrypted_master_key);
1513 unsigned char salt[SALT_LEN];
1529 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
1534 encrypt_master_key(newpw, salt, saved_master_key, encrypted_master_key);
1537 put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt);