Skip to content

Commit 803796e

Browse files
authored
Merge pull request #12107 from douzzer/20261110-linuxkm-stdrng-purge-etc
20261110-linuxkm-stdrng-purge-etc
2 parents 7b1deda + 52c00cf commit 803796e

11 files changed

Lines changed: 335 additions & 148 deletions

File tree

‎.wolfssl_known_macro_extras‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ WOLFSSL_KYBER_NO_DECAPSULATE
10431043
WOLFSSL_KYBER_NO_ENCAPSULATE
10441044
WOLFSSL_KYBER_NO_MAKE_KEY
10451045
WOLFSSL_LIB
1046+
WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG
10461047
WOLFSSL_LINUXKM_USE_GET_RANDOM_KPROBES
10471048
WOLFSSL_LINUXKM_USE_GET_RANDOM_USER_KRETPROBE
10481049
WOLFSSL_LINUXKM_USE_MUTEXES

‎doc/dox_comments/header_files/asn_public.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3251,10 +3251,13 @@ int wc_Curve448PublicKeyToDer(curve448_key* key, byte* output,
32513251
32523252
\return Success On successfully writing the encoded signature to output,
32533253
returns the length written to the buffer
3254+
\return 0 Returned on error, including when digSz is larger than
3255+
WC_MAX_DIGEST_SIZE
32543256
32553257
\param out pointer to the buffer where the encoded signature will be written
32563258
\param digest pointer to the digest to use to encode the signature
3257-
\param digSz the length of the buffer containing the digest
3259+
\param digSz the length of the buffer containing the digest; at most
3260+
WC_MAX_DIGEST_SIZE
32583261
\param hashOID OID identifying the hash type used to generate the
32593262
signature. Valid options, depending on build configurations, are: SHAh,
32603263
SHA256h, SHA384h, SHA512h, MD2h, MD5h, DESb, DES3b, CTC_MD5wRSA,

‎linuxkm/linuxkm_wc_port.h‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,12 @@
803803
#include <crypto/scatterwalk.h>
804804
#include <crypto/internal/aead.h>
805805
#include <crypto/internal/hash.h>
806-
#include <crypto/internal/rng.h>
806+
#if LINUX_VERSION_CODE < KERNEL_VERSION(7, 5, 0) && !defined(WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG)
807+
#define WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG
808+
#include <crypto/internal/rng.h>
809+
#else
810+
#undef WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG
811+
#endif
807812
#include <crypto/internal/skcipher.h>
808813
#include <crypto/internal/akcipher.h>
809814
#include <crypto/internal/kpp.h>
@@ -2328,9 +2333,11 @@
23282333
#endif /* !WC_CONTAINERIZE_THIS */
23292334
#endif
23302335

2331-
#ifdef LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT
2336+
#ifdef WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG
23322337
struct crypto_rng;
23332338
WOLFSSL_API int wc_linux_kernel_rng_is_wolfcrypt(struct crypto_rng *rng);
2339+
#else
2340+
#define wc_linux_kernel_rng_is_wolfcrypt(rng) 0
23342341
#endif
23352342

23362343
/* Undo copied defines from wc_port.h, to avoid redefinition warnings. */

0 commit comments

Comments
 (0)