[LTP] [PATCH v3 27/36] keyctl31: Test KEYCTL_PKEY_ENCRYPT and KEYCTL_PKEY_DECRYPT

Petr Vorel pvorel@suse.cz
Fri Sep 18 19:01:08 CEST 2026


Hi Cyril,

> > +static const char plaintext[] = "LTP_PKEY_ENCRYPT_DECRYPT_TEST_32";
> > +#define PLAINTEXT_SIZE	(sizeof(plaintext) - 1)
> > +static unsigned char ciphertext[CIPHERTEXT_SIZE];
> > +static unsigned char decrypted[CIPHERTEXT_SIZE];

> Shouldn't these two be in the guarded buffers as well? I would say that
> it's pretty much important that the kernel does not touch anything
> outside of these arrays during encryption/decryption.

In the end I stopped here. To be honest I was not sure if array should be passed
with pointer (I suppose) or without to the struct tst_buffers. Because we don't
use it like this anywhere in the code.

Also, not only this keyctl31.c and keyctl36.c, but maybe also keyctl25.c and
keyctl27.c could be using it.

We have still few tests to merge keyctl31.c to keyctl37.c (the last 2 are really
on Andrea). Ideally you do the final changes. Feel free to use andrea/keyctl.v4
in my fork (that way you will not have to download the patches manually).

Kind regards,
Petr

> Otherwise:

> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>


More information about the ltp mailing list