Re: [PATCH v3 05/14] PGPLIB: Signature parser

Jarkko Sakkinen
2024-09-12T13:58:41Z

On Wed Sep 11, 2024 at 3:29 PM EEST, Roberto Sassu wrote:
> From: David Howells <dhowells@redhat.com>
>
> Provide some PGP signature parsing helpers:
>
> (1) A function to parse V4 signature subpackets and pass the desired ones
> to a processor function:
>
> int pgp_parse_sig_subpkts(const u8 *data, size_t datalen,
> struct pgp_parse_sig_context *ctx);
>
> (2) A function to parse out basic signature parameters from any PGP
> signature such that the algorithms and public key can be selected:
>
> int pgp_parse_sig_params(const u8 **_data, size_t *_datalen,
> struct pgp_sig_parameters *p);
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Co-developed-by: Roberto Sassu <roberto.sassu@huawei.com>
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> ---
> crypto/asymmetric_keys/pgp_library.c | 284 +++++++++++++++++++++++++++
> crypto/asymmetric_keys/pgplib.h | 25 +++
> 2 files changed, 309 insertions(+)
>
> diff --git a/crypto/asymmetric_keys/pgp_library.c b/crypto/asymmetric_keys/pgp_library.c
> index 1b87f8af411b..a9708ccbcb81 100644
> --- a/crypto/asymmetric_keys/pgp_library.c
> +++ b/crypto/asymmetric_keys/pgp_library.c
> @@ -260,3 +260,287 @@ int pgp_parse_public_key(const u8 **_data, size_t *_datalen,
> return 0;
> }
> EXPORT_SYMBOL_GPL(pgp_parse_public_key);
> +
> +/**
> + * pgp_parse_sig_subpkt_header - Parse a PGP V4 signature subpacket header
()

BR, Jarkko