Lines Matching refs:auth_tok

467 				  struct ecryptfs_auth_tok **auth_tok)  in ecryptfs_verify_auth_tok_from_key()  argument
471 (*auth_tok) = ecryptfs_get_key_payload_data(auth_tok_key); in ecryptfs_verify_auth_tok_from_key()
472 if (IS_ERR(*auth_tok)) { in ecryptfs_verify_auth_tok_from_key()
473 rc = PTR_ERR(*auth_tok); in ecryptfs_verify_auth_tok_from_key()
474 *auth_tok = NULL; in ecryptfs_verify_auth_tok_from_key()
478 if (ecryptfs_verify_version((*auth_tok)->version)) { in ecryptfs_verify_auth_tok_from_key()
486 if ((*auth_tok)->token_type != ECRYPTFS_PASSWORD in ecryptfs_verify_auth_tok_from_key()
487 && (*auth_tok)->token_type != ECRYPTFS_PRIVATE_KEY) { in ecryptfs_verify_auth_tok_from_key()
500 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_find_global_auth_tok_for_sig() argument
507 (*auth_tok) = NULL; in ecryptfs_find_global_auth_tok_for_sig()
529 walker->global_auth_tok_key, auth_tok); in ecryptfs_find_global_auth_tok_for_sig()
569 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_find_auth_tok_for_sig() argument
575 rc = ecryptfs_find_global_auth_tok_for_sig(auth_tok_key, auth_tok, in ecryptfs_find_auth_tok_for_sig()
587 rc = ecryptfs_keyring_auth_tok_for_sig(auth_tok_key, auth_tok, in ecryptfs_find_auth_tok_for_sig()
609 struct ecryptfs_auth_tok *auth_tok; member
648 &s->auth_tok, mount_crypt_stat, in ecryptfs_write_tag_70_packet()
749 if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { in ecryptfs_write_tag_70_packet()
775 (u8 *)s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
776 s->auth_tok->token.password.session_key_encryption_key_bytes, in ecryptfs_write_tag_70_packet()
830 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
838 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_write_tag_70_packet()
880 struct ecryptfs_auth_tok *auth_tok; member
976 &s->auth_tok, mount_crypt_stat, in ecryptfs_parse_tag_70_packet()
1038 if (s->auth_tok->token_type != ECRYPTFS_PASSWORD) { in ecryptfs_parse_tag_70_packet()
1046 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_parse_tag_70_packet()
1054 s->auth_tok->token.password.session_key_encryption_key, in ecryptfs_parse_tag_70_packet()
1111 ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok) in ecryptfs_get_auth_tok_sig() argument
1116 switch (auth_tok->token_type) { in ecryptfs_get_auth_tok_sig()
1118 (*sig) = auth_tok->token.password.signature; in ecryptfs_get_auth_tok_sig()
1121 (*sig) = auth_tok->token.private_key.signature; in ecryptfs_get_auth_tok_sig()
1125 auth_tok->token_type); in ecryptfs_get_auth_tok_sig()
1139 decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, in decrypt_pki_encrypted_session_key() argument
1150 rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok); in decrypt_pki_encrypted_session_key()
1153 auth_tok->token_type); in decrypt_pki_encrypted_session_key()
1156 rc = write_tag_64_packet(auth_tok_sig, &(auth_tok->session_key), in decrypt_pki_encrypted_session_key()
1175 rc = parse_tag_65_packet(&(auth_tok->session_key), in decrypt_pki_encrypted_session_key()
1182 auth_tok->session_key.flags |= ECRYPTFS_CONTAINS_DECRYPTED_KEY; in decrypt_pki_encrypted_session_key()
1183 memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, in decrypt_pki_encrypted_session_key()
1184 auth_tok->session_key.decrypted_key_size); in decrypt_pki_encrypted_session_key()
1185 crypt_stat->key_size = auth_tok->session_key.decrypted_key_size; in decrypt_pki_encrypted_session_key()
1283 (*new_auth_tok) = &auth_tok_list_item->auth_tok; in parse_tag_1_packet()
1417 (*new_auth_tok) = &auth_tok_list_item->auth_tok; in parse_tag_3_packet()
1623 struct ecryptfs_auth_tok **auth_tok, in ecryptfs_keyring_auth_tok_for_sig() argument
1640 rc = ecryptfs_verify_auth_tok_from_key(*auth_tok_key, auth_tok); in ecryptfs_keyring_auth_tok_for_sig()
1659 decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, in decrypt_passphrase_encrypted_session_key() argument
1672 auth_tok->token.password.session_key_encryption_key_bytes); in decrypt_passphrase_encrypted_session_key()
1674 auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key()
1675 auth_tok->token.password.session_key_encryption_key_bytes); in decrypt_passphrase_encrypted_session_key()
1685 rc = virt_to_scatterlist(auth_tok->session_key.encrypted_key, in decrypt_passphrase_encrypted_session_key()
1686 auth_tok->session_key.encrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1693 auth_tok->session_key.encrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1696 auth_tok->session_key.decrypted_key_size = in decrypt_passphrase_encrypted_session_key()
1697 auth_tok->session_key.encrypted_key_size; in decrypt_passphrase_encrypted_session_key()
1698 rc = virt_to_scatterlist(auth_tok->session_key.decrypted_key, in decrypt_passphrase_encrypted_session_key()
1699 auth_tok->session_key.decrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1721 tfm, auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key()
1730 auth_tok->session_key.encrypted_key_size, in decrypt_passphrase_encrypted_session_key()
1738 auth_tok->session_key.flags |= ECRYPTFS_CONTAINS_DECRYPTED_KEY; in decrypt_passphrase_encrypted_session_key()
1739 memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, in decrypt_passphrase_encrypted_session_key()
1740 auth_tok->session_key.decrypted_key_size); in decrypt_passphrase_encrypted_session_key()
1880 candidate_auth_tok = &auth_tok_list_item->auth_tok; in ecryptfs_parse_packet_set()
1945 == &auth_tok_list_item->auth_tok) { in ecryptfs_parse_packet_set()
1975 struct ecryptfs_auth_tok *auth_tok, in pki_encrypt_session_key() argument
1985 rc = write_tag_66_packet(auth_tok->token.private_key.signature, in pki_encrypt_session_key()
2033 struct key *auth_tok_key, struct ecryptfs_auth_tok *auth_tok, in write_tag_1_packet() argument
2044 ecryptfs_from_hex(key_rec->sig, auth_tok->token.private_key.signature, in write_tag_1_packet()
2049 auth_tok->session_key.encrypted_key[i]; in write_tag_1_packet()
2052 auth_tok->session_key.encrypted_key, in write_tag_1_packet()
2053 auth_tok->session_key.encrypted_key_size); in write_tag_1_packet()
2058 if (auth_tok->session_key.encrypted_key_size == 0) in write_tag_1_packet()
2059 auth_tok->session_key.encrypted_key_size = in write_tag_1_packet()
2060 auth_tok->token.private_key.key_size; in write_tag_1_packet()
2061 rc = pki_encrypt_session_key(auth_tok_key, auth_tok, crypt_stat, in write_tag_1_packet()
2188 struct ecryptfs_auth_tok *auth_tok, in write_tag_3_packet() argument
2208 ecryptfs_from_hex(key_rec->sig, auth_tok->token.password.signature, in write_tag_3_packet()
2228 if (auth_tok->session_key.encrypted_key_size == 0) in write_tag_3_packet()
2229 auth_tok->session_key.encrypted_key_size = in write_tag_3_packet()
2234 auth_tok->session_key.encrypted_key_size = 32; in write_tag_3_packet()
2236 auth_tok->session_key.encrypted_key_size = crypt_stat->key_size; in write_tag_3_packet()
2238 auth_tok->session_key.encrypted_key_size; in write_tag_3_packet()
2240 for (i = 0; i < auth_tok->session_key.encrypted_key_size; i++) in write_tag_3_packet()
2242 auth_tok->session_key.encrypted_key[i]; in write_tag_3_packet()
2249 auth_tok->session_key.encrypted_key, in write_tag_3_packet()
2253 if (auth_tok->token.password.flags & in write_tag_3_packet()
2257 auth_tok->token.password. in write_tag_3_packet()
2260 auth_tok->token.password.session_key_encryption_key, in write_tag_3_packet()
2379 memcpy(&dest[(*packet_size)], auth_tok->token.password.salt, in write_tag_3_packet()
2417 struct ecryptfs_auth_tok *auth_tok; in ecryptfs_generate_key_packet_set() local
2438 &auth_tok, in ecryptfs_generate_key_packet_set()
2447 if (auth_tok->token_type == ECRYPTFS_PASSWORD) { in ecryptfs_generate_key_packet_set()
2449 &max, auth_tok, in ecryptfs_generate_key_packet_set()
2470 } else if (auth_tok->token_type == ECRYPTFS_PRIVATE_KEY) { in ecryptfs_generate_key_packet_set()
2472 auth_tok_key, auth_tok, in ecryptfs_generate_key_packet_set()