Skip to content

Commit 398f8c9

Browse files
Merge pull request #7952 from douzzer/20240906-GetCAByKeyHash-wolfssl_linuxkm_pie_redirect_table
20240906-GetCAByKeyHash-wolfssl_linuxkm_pie_redirect_table
2 parents e708ef3 + 87aef05 commit 398f8c9

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

linuxkm/linuxkm_wc_port.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,11 @@
461461
struct Signer *GetCA(void *signers, unsigned char *hash);
462462
#ifndef NO_SKID
463463
struct Signer *GetCAByName(void* signers, unsigned char *hash);
464-
#endif
465-
#endif
464+
#ifdef HAVE_OCSP
465+
struct Signer* GetCAByKeyHash(void* vp, const unsigned char* keyHash);
466+
#endif /* HAVE_OCSP */
467+
#endif /* NO_SKID */
468+
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
466469

467470
#if defined(__PIE__) && !defined(USE_WOLFSSL_LINUXKM_PIE_REDIRECT_TABLE)
468471
#error "compiling -fPIE requires PIE redirect table."
@@ -629,8 +632,11 @@
629632
typeof(GetCA) *GetCA;
630633
#ifndef NO_SKID
631634
typeof(GetCAByName) *GetCAByName;
632-
#endif
633-
#endif
635+
#ifdef HAVE_OCSP
636+
typeof(GetCAByKeyHash) *GetCAByKeyHash;
637+
#endif /* HAVE_OCSP */
638+
#endif /* NO_SKID */
639+
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
634640

635641
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
636642
typeof(dump_stack) *dump_stack;
@@ -778,8 +784,11 @@
778784
#define GetCA (wolfssl_linuxkm_get_pie_redirect_table()->GetCA)
779785
#ifndef NO_SKID
780786
#define GetCAByName (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByName)
781-
#endif
782-
#endif
787+
#ifdef HAVE_OCSP
788+
#define GetCAByKeyHash (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByKeyHash)
789+
#endif /* HAVE_OCSP */
790+
#endif /* NO_SKID */
791+
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
783792

784793
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
785794
#define dump_stack (wolfssl_linuxkm_get_pie_redirect_table()->dump_stack)

linuxkm/module_hooks.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,11 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
577577
wolfssl_linuxkm_pie_redirect_table.GetCA = GetCA;
578578
#ifndef NO_SKID
579579
wolfssl_linuxkm_pie_redirect_table.GetCAByName = GetCAByName;
580-
#endif
581-
#endif
580+
#ifdef HAVE_OCSP
581+
wolfssl_linuxkm_pie_redirect_table.GetCAByKeyHash = GetCAByKeyHash;
582+
#endif /* HAVE_OCSP */
583+
#endif /* NO_SKID */
584+
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
582585

583586
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
584587
wolfssl_linuxkm_pie_redirect_table.dump_stack = dump_stack;

wolfssl/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6466,7 +6466,7 @@ WOLFSSL_LOCAL WC_RNG* WOLFSSL_RSA_GetRNG(WOLFSSL_RSA *rsa, WC_RNG **tmpRNG,
64666466
WOLFSSL_LOCAL Signer* GetCAByAKID(void* vp, const byte* issuer,
64676467
word32 issuerSz, const byte* serial, word32 serialSz);
64686468
#endif
6469-
#ifdef HAVE_OCSP
6469+
#if defined(HAVE_OCSP) && !defined(GetCAByKeyHash)
64706470
WOLFSSL_LOCAL Signer* GetCAByKeyHash(void* vp, const byte* keyHash);
64716471
#endif
64726472
#if !defined(NO_SKID) && !defined(GetCAByName)

0 commit comments

Comments
 (0)