/* * One pre-allocated uv_secret_list for use with uv_find_secret()
*/ staticstruct uv_secret_list *uv_list; static DEFINE_MUTEX(uv_list_mutex);
/* * UV secret token struct and defines.
*/
#define TOKVER_UV_SECRET 0x09
struct uvsecrettoken {
u8 type; /* 0x00 = TOKTYPE_NON_CCA */
u8 res0[3];
u8 version; /* 0x09 = TOKVER_UV_SECRET */
u8 res1[3];
u16 secret_type; /* one of enum uv_secret_types from uv.h */
u16 secret_len; /* length in bytes of the secret */
u8 secret_id[UV_SECRET_ID_LEN]; /* the secret id for this secret */
} __packed;
/* * Check key blob for known and supported UV key.
*/ staticbool is_uv_key(const u8 *key, u32 keylen)
{ struct uvsecrettoken *t = (struct uvsecrettoken *)key;
if (keylen < sizeof(*t)) returnfalse;
switch (t->type) { case TOKTYPE_NON_CCA: switch (t->version) { case TOKVER_UV_SECRET: switch (t->secret_type) { case UV_SECRET_AES_128: case UV_SECRET_AES_192: case UV_SECRET_AES_256: case UV_SECRET_AES_XTS_128: case UV_SECRET_AES_XTS_256: case UV_SECRET_HMAC_SHA_256: case UV_SECRET_HMAC_SHA_512: case UV_SECRET_ECDSA_P256: case UV_SECRET_ECDSA_P384: case UV_SECRET_ECDSA_P521: case UV_SECRET_ECDSA_ED25519: case UV_SECRET_ECDSA_ED448: returntrue; default: returnfalse;
} default: returnfalse;
} default: returnfalse;
}
}
/* set keytype; keybitsize and flags are not supported */ if (keytype)
*keytype = PKEY_TYPE_UVSECRET; if (keybitsize) {
bitsize = 8 * pkey_keytype_to_size(pkeytype);
*keybitsize = bitsize ?: PKEY_SIZE_UNKNOWN;
} if (flags)
*flags = pkeytype;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.