* RSA signature verification
@ 2011-03-21 14:04 Dmitry Kasatkin
2011-03-21 14:06 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Kasatkin @ 2011-03-21 14:04 UTC (permalink / raw)
To: ext Herbert Xu; +Cc: linux-crypto@vger.kernel.org
Hi Herbert,
I work on kernel RSA verification for IMA/EVM.
Currently I have a patch which provides "direct" API like ksign_verify()
to get signature verified.
I was thinking about doing it via crypto interface as usual but for now
I have done it directly.
I have found some very old (5y) patches where someone tried to have it
as kind of hash API.
update(), update(), final...
As RSA, in contrast to hash, has like sign/verify operations.
For the kernel there is only verify.
Snippet from the code:
-----------------------------------------------------------------------
desc = kzalloc(sizeof(*desc) + crypto_shash_descsize(shash),
GFP_KERNEL);
if (!desc)
goto err;
desc->tfm = shash;
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
crypto_shash_init(desc);
crypto_shash_update(desc, digest, digestlen);
crypto_shash_update(desc, sig, sizeof(*sh));
crypto_shash_final(desc, h);
kfree(desc);
/* pass signature mpis address */
err = ksign_verify_rsa(key, sig + sizeof(*sh), siglen - sizeof(*sh),
h, sizeof(h));
-----------------------------------------------------------------------
So hash is calculated which is then verified against
signature.
Do you think it make sense to have it as a crypto "algo"
What kind of API you would have in mind?
Thanks,
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RSA signature verification
2011-03-21 14:04 RSA signature verification Dmitry Kasatkin
@ 2011-03-21 14:06 ` Herbert Xu
2011-03-22 6:59 ` Dmitry Kasatkin
0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2011-03-21 14:06 UTC (permalink / raw)
To: Dmitry Kasatkin; +Cc: linux-crypto@vger.kernel.org
On Mon, Mar 21, 2011 at 04:04:41PM +0200, Dmitry Kasatkin wrote:
>
> Do you think it make sense to have it as a crypto "algo"
> What kind of API you would have in mind?
So the obvious question is who will use this functionality in
the kernel? If the only use is going to be in user-space, then
the next question is are you doing this for hardware enablement.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RSA signature verification
2011-03-21 14:06 ` Herbert Xu
@ 2011-03-22 6:59 ` Dmitry Kasatkin
2011-03-22 7:26 ` Dmitry Kasatkin
2011-03-22 7:34 ` Herbert Xu
0 siblings, 2 replies; 7+ messages in thread
From: Dmitry Kasatkin @ 2011-03-22 6:59 UTC (permalink / raw)
To: ext Herbert Xu; +Cc: linux-crypto@vger.kernel.org
Hi,
As I have said in my email that it will be used by IMA/EVM subsystem.
See security/integrity subdirectory in Linux kernel...
Indeed, use of HW accelerator is also on of the targets...
- Dmitry
On 21/03/11 16:06, ext Herbert Xu wrote:
> On Mon, Mar 21, 2011 at 04:04:41PM +0200, Dmitry Kasatkin wrote:
>> Do you think it make sense to have it as a crypto "algo"
>> What kind of API you would have in mind?
> So the obvious question is who will use this functionality in
> the kernel? If the only use is going to be in user-space, then
> the next question is are you doing this for hardware enablement.
>
> Cheers,
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RSA signature verification
2011-03-22 6:59 ` Dmitry Kasatkin
@ 2011-03-22 7:26 ` Dmitry Kasatkin
2011-03-22 7:34 ` Herbert Xu
1 sibling, 0 replies; 7+ messages in thread
From: Dmitry Kasatkin @ 2011-03-22 7:26 UTC (permalink / raw)
To: ext Herbert Xu; +Cc: linux-crypto@vger.kernel.org
To elaborate a bit.
Signing of some has is usually done instead of signing some input data
directly.
For that reason signature verification is basically a combination of
hash calculation with signature verification...
The issue here is that different padding schemes can be applied to the
has before it is signed.
So after RSA decryption, de-padding has to be done, before comparing
result to the calculated hash.
- Dmitry
On 22/03/11 08:59, Dmitry Kasatkin wrote:
> Hi,
>
> As I have said in my email that it will be used by IMA/EVM subsystem.
> See security/integrity subdirectory in Linux kernel...
>
> Indeed, use of HW accelerator is also on of the targets...
>
> - Dmitry
>
>
>
> On 21/03/11 16:06, ext Herbert Xu wrote:
>> On Mon, Mar 21, 2011 at 04:04:41PM +0200, Dmitry Kasatkin wrote:
>>> Do you think it make sense to have it as a crypto "algo"
>>> What kind of API you would have in mind?
>> So the obvious question is who will use this functionality in
>> the kernel? If the only use is going to be in user-space, then
>> the next question is are you doing this for hardware enablement.
>>
>> Cheers,
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RSA signature verification
2011-03-22 6:59 ` Dmitry Kasatkin
2011-03-22 7:26 ` Dmitry Kasatkin
@ 2011-03-22 7:34 ` Herbert Xu
2011-03-22 8:57 ` Dmitry Kasatkin
1 sibling, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2011-03-22 7:34 UTC (permalink / raw)
To: Dmitry Kasatkin; +Cc: linux-crypto@vger.kernel.org, James Morris
On Tue, Mar 22, 2011 at 08:59:56AM +0200, Dmitry Kasatkin wrote:
>
> As I have said in my email that it will be used by IMA/EVM subsystem.
> See security/integrity subdirectory in Linux kernel...
Has the use of software asymmetric crypto in the kernel been
accepted for that purpose?
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RSA signature verification
2011-03-22 7:34 ` Herbert Xu
@ 2011-03-22 8:57 ` Dmitry Kasatkin
2011-03-22 8:58 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Kasatkin @ 2011-03-22 8:57 UTC (permalink / raw)
To: ext Herbert Xu; +Cc: linux-crypto@vger.kernel.org, James Morris
Hi,
Accepted by whom?
We extend functionality of Integrity subsystem in order to support
flashable images which can be verified with public keys...
- Dmitry
On 22/03/11 09:34, ext Herbert Xu wrote:
> On Tue, Mar 22, 2011 at 08:59:56AM +0200, Dmitry Kasatkin wrote:
>> As I have said in my email that it will be used by IMA/EVM subsystem.
>> See security/integrity subdirectory in Linux kernel...
> Has the use of software asymmetric crypto in the kernel been
> accepted for that purpose?
>
> Thanks,
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RSA signature verification
2011-03-22 8:57 ` Dmitry Kasatkin
@ 2011-03-22 8:58 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2011-03-22 8:58 UTC (permalink / raw)
To: Dmitry Kasatkin; +Cc: linux-crypto@vger.kernel.org, James Morris
On Tue, Mar 22, 2011 at 10:57:55AM +0200, Dmitry Kasatkin wrote:
> Hi,
>
> Accepted by whom?
> We extend functionality of Integrity subsystem in order to support
> flashable images which can be verified with public keys...
Whoever that's going to merge the use-case for this :)
I'm not adding a whole new API unless we have a solid in-kernel
user or we're doing this for hardware enablement.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-22 8:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 14:04 RSA signature verification Dmitry Kasatkin
2011-03-21 14:06 ` Herbert Xu
2011-03-22 6:59 ` Dmitry Kasatkin
2011-03-22 7:26 ` Dmitry Kasatkin
2011-03-22 7:34 ` Herbert Xu
2011-03-22 8:57 ` Dmitry Kasatkin
2011-03-22 8:58 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox