| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include <sys/uio.h> |
| 5 |
|
| 6 |
#include "shared-forward.h" |
| 7 |
|
| 8 |
int acquire_tpm2_key( |
| 9 |
const char *volume_name, |
| 10 |
const char *device, |
| 11 |
uint32_t hash_pcr_mask, |
| 12 |
uint16_t pcr_bank, |
| 13 |
const struct iovec *pubkey, |
| 14 |
uint32_t pubkey_pcr_mask, |
| 15 |
const char *signature_path, |
| 16 |
const char *pcrlock_path, |
| 17 |
uint16_t primary_alg, |
| 18 |
const char *key_file, |
| 19 |
size_t key_file_size, |
| 20 |
uint64_t key_file_offset, |
| 21 |
const struct iovec blobs[], |
| 22 |
size_t n_blobs, |
| 23 |
const struct iovec policy_hash[], |
| 24 |
size_t n_policy_hash, |
| 25 |
const struct iovec *salt, |
| 26 |
const struct iovec *srk, |
| 27 |
const struct iovec *pcrlock_nv, |
| 28 |
TPM2Flags flags, |
| 29 |
usec_t until, |
| 30 |
const char *askpw_credential, |
| 31 |
AskPasswordFlags askpw_flags, |
| 32 |
struct iovec *ret_decrypted_key); |
| 33 |
|
| 34 |
int find_tpm2_auto_data( |
| 35 |
struct crypt_device *cd, |
| 36 |
uint32_t search_pcr_mask, |
| 37 |
int start_token, |
| 38 |
uint32_t *ret_hash_pcr_mask, |
| 39 |
uint16_t *ret_pcr_bank, |
| 40 |
struct iovec *ret_pubkey, |
| 41 |
uint32_t *ret_pubkey_pcr_mask, |
| 42 |
uint16_t *ret_primary_alg, |
| 43 |
struct iovec **ret_blobs, |
| 44 |
size_t *ret_n_blobs, |
| 45 |
struct iovec **ret_policy_hash, |
| 46 |
size_t *ret_n_policy_hash, |
| 47 |
struct iovec *ret_salt, |
| 48 |
struct iovec *ret_srk, |
| 49 |
struct iovec *ret_pcrlock_nv, |
| 50 |
TPM2Flags *ret_flags, |
| 51 |
int *ret_keyslot, |
| 52 |
int *ret_token); |