diff options
author | Ondrej Kozina <okozina@redhat.com> | 2021-06-02 18:45:42 +0200 |
---|---|---|
committer | Ondrej Kozina <okozina@redhat.com> | 2021-08-19 13:58:10 +0200 |
commit | ed3d3af14899ac0cbf897a82005f728156366e81 (patch) | |
tree | a1c024e4065e1bc45cf5749dd54eb9598db93d08 /src/shared/pkcs11-util.h | |
parent | Add support for systemd-fido2 libcryptsetup plugin. (diff) | |
download | systemd-ed3d3af14899ac0cbf897a82005f728156366e81.tar.xz systemd-ed3d3af14899ac0cbf897a82005f728156366e81.zip |
cryptsetup-pkcs11: move pkcs11_callback and data in shared utils.
To be used later by both (future) systemd-pkcs11 libcryptsetup
plugin and cryptsetup-pkcs11.
Diffstat (limited to 'src/shared/pkcs11-util.h')
-rw-r--r-- | src/shared/pkcs11-util.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/shared/pkcs11-util.h b/src/shared/pkcs11-util.h index f7f32d34d7..fbec4e8450 100644 --- a/src/shared/pkcs11-util.h +++ b/src/shared/pkcs11-util.h @@ -49,6 +49,28 @@ int pkcs11_find_token(const char *pkcs11_uri, pkcs11_find_token_callback_t callb int pkcs11_acquire_certificate(const char *uri, const char *askpw_friendly_name, const char *askpw_icon_name, X509 **ret_cert, char **ret_pin_used); #endif +typedef struct { + const char *friendly_name; + usec_t until; + void *encrypted_key; + size_t encrypted_key_size; + void *decrypted_key; + size_t decrypted_key_size; + bool free_encrypted_key; + bool headless; +} pkcs11_crypt_device_callback_data; + +void pkcs11_crypt_device_callback_data_release(pkcs11_crypt_device_callback_data *data); + +int pkcs11_crypt_device_callback( + CK_FUNCTION_LIST *m, + CK_SESSION_HANDLE session, + CK_SLOT_ID slot_id, + const CK_SLOT_INFO *slot_info, + const CK_TOKEN_INFO *token_info, + P11KitUri *uri, + void *userdata); + #endif int pkcs11_list_tokens(void); |