^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* Asymmetric public-key cryptography data parser
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * See Documentation/crypto/asymmetric-keys.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Written by David Howells (dhowells@redhat.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef _KEYS_ASYMMETRIC_PARSER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define _KEYS_ASYMMETRIC_PARSER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Key data parser. Called during key instantiation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct asymmetric_key_parser {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct list_head link;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct module *owner;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /* Attempt to parse a key from the data blob passed to add_key() or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * keyctl_instantiate(). Should also generate a proposed description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * that the caller can optionally use for the key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * Return EBADMSG if not recognised.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int (*parse)(struct key_preparsed_payload *prep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) extern int register_asymmetric_key_parser(struct asymmetric_key_parser *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) extern void unregister_asymmetric_key_parser(struct asymmetric_key_parser *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif /* _KEYS_ASYMMETRIC_PARSER_H */