/* asymmetric_key_hex_to_key_id - Convert a hex string into a key ID. @id: The ID as a hex string.  */
struct asymmetric_key_id* asymmetric_key_hex_to_key_id(const char *id)
/* asymmetric_key_hex_to_key_id - Convert a hex string into a key ID. @id: The ID as a hex string.  */
struct asymmetric_key_id* asymmetric_key_hex_to_key_id(const char *id)
{
	struct asymmetric_key_id *match_id;
	size_t asciihexlen;
	int ret;
	if (!*id)
		return ERR_PTR(-EINVAL);
	asciihexlen = strlen(id);
	if (asciihexlen & 1)
		return ERR_PTR(-EINVAL);
	match_id = kmalloc(sizeof(struct asymmetric_key_id) + asciihexlen / 2,
			   GFP_KERNEL);
	if (!match_id)
		return ERR_PTR(-ENOMEM);
	ret = __asymmetric_key_hex_to_key_id(id, match_id, asciihexlen / 2);
	if (ret < 0) {
		kfree(match_id);
		return ERR_PTR(-EINVAL);
	}
	return match_id;
}