Lines Matching refs:auth_tok

453 				  struct ecryptfs_auth_tok **auth_tok)  in ecryptfs_verify_auth_tok_from_key()  argument
457 (*auth_tok) = ecryptfs_get_key_payload_data(auth_tok_key); in ecryptfs_verify_auth_tok_from_key()
458 if (IS_ERR(*auth_tok)) { in ecryptfs_verify_auth_tok_from_key()
459 rc = PTR_ERR(*auth_tok); in ecryptfs_verify_auth_tok_from_key()
460 *auth_tok = NULL; in ecryptfs_verify_auth_tok_from_key()
464 if (ecryptfs_verify_version((*auth_tok)->version)) { in ecryptfs_verify_auth_tok_from_key()
472 if ((*auth_tok)->token_type != ECRYPTFS_PASSWORD in ecryptfs_verify_auth_tok_from_key()
473 && (*auth_tok)->token_type != ECRYPTFS_PRIVATE_KEY) { in ecryptfs_verify_auth_tok_from_key()
486 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_find_global_auth_tok_for_sig() argument
493 (*auth_tok) = NULL; in ecryptfs_find_global_auth_tok_for_sig()
515 walker->global_auth_tok_key, auth_tok); in ecryptfs_find_global_auth_tok_for_sig()
555 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_find_auth_tok_for_sig() argument
561 rc = ecryptfs_find_global_auth_tok_for_sig(auth_tok_key, auth_tok, in ecryptfs_find_auth_tok_for_sig()
573 rc = ecryptfs_keyring_auth_tok_for_sig(auth_tok_key, auth_tok, in ecryptfs_find_auth_tok_for_sig()
595 struct ecryptfs_auth_tok *auth_tok; member
634 &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()
760 (u8 *)s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
761 s->auth_tok->token.password.session_key_encryption_key_bytes, in ecryptfs_write_tag_70_packet()
815 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
823 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
865 struct ecryptfs_auth_tok *auth_tok; member
961 &s->auth_tok, mount_crypt_stat, in ecryptfs_parse_tag_70_packet()
1023 if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { in ecryptfs_parse_tag_70_packet()
1031 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_parse_tag_70_packet()
1039 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_parse_tag_70_packet()
1097 ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok) in ecryptfs_get_auth_tok_sig() argument
1102 switch (auth_tok->token_type) { in ecryptfs_get_auth_tok_sig()
1104 (*sig) = auth_tok->token.password.signature; in ecryptfs_get_auth_tok_sig()
1107 (*sig) = auth_tok->token.private_key.signature; in ecryptfs_get_auth_tok_sig()
1111 auth_tok->token_type); in ecryptfs_get_auth_tok_sig()
1125 decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, in decrypt_pki_encrypted_session_key() argument
1136 rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); in decrypt_pki_encrypted_session_key()
1139 auth_tok->token_type); in decrypt_pki_encrypted_session_key()
1142 rc = write_tag_64_packet(auth_tok_sig, &(auth_tok->session_key), in decrypt_pki_encrypted_session_key()
1161 rc = parse_tag_65_packet(&(auth_tok->session_key), in decrypt_pki_encrypted_session_key()
1168 auth_tok->session_key.flags |= ECRYPTFS_CONTAINS_DECRYPTED_KEY; in decrypt_pki_encrypted_session_key()
1169 memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, in decrypt_pki_encrypted_session_key()
1170 auth_tok->session_key.decrypted_key_size); in decrypt_pki_encrypted_session_key()
1171 crypt_stat->key_size = auth_tok->session_key.decrypted_key_size; in decrypt_pki_encrypted_session_key()
1269 (*new_auth_tok) = &auth_tok_list_item->auth_tok; in parse_tag_1_packet()
1403 (*new_auth_tok) = &auth_tok_list_item->auth_tok; in parse_tag_3_packet()
1609 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_keyring_auth_tok_for_sig() argument
1626 rc = ecryptfs_verify_auth_tok_from_key(*auth_tok_key, auth_tok); in ecryptfs_keyring_auth_tok_for_sig()
1645 decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, in decrypt_passphrase_encrypted_session_key() argument
1658 auth_tok->token.password.session_key_encryption_key_bytes); in decrypt_passphrase_encrypted_session_key()
1660 auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key()
1661 auth_tok->token.password.session_key_encryption_key_bytes); in decrypt_passphrase_encrypted_session_key()
1671 rc = virt_to_scatterlist(auth_tok->session_key.encrypted_key, in decrypt_passphrase_encrypted_session_key()
1672 auth_tok->session_key.encrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1679 auth_tok->session_key.encrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1682 auth_tok->session_key.decrypted_key_size = in decrypt_passphrase_encrypted_session_key()
1683 auth_tok->session_key.encrypted_key_size; in decrypt_passphrase_encrypted_session_key()
1684 rc = virt_to_scatterlist(auth_tok->session_key.decrypted_key, in decrypt_passphrase_encrypted_session_key()
1685 auth_tok->session_key.decrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1707 tfm, auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key()
1716 auth_tok->session_key.encrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1724 auth_tok->session_key.flags |= ECRYPTFS_CONTAINS_DECRYPTED_KEY; in decrypt_passphrase_encrypted_session_key()
1725 memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, in decrypt_passphrase_encrypted_session_key()
1726 auth_tok->session_key.decrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1866 candidate_auth_tok = &auth_tok_list_item->auth_tok; in ecryptfs_parse_packet_set()
1931 == &auth_tok_list_item->auth_tok) { in ecryptfs_parse_packet_set()
1961 struct ecryptfs_auth_tok *auth_tok, in pki_encrypt_session_key() argument
1971 rc = write_tag_66_packet(auth_tok->token.private_key.signature, in pki_encrypt_session_key()
2019 struct key *auth_tok_key, struct ecryptfs_auth_tok *auth_tok, in write_tag_1_packet() argument
2030 ecryptfs_from_hex(key_rec->sig, auth_tok->token.private_key.signature, in write_tag_1_packet()
2035 auth_tok->session_key.encrypted_key[i]; in write_tag_1_packet()
2038 auth_tok->session_key.encrypted_key, in write_tag_1_packet()
2039 auth_tok->session_key.encrypted_key_size); in write_tag_1_packet()
2044 if (auth_tok->session_key.encrypted_key_size == 0) in write_tag_1_packet()
2045 auth_tok->session_key.encrypted_key_size = in write_tag_1_packet()
2046 auth_tok->token.private_key.key_size; in write_tag_1_packet()
2047 rc = pki_encrypt_session_key(auth_tok_key, auth_tok, crypt_stat, in write_tag_1_packet()
2174 struct ecryptfs_auth_tok *auth_tok, in write_tag_3_packet() argument
2194 ecryptfs_from_hex(key_rec->sig, auth_tok->token.password.signature, in write_tag_3_packet()
2214 if (auth_tok->session_key.encrypted_key_size == 0) in write_tag_3_packet()
2215 auth_tok->session_key.encrypted_key_size = in write_tag_3_packet()
2220 auth_tok->session_key.encrypted_key_size = 32; in write_tag_3_packet()
2222 auth_tok->session_key.encrypted_key_size = crypt_stat->key_size; in write_tag_3_packet()
2224 auth_tok->session_key.encrypted_key_size; in write_tag_3_packet()
2226 for (i = 0; i < auth_tok->session_key.encrypted_key_size; i++) in write_tag_3_packet()
2228 auth_tok->session_key.encrypted_key[i]; in write_tag_3_packet()
2235 auth_tok->session_key.encrypted_key, in write_tag_3_packet()
2239 if (auth_tok->token.password.flags & in write_tag_3_packet()
2243 auth_tok->token.password. in write_tag_3_packet()
2246 auth_tok->token.password.session_key_encryption_key, in write_tag_3_packet()
2365 memcpy(&dest[(*packet_size)], auth_tok->token.password.salt, in write_tag_3_packet()
2403 struct ecryptfs_auth_tok *auth_tok; in ecryptfs_generate_key_packet_set() local
2424 &auth_tok, in ecryptfs_generate_key_packet_set()
2433 if (auth_tok->token_type == ECRYPTFS_PASSWORD) { in ecryptfs_generate_key_packet_set()
2435 &max, auth_tok, in ecryptfs_generate_key_packet_set()
2456 } else if (auth_tok->token_type == ECRYPTFS_PRIVATE_KEY) { in ecryptfs_generate_key_packet_set()
2458 auth_tok_key, auth_tok, in ecryptfs_generate_key_packet_set()