Re: [PATCH v3 13/18] crypto: rsa-psspad: Get signature parameters from a given signature

From: Varad Gautam
Date: Mon Jul 05 2021 - 05:39:24 EST


Hi Herbert,

On 5/14/21 12:45 PM, Herbert Xu wrote:
> On Tue, Apr 20, 2021 at 01:41:18PM +0200, Varad Gautam wrote:
>>
>> +static int psspad_set_sig_params(struct crypto_akcipher *tfm,
>> + const void *sig,
>> + unsigned int siglen)
>> +{
>> + struct akcipher_instance *inst = akcipher_alg_instance(tfm);
>> + struct rsapad_inst_ctx *ictx = akcipher_instance_ctx(inst);
>> + const struct public_key_signature *s = sig;
>> +
>> + if (!sig)
>> + return -EINVAL;
>> +
>> + ictx->salt_len = s->salt_length;
>> + ictx->mgf_hash_algo = s->mgf_hash_algo;
>
> Is there any reason why this couldn't be embedded into the key
> instead?

Sorry about the delay, do you mean setting these as part of
rsapad_set_pub_key()?

The same pubkey can be used to verify both PSS and PKCSv1.5 style signatures,
so I don't see the signature params (salt length / mgf hash) being a part
of the pkey state.

Thanks,
Varad

>
> Thanks,
>

--
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5
90409 Nürnberg
Germany

HRB 36809, AG Nürnberg
Geschäftsführer: Felix Imendörffer