Re: [PATCH v11 6/8] crypto: Add RSASSA-PSS support

From
David Howells <dhowells@redhat.com>
Date
2026-01-08 11:29:47
Also in
keyrings, linux-crypto, lkml
Reply to
Ignat Korchagin, 2026-01-07
Ignat Korchagin [off-list ref] wrote:
A lot of pointers and arithmetic here. Wouldn't it be easier to do
something like in [1]?
Fair point.
quoted
+DEFINE_FREE(crypto_free_shash, struct crypto_shash*,
+           if (!IS_ERR_OR_NULL(_T)) { crypto_free_shash(_T); });
Is this useful enough to go into some commonly used header for shash?
Maybe - I guess there's no actual cost to doing so as it generates an inline
function.
quoted
+       struct crypto_shash *hash_tfm __free(crypto_free_shash) = NULL;
+       struct shash_desc *Hash __free(kfree) = NULL;
So even though x509/pkcs7 code now has a counterexample (partially due
to my fault) seems the consensus [2] is to declare and initialise the
variable with the __free attribute at the same time meaning it is OK
to declare the variables later and not follow the "declaration at the
top" rule.
Ok, I'll move the decls.

David
Thread (26 messages) 26 messages, 4 authors, last reply 2026-01-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help