Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20240906-GetCAByKeyHash-wolfssl_linuxkm_pie_redirect_table #7952

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions linuxkm/linuxkm_wc_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,11 @@
struct Signer *GetCA(void *signers, unsigned char *hash);
#ifndef NO_SKID
struct Signer *GetCAByName(void* signers, unsigned char *hash);
#endif
#endif
#ifdef HAVE_OCSP
struct Signer* GetCAByKeyHash(void* vp, const unsigned char* keyHash);
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#if defined(__PIE__) && !defined(USE_WOLFSSL_LINUXKM_PIE_REDIRECT_TABLE)
#error "compiling -fPIE requires PIE redirect table."
Expand Down Expand Up @@ -629,8 +632,11 @@
typeof(GetCA) *GetCA;
#ifndef NO_SKID
typeof(GetCAByName) *GetCAByName;
#endif
#endif
#ifdef HAVE_OCSP
typeof(GetCAByKeyHash) *GetCAByKeyHash;
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
typeof(dump_stack) *dump_stack;
Expand Down Expand Up @@ -778,8 +784,11 @@
#define GetCA (wolfssl_linuxkm_get_pie_redirect_table()->GetCA)
#ifndef NO_SKID
#define GetCAByName (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByName)
#endif
#endif
#ifdef HAVE_OCSP
#define GetCAByKeyHash (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByKeyHash)
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
#define dump_stack (wolfssl_linuxkm_get_pie_redirect_table()->dump_stack)
Expand Down
7 changes: 5 additions & 2 deletions linuxkm/module_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,11 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
wolfssl_linuxkm_pie_redirect_table.GetCA = GetCA;
#ifndef NO_SKID
wolfssl_linuxkm_pie_redirect_table.GetCAByName = GetCAByName;
#endif
#endif
#ifdef HAVE_OCSP
wolfssl_linuxkm_pie_redirect_table.GetCAByKeyHash = GetCAByKeyHash;
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
wolfssl_linuxkm_pie_redirect_table.dump_stack = dump_stack;
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6466,7 +6466,7 @@ WOLFSSL_LOCAL WC_RNG* WOLFSSL_RSA_GetRNG(WOLFSSL_RSA *rsa, WC_RNG **tmpRNG,
WOLFSSL_LOCAL Signer* GetCAByAKID(void* vp, const byte* issuer,
word32 issuerSz, const byte* serial, word32 serialSz);
#endif
#ifdef HAVE_OCSP
#if defined(HAVE_OCSP) && !defined(GetCAByKeyHash)
WOLFSSL_LOCAL Signer* GetCAByKeyHash(void* vp, const byte* keyHash);
#endif
#if !defined(NO_SKID) && !defined(GetCAByName)
Expand Down