mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
linuxkm/lkcapi_rsa_glue.c: update version threshold for the v6.16 change in crypto_sig_*size() semantics, now backported to 6.15.3.
This commit is contained in:
@@ -1255,8 +1255,8 @@ pkcs1pad_verify_out:
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
/* Returns the rsa key size:
|
/* Returns the rsa key size:
|
||||||
* linux kernel version < 6.16: returns key size in bytes.
|
* linux kernel version < 6.15.3: returns key size in bytes.
|
||||||
* linux kernel version >= 6.16: returns key size in bits.
|
* linux kernel version >= 6.15.3: returns key size in bits.
|
||||||
* */
|
* */
|
||||||
static unsigned int km_pkcs1_key_size(struct crypto_sig *tfm)
|
static unsigned int km_pkcs1_key_size(struct crypto_sig *tfm)
|
||||||
{
|
{
|
||||||
@@ -1264,11 +1264,11 @@ static unsigned int km_pkcs1_key_size(struct crypto_sig *tfm)
|
|||||||
|
|
||||||
ctx = crypto_sig_ctx(tfm);
|
ctx = crypto_sig_ctx(tfm);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 3)
|
||||||
return (unsigned int) ctx->key_len * WOLFSSL_BIT_SIZE;
|
return (unsigned int) ctx->key_len * WOLFSSL_BIT_SIZE;
|
||||||
#else
|
#else
|
||||||
return (unsigned int) ctx->key_len;
|
return (unsigned int) ctx->key_len;
|
||||||
#endif /* linux >= 6.16 */
|
#endif /* linux >= 6.15.3 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3093,16 +3093,16 @@ static int linuxkm_test_pkcs1_driver(const char * driver, int nbits,
|
|||||||
|
|
||||||
{
|
{
|
||||||
/* The behavior of crypto_sig_Xsize (X= max, key, digest) changed
|
/* The behavior of crypto_sig_Xsize (X= max, key, digest) changed
|
||||||
* at linux kernel v6.16:
|
* at linux kernel v6.15.3:
|
||||||
* < 6.16: all three should return the same value (in bytes).
|
* < 6.15.3: all three should return the same value (in bytes).
|
||||||
* >= 6.16: keysize is in bits, maxsize and digestsize in bytes. */
|
* >= 6.15.3: keysize is in bits, maxsize and digestsize in bytes. */
|
||||||
unsigned int maxsize = crypto_sig_maxsize(tfm);
|
unsigned int maxsize = crypto_sig_maxsize(tfm);
|
||||||
unsigned int keysize = crypto_sig_keysize(tfm);
|
unsigned int keysize = crypto_sig_keysize(tfm);
|
||||||
unsigned int digestsize = crypto_sig_digestsize(tfm);
|
unsigned int digestsize = crypto_sig_digestsize(tfm);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 3)
|
||||||
keysize = ((keysize + WOLFSSL_BIT_SIZE - 1) / WOLFSSL_BIT_SIZE);
|
keysize = ((keysize + WOLFSSL_BIT_SIZE - 1) / WOLFSSL_BIT_SIZE);
|
||||||
#endif /* linux >= 6.16 */
|
#endif /* linux >= 6.15.3 */
|
||||||
|
|
||||||
#ifdef WOLFKM_DEBUG_RSA
|
#ifdef WOLFKM_DEBUG_RSA
|
||||||
pr_info("info: crypto_sig_{max, key, digest}size: "
|
pr_info("info: crypto_sig_{max, key, digest}size: "
|
||||||
|
Reference in New Issue
Block a user