|
422 | 422 | #define WC_AES_XTS_SUPPORT_SIMULTANEOUS_ENC_AND_DEC_KEYS
|
423 | 423 | #endif
|
424 | 424 |
|
| 425 | + /* setup for LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT needs to be here |
| 426 | + * to assure that calls to get_random_bytes() in random.c are gated out |
| 427 | + * (they would recurse, potentially infinitely). |
| 428 | + */ |
| 429 | + #if (defined(LINUXKM_LKCAPI_REGISTER_ALL) && \ |
| 430 | + !defined(LINUXKM_LKCAPI_DONT_REGISTER_HASH_DRBG) && \ |
| 431 | + !defined(LINUXKM_LKCAPI_DONT_REGISTER_HASH_DRBG_DEFAULT)) && \ |
| 432 | + !defined(LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT) |
| 433 | + #define LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT |
| 434 | + #endif |
| 435 | + |
425 | 436 | #ifndef __PIE__
|
426 | 437 | #include <linux/crypto.h>
|
427 | 438 | #include <linux/scatterlist.h>
|
|
469 | 480 | extern void free_wolfcrypt_linuxkm_fpu_states(void);
|
470 | 481 | WOLFSSL_API __must_check int wc_can_save_vector_registers_x86(void);
|
471 | 482 | WOLFSSL_API __must_check int wc_save_vector_registers_x86(enum wc_svr_flags flags);
|
472 |
| - WOLFSSL_API void wc_restore_vector_registers_x86(void); |
| 483 | + WOLFSSL_API void wc_restore_vector_registers_x86(enum wc_svr_flags flags); |
473 | 484 |
|
474 | 485 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
|
475 | 486 | #include <asm/i387.h>
|
|
505 | 516 | #endif
|
506 | 517 | #endif
|
507 | 518 | #ifndef RESTORE_VECTOR_REGISTERS
|
508 |
| - #define RESTORE_VECTOR_REGISTERS() wc_restore_vector_registers_x86() |
| 519 | + #define RESTORE_VECTOR_REGISTERS() wc_restore_vector_registers_x86(WC_SVR_FLAG_NONE) |
509 | 520 | #endif
|
510 | 521 |
|
511 | 522 | #ifndef DISABLE_VECTOR_REGISTERS
|
512 | 523 | #define DISABLE_VECTOR_REGISTERS() wc_save_vector_registers_x86(WC_SVR_FLAG_INHIBIT)
|
513 | 524 | #endif
|
514 | 525 | #ifndef REENABLE_VECTOR_REGISTERS
|
515 |
| - #define REENABLE_VECTOR_REGISTERS() wc_restore_vector_registers_x86() |
| 526 | + #define REENABLE_VECTOR_REGISTERS() wc_restore_vector_registers_x86(WC_SVR_FLAG_INHIBIT) |
516 | 527 | #endif
|
517 | 528 |
|
518 | 529 | #elif defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) && (defined(CONFIG_ARM) || defined(CONFIG_ARM64))
|
|
1217 | 1228 | #if defined(CONFIG_X86)
|
1218 | 1229 | WOLFSSL_API __must_check int wc_can_save_vector_registers_x86(void);
|
1219 | 1230 | WOLFSSL_API __must_check int wc_save_vector_registers_x86(enum wc_svr_flags flags);
|
1220 |
| - WOLFSSL_API void wc_restore_vector_registers_x86(void); |
| 1231 | + WOLFSSL_API void wc_restore_vector_registers_x86(enum wc_svr_flags flags); |
1221 | 1232 | #ifndef DISABLE_VECTOR_REGISTERS
|
1222 | 1233 | #define DISABLE_VECTOR_REGISTERS() wc_save_vector_registers_x86(WC_SVR_FLAG_INHIBIT)
|
1223 | 1234 | #endif
|
1224 | 1235 | #ifndef REENABLE_VECTOR_REGISTERS
|
1225 |
| - #define REENABLE_VECTOR_REGISTERS() wc_restore_vector_registers_x86() |
| 1236 | + #define REENABLE_VECTOR_REGISTERS() wc_restore_vector_registers_x86(WC_SVR_FLAG_INHIBIT) |
1226 | 1237 | #endif
|
1227 | 1238 | #else /* !CONFIG_X86 */
|
1228 | 1239 | #error WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS is set for an unimplemented architecture.
|
|
0 commit comments