Lines Matching refs:auth_tok
465 struct ecryptfs_auth_tok **auth_tok) in ecryptfs_verify_auth_tok_from_key() argument
469 (*auth_tok) = ecryptfs_get_key_payload_data(auth_tok_key); in ecryptfs_verify_auth_tok_from_key()
470 if (ecryptfs_verify_version((*auth_tok)->version)) { in ecryptfs_verify_auth_tok_from_key()
478 if ((*auth_tok)->token_type != ECRYPTFS_PASSWORD in ecryptfs_verify_auth_tok_from_key()
479 && (*auth_tok)->token_type != ECRYPTFS_PRIVATE_KEY) { in ecryptfs_verify_auth_tok_from_key()
492 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_find_global_auth_tok_for_sig() argument
499 (*auth_tok) = NULL; in ecryptfs_find_global_auth_tok_for_sig()
521 walker->global_auth_tok_key, auth_tok); in ecryptfs_find_global_auth_tok_for_sig()
561 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_find_auth_tok_for_sig() argument
567 rc = ecryptfs_find_global_auth_tok_for_sig(auth_tok_key, auth_tok, in ecryptfs_find_auth_tok_for_sig()
579 rc = ecryptfs_keyring_auth_tok_for_sig(auth_tok_key, auth_tok, in ecryptfs_find_auth_tok_for_sig()
601 struct ecryptfs_auth_tok *auth_tok; member
643 &s->auth_tok, mount_crypt_stat, in ecryptfs_write_tag_70_packet()
735 if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { in ecryptfs_write_tag_70_packet()
743 (u8 *)s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
744 s->auth_tok->token.password.session_key_encryption_key_bytes); in ecryptfs_write_tag_70_packet()
764 s->auth_tok->token.password.session_key_encryption_key_bytes); in ecryptfs_write_tag_70_packet()
841 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
849 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
888 struct ecryptfs_auth_tok *auth_tok; member
987 &s->auth_tok, mount_crypt_stat, in ecryptfs_parse_tag_70_packet()
1041 if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { in ecryptfs_parse_tag_70_packet()
1049 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_parse_tag_70_packet()
1057 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_parse_tag_70_packet()
1116 ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok) in ecryptfs_get_auth_tok_sig() argument
1121 switch (auth_tok->token_type) { in ecryptfs_get_auth_tok_sig()
1123 (*sig) = auth_tok->token.password.signature; in ecryptfs_get_auth_tok_sig()
1126 (*sig) = auth_tok->token.private_key.signature; in ecryptfs_get_auth_tok_sig()
1130 auth_tok->token_type); in ecryptfs_get_auth_tok_sig()
1144 decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, in decrypt_pki_encrypted_session_key() argument
1155 rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); in decrypt_pki_encrypted_session_key()
1158 auth_tok->token_type); in decrypt_pki_encrypted_session_key()
1161 rc = write_tag_64_packet(auth_tok_sig, &(auth_tok->session_key), in decrypt_pki_encrypted_session_key()
1180 rc = parse_tag_65_packet(&(auth_tok->session_key), in decrypt_pki_encrypted_session_key()
1187 auth_tok->session_key.flags |= ECRYPTFS_CONTAINS_DECRYPTED_KEY; in decrypt_pki_encrypted_session_key()
1188 memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, in decrypt_pki_encrypted_session_key()
1189 auth_tok->session_key.decrypted_key_size); in decrypt_pki_encrypted_session_key()
1190 crypt_stat->key_size = auth_tok->session_key.decrypted_key_size; in decrypt_pki_encrypted_session_key()
1288 (*new_auth_tok) = &auth_tok_list_item->auth_tok; in parse_tag_1_packet()
1422 (*new_auth_tok) = &auth_tok_list_item->auth_tok; in parse_tag_3_packet()
1628 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_keyring_auth_tok_for_sig() argument
1645 rc = ecryptfs_verify_auth_tok_from_key(*auth_tok_key, auth_tok); in ecryptfs_keyring_auth_tok_for_sig()
1664 decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, in decrypt_passphrase_encrypted_session_key() argument
1678 auth_tok->token.password.session_key_encryption_key_bytes); in decrypt_passphrase_encrypted_session_key()
1680 auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key()
1681 auth_tok->token.password.session_key_encryption_key_bytes); in decrypt_passphrase_encrypted_session_key()
1691 rc = virt_to_scatterlist(auth_tok->session_key.encrypted_key, in decrypt_passphrase_encrypted_session_key()
1692 auth_tok->session_key.encrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1699 auth_tok->session_key.encrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1702 auth_tok->session_key.decrypted_key_size = in decrypt_passphrase_encrypted_session_key()
1703 auth_tok->session_key.encrypted_key_size; in decrypt_passphrase_encrypted_session_key()
1704 rc = virt_to_scatterlist(auth_tok->session_key.decrypted_key, in decrypt_passphrase_encrypted_session_key()
1705 auth_tok->session_key.decrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1715 desc.tfm, auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key()
1724 auth_tok->session_key.encrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1730 auth_tok->session_key.flags |= ECRYPTFS_CONTAINS_DECRYPTED_KEY; in decrypt_passphrase_encrypted_session_key()
1731 memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, in decrypt_passphrase_encrypted_session_key()
1732 auth_tok->session_key.decrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1871 candidate_auth_tok = &auth_tok_list_item->auth_tok; in ecryptfs_parse_packet_set()
1936 == &auth_tok_list_item->auth_tok) { in ecryptfs_parse_packet_set()
1966 struct ecryptfs_auth_tok *auth_tok, in pki_encrypt_session_key() argument
1976 rc = write_tag_66_packet(auth_tok->token.private_key.signature, in pki_encrypt_session_key()
2024 struct key *auth_tok_key, struct ecryptfs_auth_tok *auth_tok, in write_tag_1_packet() argument
2035 ecryptfs_from_hex(key_rec->sig, auth_tok->token.private_key.signature, in write_tag_1_packet()
2040 auth_tok->session_key.encrypted_key[i]; in write_tag_1_packet()
2043 auth_tok->session_key.encrypted_key, in write_tag_1_packet()
2044 auth_tok->session_key.encrypted_key_size); in write_tag_1_packet()
2049 if (auth_tok->session_key.encrypted_key_size == 0) in write_tag_1_packet()
2050 auth_tok->session_key.encrypted_key_size = in write_tag_1_packet()
2051 auth_tok->token.private_key.key_size; in write_tag_1_packet()
2052 rc = pki_encrypt_session_key(auth_tok_key, auth_tok, crypt_stat, in write_tag_1_packet()
2179 struct ecryptfs_auth_tok *auth_tok, in write_tag_3_packet() argument
2201 ecryptfs_from_hex(key_rec->sig, auth_tok->token.password.signature, in write_tag_3_packet()
2222 if (auth_tok->session_key.encrypted_key_size == 0) in write_tag_3_packet()
2223 auth_tok->session_key.encrypted_key_size = in write_tag_3_packet()
2228 auth_tok->session_key.encrypted_key_size = 32; in write_tag_3_packet()
2230 auth_tok->session_key.encrypted_key_size = crypt_stat->key_size; in write_tag_3_packet()
2232 auth_tok->session_key.encrypted_key_size; in write_tag_3_packet()
2234 for (i = 0; i < auth_tok->session_key.encrypted_key_size; i++) in write_tag_3_packet()
2236 auth_tok->session_key.encrypted_key[i]; in write_tag_3_packet()
2243 auth_tok->session_key.encrypted_key, in write_tag_3_packet()
2247 if (auth_tok->token.password.flags & in write_tag_3_packet()
2251 auth_tok->token.password. in write_tag_3_packet()
2254 auth_tok->token.password.session_key_encryption_key, in write_tag_3_packet()
2357 memcpy(&dest[(*packet_size)], auth_tok->token.password.salt, in write_tag_3_packet()
2395 struct ecryptfs_auth_tok *auth_tok; in ecryptfs_generate_key_packet_set() local
2416 &auth_tok, in ecryptfs_generate_key_packet_set()
2425 if (auth_tok->token_type == ECRYPTFS_PASSWORD) { in ecryptfs_generate_key_packet_set()
2427 &max, auth_tok, in ecryptfs_generate_key_packet_set()
2448 } else if (auth_tok->token_type == ECRYPTFS_PRIVATE_KEY) { in ecryptfs_generate_key_packet_set()
2450 auth_tok_key, auth_tok, in ecryptfs_generate_key_packet_set()