epayload 29 drivers/nvdimm/security.c struct encrypted_key_payload *epayload = dereference_key_locked(key); epayload 33 drivers/nvdimm/security.c return epayload->decrypted_data; epayload 66 drivers/nvdimm/security.c struct encrypted_key_payload *epayload; epayload 69 drivers/nvdimm/security.c epayload = dereference_key_locked(key); epayload 70 drivers/nvdimm/security.c if (epayload->decrypted_datalen != NVDIMM_PASSPHRASE_LEN) { epayload 95 drivers/nvdimm/security.c struct encrypted_key_payload *epayload; epayload 111 drivers/nvdimm/security.c epayload = dereference_key_locked(key); epayload 112 drivers/nvdimm/security.c if (epayload->decrypted_datalen != NVDIMM_PASSPHRASE_LEN) { epayload 270 security/keys/encrypted-keys/encrypted.c static char *datablob_format(struct encrypted_key_payload *epayload, epayload 274 security/keys/encrypted-keys/encrypted.c u8 *iv = epayload->iv; epayload 285 security/keys/encrypted-keys/encrypted.c len = sprintf(ascii_buf, "%s %s %s ", epayload->format, epayload 286 security/keys/encrypted-keys/encrypted.c epayload->master_desc, epayload->datalen); epayload 422 security/keys/encrypted-keys/encrypted.c static struct key *request_master_key(struct encrypted_key_payload *epayload, epayload 427 security/keys/encrypted-keys/encrypted.c if (!strncmp(epayload->master_desc, KEY_TRUSTED_PREFIX, epayload 429 security/keys/encrypted-keys/encrypted.c mkey = request_trusted_key(epayload->master_desc + epayload 432 security/keys/encrypted-keys/encrypted.c } else if (!strncmp(epayload->master_desc, KEY_USER_PREFIX, epayload 434 security/keys/encrypted-keys/encrypted.c mkey = request_user_key(epayload->master_desc + epayload 445 security/keys/encrypted-keys/encrypted.c epayload->master_desc); epayload 448 security/keys/encrypted-keys/encrypted.c epayload->master_desc); epayload 458 security/keys/encrypted-keys/encrypted.c static int derived_key_encrypt(struct encrypted_key_payload *epayload, epayload 470 security/keys/encrypted-keys/encrypted.c encrypted_datalen = roundup(epayload->decrypted_datalen, blksize); epayload 476 security/keys/encrypted-keys/encrypted.c dump_decrypted_data(epayload); epayload 479 security/keys/encrypted-keys/encrypted.c sg_set_buf(&sg_in[0], epayload->decrypted_data, epayload 480 security/keys/encrypted-keys/encrypted.c epayload->decrypted_datalen); epayload 484 security/keys/encrypted-keys/encrypted.c sg_set_buf(sg_out, epayload->encrypted_data, encrypted_datalen); epayload 486 security/keys/encrypted-keys/encrypted.c memcpy(iv, epayload->iv, sizeof(iv)); epayload 495 security/keys/encrypted-keys/encrypted.c dump_encrypted_data(epayload, encrypted_datalen); epayload 500 security/keys/encrypted-keys/encrypted.c static int datablob_hmac_append(struct encrypted_key_payload *epayload, epayload 511 security/keys/encrypted-keys/encrypted.c digest = epayload->format + epayload->datablob_len; epayload 513 security/keys/encrypted-keys/encrypted.c epayload->format, epayload->datablob_len); epayload 522 security/keys/encrypted-keys/encrypted.c static int datablob_hmac_verify(struct encrypted_key_payload *epayload, epayload 536 security/keys/encrypted-keys/encrypted.c len = epayload->datablob_len; epayload 538 security/keys/encrypted-keys/encrypted.c p = epayload->master_desc; epayload 539 security/keys/encrypted-keys/encrypted.c len -= strlen(epayload->format) + 1; epayload 541 security/keys/encrypted-keys/encrypted.c p = epayload->format; epayload 546 security/keys/encrypted-keys/encrypted.c ret = crypto_memneq(digest, epayload->format + epayload->datablob_len, epayload 551 security/keys/encrypted-keys/encrypted.c epayload->format + epayload->datablob_len, epayload 560 security/keys/encrypted-keys/encrypted.c static int derived_key_decrypt(struct encrypted_key_payload *epayload, epayload 578 security/keys/encrypted-keys/encrypted.c encrypted_datalen = roundup(epayload->decrypted_datalen, blksize); epayload 583 security/keys/encrypted-keys/encrypted.c dump_encrypted_data(epayload, encrypted_datalen); epayload 587 security/keys/encrypted-keys/encrypted.c sg_set_buf(sg_in, epayload->encrypted_data, encrypted_datalen); epayload 588 security/keys/encrypted-keys/encrypted.c sg_set_buf(&sg_out[0], epayload->decrypted_data, epayload 589 security/keys/encrypted-keys/encrypted.c epayload->decrypted_datalen); epayload 592 security/keys/encrypted-keys/encrypted.c memcpy(iv, epayload->iv, sizeof(iv)); epayload 600 security/keys/encrypted-keys/encrypted.c dump_decrypted_data(epayload); epayload 612 security/keys/encrypted-keys/encrypted.c struct encrypted_key_payload *epayload = NULL; epayload 656 security/keys/encrypted-keys/encrypted.c epayload = kzalloc(sizeof(*epayload) + payload_datalen + epayload 658 security/keys/encrypted-keys/encrypted.c if (!epayload) epayload 661 security/keys/encrypted-keys/encrypted.c epayload->payload_datalen = payload_datalen; epayload 662 security/keys/encrypted-keys/encrypted.c epayload->decrypted_datalen = decrypted_datalen; epayload 663 security/keys/encrypted-keys/encrypted.c epayload->datablob_len = datablob_len; epayload 664 security/keys/encrypted-keys/encrypted.c return epayload; epayload 667 security/keys/encrypted-keys/encrypted.c static int encrypted_key_decrypt(struct encrypted_key_payload *epayload, epayload 680 security/keys/encrypted-keys/encrypted.c encrypted_datalen = roundup(epayload->decrypted_datalen, blksize); epayload 686 security/keys/encrypted-keys/encrypted.c ret = hex2bin(epayload->iv, hex_encoded_iv, ivsize); epayload 689 security/keys/encrypted-keys/encrypted.c ret = hex2bin(epayload->encrypted_data, hex_encoded_data, epayload 694 security/keys/encrypted-keys/encrypted.c hmac = epayload->format + epayload->datablob_len; epayload 700 security/keys/encrypted-keys/encrypted.c mkey = request_master_key(epayload, &master_key, &master_keylen); epayload 704 security/keys/encrypted-keys/encrypted.c ret = datablob_hmac_verify(epayload, format, master_key, master_keylen); epayload 714 security/keys/encrypted-keys/encrypted.c ret = derived_key_decrypt(epayload, derived_key, sizeof derived_key); epayload 724 security/keys/encrypted-keys/encrypted.c static void __ekey_init(struct encrypted_key_payload *epayload, epayload 731 security/keys/encrypted-keys/encrypted.c epayload->format = epayload->payload_data + epayload->payload_datalen; epayload 732 security/keys/encrypted-keys/encrypted.c epayload->master_desc = epayload->format + format_len + 1; epayload 733 security/keys/encrypted-keys/encrypted.c epayload->datalen = epayload->master_desc + strlen(master_desc) + 1; epayload 734 security/keys/encrypted-keys/encrypted.c epayload->iv = epayload->datalen + strlen(datalen) + 1; epayload 735 security/keys/encrypted-keys/encrypted.c epayload->encrypted_data = epayload->iv + ivsize + 1; epayload 736 security/keys/encrypted-keys/encrypted.c epayload->decrypted_data = epayload->payload_data; epayload 739 security/keys/encrypted-keys/encrypted.c memcpy(epayload->format, key_format_default, format_len); epayload 742 security/keys/encrypted-keys/encrypted.c epayload->decrypted_data = epayload 743 security/keys/encrypted-keys/encrypted.c ecryptfs_get_auth_tok_key((struct ecryptfs_auth_tok *)epayload->payload_data); epayload 745 security/keys/encrypted-keys/encrypted.c memcpy(epayload->format, format, format_len); epayload 748 security/keys/encrypted-keys/encrypted.c memcpy(epayload->master_desc, master_desc, strlen(master_desc)); epayload 749 security/keys/encrypted-keys/encrypted.c memcpy(epayload->datalen, datalen, strlen(datalen)); epayload 758 security/keys/encrypted-keys/encrypted.c static int encrypted_init(struct encrypted_key_payload *epayload, epayload 770 security/keys/encrypted-keys/encrypted.c ecryptfs_fill_auth_tok((struct ecryptfs_auth_tok *)epayload->payload_data, epayload 774 security/keys/encrypted-keys/encrypted.c __ekey_init(epayload, format, master_desc, datalen); epayload 776 security/keys/encrypted-keys/encrypted.c get_random_bytes(epayload->iv, ivsize); epayload 778 security/keys/encrypted-keys/encrypted.c get_random_bytes(epayload->decrypted_data, epayload 779 security/keys/encrypted-keys/encrypted.c epayload->decrypted_datalen); epayload 781 security/keys/encrypted-keys/encrypted.c ret = encrypted_key_decrypt(epayload, format, hex_encoded_iv); epayload 796 security/keys/encrypted-keys/encrypted.c struct encrypted_key_payload *epayload = NULL; epayload 818 security/keys/encrypted-keys/encrypted.c epayload = encrypted_key_alloc(key, format, master_desc, epayload 820 security/keys/encrypted-keys/encrypted.c if (IS_ERR(epayload)) { epayload 821 security/keys/encrypted-keys/encrypted.c ret = PTR_ERR(epayload); epayload 824 security/keys/encrypted-keys/encrypted.c ret = encrypted_init(epayload, key->description, format, master_desc, epayload 827 security/keys/encrypted-keys/encrypted.c kzfree(epayload); epayload 831 security/keys/encrypted-keys/encrypted.c rcu_assign_keypointer(key, epayload); epayload 839 security/keys/encrypted-keys/encrypted.c struct encrypted_key_payload *epayload; epayload 841 security/keys/encrypted-keys/encrypted.c epayload = container_of(rcu, struct encrypted_key_payload, rcu); epayload 842 security/keys/encrypted-keys/encrypted.c kzfree(epayload); epayload 856 security/keys/encrypted-keys/encrypted.c struct encrypted_key_payload *epayload = key->payload.data[0]; epayload 879 security/keys/encrypted-keys/encrypted.c ret = valid_master_desc(new_master_desc, epayload->master_desc); epayload 883 security/keys/encrypted-keys/encrypted.c new_epayload = encrypted_key_alloc(key, epayload->format, epayload 884 security/keys/encrypted-keys/encrypted.c new_master_desc, epayload->datalen); epayload 890 security/keys/encrypted-keys/encrypted.c __ekey_init(new_epayload, epayload->format, new_master_desc, epayload 891 security/keys/encrypted-keys/encrypted.c epayload->datalen); epayload 893 security/keys/encrypted-keys/encrypted.c memcpy(new_epayload->iv, epayload->iv, ivsize); epayload 894 security/keys/encrypted-keys/encrypted.c memcpy(new_epayload->payload_data, epayload->payload_data, epayload 895 security/keys/encrypted-keys/encrypted.c epayload->payload_datalen); epayload 898 security/keys/encrypted-keys/encrypted.c call_rcu(&epayload->rcu, encrypted_rcu_free); epayload 915 security/keys/encrypted-keys/encrypted.c struct encrypted_key_payload *epayload; epayload 924 security/keys/encrypted-keys/encrypted.c epayload = dereference_key_locked(key); epayload 927 security/keys/encrypted-keys/encrypted.c asciiblob_len = epayload->datablob_len + ivsize + 1 epayload 928 security/keys/encrypted-keys/encrypted.c + roundup(epayload->decrypted_datalen, blksize) epayload 934 security/keys/encrypted-keys/encrypted.c mkey = request_master_key(epayload, &master_key, &master_keylen); epayload 942 security/keys/encrypted-keys/encrypted.c ret = derived_key_encrypt(epayload, derived_key, sizeof derived_key); epayload 946 security/keys/encrypted-keys/encrypted.c ret = datablob_hmac_append(epayload, master_key, master_keylen); epayload 950 security/keys/encrypted-keys/encrypted.c ascii_buf = datablob_format(epayload, asciiblob_len); epayload 26 security/keys/encrypted-keys/encrypted.h static inline void dump_decrypted_data(struct encrypted_key_payload *epayload) epayload 29 security/keys/encrypted-keys/encrypted.h epayload->decrypted_data, epayload 30 security/keys/encrypted-keys/encrypted.h epayload->decrypted_datalen, 0); epayload 33 security/keys/encrypted-keys/encrypted.h static inline void dump_encrypted_data(struct encrypted_key_payload *epayload, epayload 37 security/keys/encrypted-keys/encrypted.h epayload->encrypted_data, encrypted_datalen, 0); epayload 53 security/keys/encrypted-keys/encrypted.h static inline void dump_decrypted_data(struct encrypted_key_payload *epayload) epayload 57 security/keys/encrypted-keys/encrypted.h static inline void dump_encrypted_data(struct encrypted_key_payload *epayload,