Skip to content

Commit 6275f1f

Browse files
committed
linuxkm/lkcapi_rsa_glue.c: update version threshold for the v6.16 change in crypto_sig_*size() semantics, now backported to 6.15.3.
1 parent f0662e0 commit 6275f1f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

linuxkm/lkcapi_rsa_glue.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,20 +1255,20 @@ static int km_pkcs1pad_verify(struct akcipher_request *req)
12551255
#else
12561256

12571257
/* Returns the rsa key size:
1258-
* linux kernel version < 6.16: returns key size in bytes.
1259-
* linux kernel version >= 6.16: returns key size in bits.
1258+
* linux kernel version < 6.15.3: returns key size in bytes.
1259+
* linux kernel version >= 6.15.3: returns key size in bits.
12601260
* */
12611261
static unsigned int km_pkcs1_key_size(struct crypto_sig *tfm)
12621262
{
12631263
struct km_rsa_ctx * ctx = NULL;
12641264

12651265
ctx = crypto_sig_ctx(tfm);
12661266

1267-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
1267+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 3)
12681268
return (unsigned int) ctx->key_len * WOLFSSL_BIT_SIZE;
12691269
#else
12701270
return (unsigned int) ctx->key_len;
1271-
#endif /* linux >= 6.16 */
1271+
#endif /* linux >= 6.15.3 */
12721272
}
12731273

12741274
/*
@@ -3093,16 +3093,16 @@ static int linuxkm_test_pkcs1_driver(const char * driver, int nbits,
30933093

30943094
{
30953095
/* The behavior of crypto_sig_Xsize (X= max, key, digest) changed
3096-
* at linux kernel v6.16:
3097-
* < 6.16: all three should return the same value (in bytes).
3098-
* >= 6.16: keysize is in bits, maxsize and digestsize in bytes. */
3096+
* at linux kernel v6.15.3:
3097+
* < 6.15.3: all three should return the same value (in bytes).
3098+
* >= 6.15.3: keysize is in bits, maxsize and digestsize in bytes. */
30993099
unsigned int maxsize = crypto_sig_maxsize(tfm);
31003100
unsigned int keysize = crypto_sig_keysize(tfm);
31013101
unsigned int digestsize = crypto_sig_digestsize(tfm);
31023102

3103-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
3103+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 3)
31043104
keysize = ((keysize + WOLFSSL_BIT_SIZE - 1) / WOLFSSL_BIT_SIZE);
3105-
#endif /* linux >= 6.16 */
3105+
#endif /* linux >= 6.15.3 */
31063106

31073107
#ifdef WOLFKM_DEBUG_RSA
31083108
pr_info("info: crypto_sig_{max, key, digest}size: "

0 commit comments

Comments
 (0)