Lines Matching full:salt
142 /* key or salt can be NULL, in which case just skip writing that value. Useful to
146 unsigned char *key, unsigned char *salt)
209 if (salt) {
210 /* Compute the offset from the last write to the salt */
216 SLOGE("Cannot seek to real block device salt \n");
220 if ( (cnt = write(fd, salt, SALT_LEN)) != SALT_LEN) {
221 SLOGE("Cannot write salt for real block device %s\n", fname);
245 unsigned char *key, unsigned char *salt)
340 SLOGE("Cannot seek to real block device salt\n");
344 if ( (cnt = read(fd, salt, SALT_LEN)) != SALT_LEN) {
345 SLOGE("Cannot read salt for real block device %s\n", fname);
494 static void pbkdf2(char *passwd, unsigned char *salt, unsigned char *ikey)
497 PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd), salt, SALT_LEN,
501 static int encrypt_master_key(char *passwd, unsigned char *salt,
510 pbkdf2(passwd, salt, ikey);
538 static int decrypt_master_key(char *passwd, unsigned char *salt,
547 pbkdf2(passwd, salt, ikey);
570 static int create_encrypted_random_key(char *passwd, unsigned char *master_key, unsigned char *salt)
580 read(fd, salt, SALT_LEN);
584 return encrypt_master_key(passwd, salt, key_buf, master_key);
737 unsigned char salt[SALT_LEN];
750 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
784 unsigned char salt[SALT_LEN];
800 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
809 decrypt_master_key(passwd, salt, encrypted_master_key, decrypted_master_key);
886 unsigned char key[32], salt[32];
893 get_crypt_ftr_and_key(saved_data_blkdev, &sd_crypt_ftr, key, salt);
937 unsigned char salt[SALT_LEN];
960 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
969 decrypt_master_key(passwd, salt, encrypted_master_key, decrypted_master_key);
1140 unsigned char salt[SALT_LEN];
1312 if (create_encrypted_random_key(passwd, master_key, salt)) {
1318 put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, master_key, salt);
1320 decrypt_master_key(passwd, salt, master_key, decrypted_master_key);
1455 unsigned char salt[SALT_LEN];
1471 if (get_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt)) {
1476 encrypt_master_key(newpw, salt, saved_master_key, encrypted_master_key);
1479 put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, encrypted_master_key, salt);