mlx5dv_crypto_lo...to_login_destroy(3)
π mlx5dv_crypto_login_create(3), mlx5dv_crypto_login_query(3), mlx5dv_crypto_login_destroy(3) π
okay so bestie, this is the mlx5dv_crypto_lo...to_login_destroy(3) page from the mlx5dv_crypto family of manual pages β yes the whole trio is crammed into one page, we love an efficient queen β¨
πΈ NAME πΈ
mlx5dv_crypto_login_createβ literally creates a crypto login object πmlx5dv_crypto_login_queryβ queries the given crypto login object, like a vibe check but for creds πmlx5dv_crypto_login_destroyβ destroys the given crypto login object π
β¨ SYNOPSIS β¨
#include <infiniband/mlx5dv.h>
struct mlx5dv_crypto_login_obj *
mlx5dv_crypto_login_create(struct ibv_context *context,
struct mlx5dv_crypto_login_attr_ex *login_attr);
int mlx5dv_crypto_login_query(struct mlx5dv_crypto_login_obj *crypto_login,
struct mlx5dv_crypto_login_query_attr *query_attr);
int mlx5dv_crypto_login_destroy(struct mlx5dv_crypto_login_obj *crypto_login);
π¦ DESCRIPTION π¦
So here's the tea β β when you're using a crypto engine that's in wrapped import method, you must hand it a valid crypto login object in order to create and query wrapped Data Encryption Keys (DEKs). No object, no DEKs, periodt.
But like, don't panic π β a valid crypto login object is necessary only to create and query wrapped DEKs. Existing DEKs that were previously created don't need a valid crypto login object in order to be used (in MKey or during traffic). They're already living their best life, no login required π
mlx5dv_crypto_login_create() creates and returns a crypto login object with the credential given in login_attr. Heads up though β only one crypto login object can be created per device context. That's it. One. Main character energy only π The created crypto login object must be provided to mlx5dv_dek_create() in order to create wrapped DEKs.
mlx5dv_crypto_login_query() queries the crypto login object crypto_login and returns the queried attributes in query_attr. It's giving "so tell me about yourself" π«Ά
mlx5dv_crypto_login_destroy() destroys the given crypto login object. Bye bestie πβ¨
π ARGUMENTS π
context
The device context that will be associated with the crypto login object. Basically the setting where this whole thing goes down π
login_attr
Crypto extended login attributes β they specify the credential to login with and the import KEK to be used for secured communications done with the crypto login object. So many jobs, but she handles it π₯
struct mlx5dv_crypto_login_attr_ex {
uint32_t credential_id;
uint32_t import_kek_id;
const void *credential;
size_t credential_len;
uint64_t comp_mask;
};
credential_id
An ID of a credential, from the credentials stored on the device, that indicates the credential that should be validated against the credential provided in credential. Think of it as the name tag pointing at which stored credential to check against π·οΈ
import_kek_id
An ID of an import KEK, from the import KEKs stored on the device, that indicates the import KEK that will be used for unwrapping the credential provided in credential β and also for all other secured communications done with the crypto login object. It's the multitasking icon we deserve π
credential
The credential to login with. Credential is a piece of data used to authenticate the user for crypto login. The credential in credential is validated against the credential indicated by credential_id, which is stored on the device. The credentials must match in order for the crypto login to succeed β no match, no entry, sorry bestie π
credential must be provided wrapped by the AES key wrap algorithm using the import KEK indicated by import_kek_id. And the credential format is:
ENC(iv_64b + plaintext_credential)
where ENC() is the AES key wrap algorithm and iv_64b is 0xA6A6A6A6A6A6A6A6 as per the NIST SP 800-38F AES key wrap spec, and plaintext_credential is the credential value stored on the device. Very specific, very demure β¨
credential_len
The length of the provided credential value in bytes. π
comp_mask
Reserved for future extension, must be 0 now. Don't be cute and put something else in there π
query_attr
Crypto login attributes to be populated when querying a crypto login object. She gets filled in when you ask π«Ά
struct mlx5dv_crypto_login_query_attr {
enum mlx5dv_crypto_login_state state;
uint64_t comp_mask;
};
state
The state of the crypto login object, can be one of the following:
MLX5DV_CRYPTO_LOGIN_STATE_VALIDβ the crypto login object is valid and can be used. Slay πMLX5DV_CRYPTO_LOGIN_STATE_INVALIDβ the crypto login object is invalid and cannot be used. A valid crypto login object can become invalid if the credential or the import KEK used in the crypto login object were deleted while in use (for example by a crypto officer). Rough, I know π In this case,mlx5dv_crypto_login_destroy()should be called to destroy the invalid crypto login object, and if still necessary,mlx5dv_crypto_login_create()should be called to create a new crypto login object with valid credential and import KEK. Glow-up arc π₯
comp_mask
Reserved for future extension, must be 0 now. Same rule as before, bestie β zero it out π
π RETURN VALUE π
mlx5dv_crypto_login_create()returns a pointer to a new valid structmlx5dv_crypto_login_objon success. On errorNULLis returned anderrnois set. πmlx5dv_crypto_login_query()returns0on success and fillsquery_attrwith the queried attributes. On error,errnois returned.mlx5dv_crypto_login_destroy()returns0on success anderrnoon error.
π SEE ALSO π
π AUTHORS π
Avihai Horon <avihaih@nvidia.com> β thank you for your service π«Ά
fr fr, that's the whole page. go forth and login responsibly β¨
sign-off szn π¦ this lil masterpiece lives in mlx5dv_crypto_lo...to_login_destroy(3) land, sourced from the same, and it's dated the same as the original page footer β mwah, love u, bye π
π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms