Skip to content

Commit

Permalink
Merge pull request wolfSSL#7952 from douzzer/20240906-GetCAByKeyHash-…
Browse files Browse the repository at this point in the history
…wolfssl_linuxkm_pie_redirect_table

20240906-GetCAByKeyHash-wolfssl_linuxkm_pie_redirect_table
  • Loading branch information
JacobBarthelmeh authored Sep 6, 2024
2 parents e708ef3 + 87aef05 commit 398f8c9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
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

0 comments on commit 398f8c9

Please sign in to comment.