Skip to content

Commit

Permalink
Updating Client/Server with myGenExtMaster Callback
Browse files Browse the repository at this point in the history
  • Loading branch information
night1rider committed Dec 19, 2024
1 parent 2f43293 commit 6617a8a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions wolfssl/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -4220,6 +4220,25 @@ static WC_INLINE int myGenMaster(WOLFSSL* ssl, void* ctx)
return ret;
}

static WC_INLINE int myGenExtMaster(WOLFSSL* ssl, byte* hash, word32 hashSz,
void* ctx)
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;

(void)ssl;
(void)cbInfo;
(void)hash;
(void)hashSz;

WOLFSSL_PKMSG("Gen Extended Master");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Gen Extended Master: ret %d\n", ret);

return ret;
}

static WC_INLINE int myGenPreMaster(WOLFSSL* ssl, byte *premaster,
word32 preSz, void* ctx)
{
Expand Down Expand Up @@ -4372,6 +4391,7 @@ static WC_INLINE void SetupPkCallbacks(WOLFSSL_CTX* ctx)

#ifndef NO_CERTS
wolfSSL_CTX_SetGenMasterSecretCb(ctx, myGenMaster);
wolfSSL_CTX_SetGenExtMasterSecretCb(ctx, myGenExtMaster);
wolfSSL_CTX_SetGenPreMasterCb(ctx, myGenPreMaster);
wolfSSL_CTX_SetGenSessionKeyCb(ctx, myGenSessionKey);
wolfSSL_CTX_SetEncryptKeysCb(ctx, mySetEncryptKeys);
Expand Down Expand Up @@ -4427,6 +4447,7 @@ static WC_INLINE void SetupPkCallbackContexts(WOLFSSL* ssl, void* myCtx)

#ifndef NO_CERTS
wolfSSL_SetGenMasterSecretCtx(ssl, myCtx);
wolfSSL_SetGenExtMasterSecretCtx(ssl, myCtx);
wolfSSL_SetGenPreMasterCtx(ssl, myCtx);
wolfSSL_SetGenSessionKeyCtx(ssl, myCtx);
wolfSSL_SetEncryptKeysCtx(ssl, myCtx);
Expand Down

0 comments on commit 6617a8a

Please sign in to comment.