forked from wolfSSL/wolfssl
linuxkm:
* LKCAPI integration tweaks for buildability and streamlining. * add DEBUG_VECTOR_REGISTER_ACCESS_FUZZING && !DEBUG_VECTOR_REGISTER_ACCESS, with a kernel-compatible implementation of SAVE_VECTOR_REGISTERS2_fuzzer().
This commit is contained in:
@@ -317,6 +317,28 @@ static int wolfssl_init(void)
|
||||
pr_info("wolfCrypt self-test passed.\n");
|
||||
#endif
|
||||
|
||||
#if defined(LINUXKM_REGISTER_ALG) && !defined(NO_AES)
|
||||
ret = linuxkm_register_alg();
|
||||
|
||||
if (ret) {
|
||||
pr_err("linuxkm_register_alg failed with return code %d.\n", ret);
|
||||
linuxkm_unregister_alg();
|
||||
(void)libwolfssl_cleanup();
|
||||
msleep(10);
|
||||
return -ECANCELED;
|
||||
}
|
||||
|
||||
ret = linuxkm_test_alg();
|
||||
|
||||
if (ret) {
|
||||
pr_err("linuxkm_test_alg failed with return code %d.\n", ret);
|
||||
(void)libwolfssl_cleanup();
|
||||
linuxkm_unregister_alg();
|
||||
msleep(10);
|
||||
return -ECANCELED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_LINUXKM_BENCHMARKS
|
||||
wolfcrypt_benchmark_main(0, (char**)NULL);
|
||||
#endif
|
||||
@@ -343,27 +365,6 @@ static int wolfssl_init(void)
|
||||
);
|
||||
#endif
|
||||
|
||||
#if defined(LINUXKM_REGISTER_ALG) && !defined(NO_AES)
|
||||
ret = linuxkm_register_alg();
|
||||
|
||||
if (ret) {
|
||||
pr_err("linuxkm_register_alg failed with return code %d.\n", ret);
|
||||
(void)libwolfssl_cleanup();
|
||||
linuxkm_unregister_alg();
|
||||
msleep(10);
|
||||
return -ECANCELED;
|
||||
}
|
||||
|
||||
ret = linuxkm_test_alg();
|
||||
|
||||
if (ret) {
|
||||
pr_err("linuxkm_test_alg failed with return code %d.\n", ret);
|
||||
(void)libwolfssl_cleanup();
|
||||
linuxkm_unregister_alg();
|
||||
msleep(10);
|
||||
return -ECANCELED;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -811,6 +812,8 @@ PRAGMA_GCC_DIAG_POP;
|
||||
/* km_AesX(): wrappers to wolfcrypt wc_AesX functions and
|
||||
* structures. */
|
||||
|
||||
#include <wolfssl/wolfcrypt/aes.h>
|
||||
|
||||
struct km_AesCtx {
|
||||
Aes aes;
|
||||
u8 key[AES_MAX_KEY_SIZE / 8];
|
||||
|
Reference in New Issue
Block a user