Skip to content

Commit e225bf8

Browse files
committed
linuxkm/linuxkm_wc_port.h: move WOLFSSL_API_PREFIX_MAPping of GetCAByAKID to wolfSSL_GetCAByAKID from wolfssl/internal.h to wolfssl/wolfcrypt/asn.h, with an additional needed early mapping in linuxkm/linuxkm_wc_port.h.
1 parent 690cce6 commit e225bf8

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

linuxkm/linuxkm_wc_port.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,9 @@
743743
struct Signer* GetCAByKeyHash(void* vp, const unsigned char* keyHash);
744744
#endif /* HAVE_OCSP */
745745
#ifdef WOLFSSL_AKID_NAME
746+
#ifdef WOLFSSL_API_PREFIX_MAP
747+
#define GetCAByAKID wolfSSL_GetCAByAKID
748+
#endif
746749
struct Signer* GetCAByAKID(void* vp, const unsigned char* issuer,
747750
unsigned int issuerSz,
748751
const unsigned char* serial,
@@ -1286,7 +1289,11 @@
12861289
#endif /* HAVE_OCSP */
12871290
#endif /* NO_SKID */
12881291
#ifdef WOLFSSL_AKID_NAME
1289-
#define GetCAByAKID WC_PIE_INDIRECT_SYM(GetCAByAKID)
1292+
#ifdef WOLFSSL_API_PREFIX_MAP
1293+
#define wolfSSL_GetCAByAKID WC_PIE_INDIRECT_SYM(wolfSSL_GetCAByAKID)
1294+
#else
1295+
#define GetCAByAKID WC_PIE_INDIRECT_SYM(GetCAByAKID)
1296+
#endif
12901297
#endif
12911298

12921299
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)

wolfssl/internal.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6698,10 +6698,11 @@ WOLFSSL_LOCAL WC_RNG* WOLFSSL_RSA_GetRNG(WOLFSSL_RSA *rsa, WC_RNG **tmpRNG,
66986698
#ifndef GetCA
66996699
WOLFSSL_LOCAL Signer* GetCA(void* vp, byte* hash);
67006700
#endif
6701-
#if defined(WOLFSSL_AKID_NAME) && !defined(GetCAByAKID)
6702-
#ifdef WOLFSSL_API_PREFIX_MAP
6703-
#define GetCAByAKID wolfSSL_GetCAByAKID
6704-
#endif
6701+
#if defined(WOLFSSL_AKID_NAME) && !defined(WC_SYM_RELOC_TABLES)
6702+
/* note WOLFSSL_API_PREFIX_MAPping is in asn.h, and if
6703+
* WC_SYM_RELOC_TABLES, the prototype is in the port layer
6704+
* (e.g. linuxkm_wc_port.h), to allow shimming.
6705+
*/
67056706
WOLFSSL_TEST_VIS Signer* GetCAByAKID(void* vp, const byte* issuer,
67066707
word32 issuerSz, const byte* serial, word32 serialSz);
67076708
#endif

wolfssl/wolfcrypt/asn.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,13 @@ typedef enum MimeStatus
20842084
#define SetAlgoID wc_SetAlgoID
20852085
#define SetAsymKeyDer wc_SetAsymKeyDer
20862086
#define CalcHashId wc_CalcHashId
2087+
#if defined(WOLFSSL_AKID_NAME) && !defined(GetCAByAKID)
2088+
/* GetCAByAKID() has two implementations, a full implementation in
2089+
* src/ssl.c, and a dummy implementation in wolfcrypt/src/asn.c for
2090+
* WOLFCRYPT_ONLY builds.
2091+
*/
2092+
#define GetCAByAKID wolfSSL_GetCAByAKID
2093+
#endif
20872094
#endif /* WOLFSSL_API_PREFIX_MAP */
20882095

20892096
WOLFSSL_LOCAL int HashIdAlg(word32 oidSum);

0 commit comments

Comments
 (0)