From 954d1ad13ebf753e02bfea6600607005678fdef0 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 23 Oct 2019 15:01:41 -0700 Subject: [PATCH] Sniffer Update 1. Add ssl_SetWatchKeyCallback_ex() which was missing. 2. Fix linking issue with OCTEON libraries. --- configure.ac | 4 ++-- src/sniffer.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 91c3ab1e0..53131278f 100644 --- a/configure.ac +++ b/configure.ac @@ -3903,8 +3903,8 @@ AC_ARG_WITH([octeon-sync], AM_CFLAGS="$AM_CFLAGS -I$OCTEON_ROOT/executive" #-I$OCTEON_ROOT/target/include - LDFLAGS="$LDFLAGS -lrt -Xlinker -T -Xlinker $OCTEON_ROOT/executive/cvmx-shared-linux.ld" - LIBS="$LIBS $OCTEON_ROOT/executive/$OCTEON_OBJ/libcvmx.a $OCTEON_ROOT/executive/$OCTEON_OBJ/libfdt.a" + AM_LDFLAGS="$AM_LDFLAGS -lrt -Xlinker -T -Xlinker $OCTEON_ROOT/executive/cvmx-shared-linux.ld" + AM_LDFLAGS="$AM_LDFLAGS -L$OCTEON_ROOT/executive/$OCTEON_OBJ -lcvmx -lfdt" enable_shared=no enable_static=yes diff --git a/src/sniffer.c b/src/sniffer.c index f25f30b71..835f06cdd 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -513,6 +513,7 @@ void ssl_InitSniffer(void) CryptoDeviceId = wc_CryptoCb_InitOcteon(); if (INVALID_DEVID == CryptoDeviceId) { printf("Couldn't init the Intel QA\n"); + } #endif #endif } @@ -1433,7 +1434,7 @@ static int LoadKeyFile(byte** keyBuf, word32* keyBufSz, #ifdef WOLFSSL_SNIFFER_WATCH -static int CreateWatchSnifferServer(char* error) +static int CreateWatchSnifferServer(char* error, int devId) { SnifferServer* sniffer; @@ -1452,7 +1453,7 @@ static int CreateWatchSnifferServer(char* error) } #ifdef WOLF_CRYPTO_CB if (CryptoDeviceId != INVALID_DEVID) - wolfSSL_CTX_SetDevId(sniffer->ctx, CryptoDeviceId); + wolfSSL_CTX_SetDevId(sniffer->ctx, devId); #endif ServerList = sniffer; @@ -4503,10 +4504,17 @@ int ssl_ReadResetStatistics(SSLStats* stats) #ifdef WOLFSSL_SNIFFER_WATCH +int ssl_SetWatchKeyCallback_ex(SSLWatchCb cb, int devId, char* error) +{ + WatchCb = cb; + return CreateWatchSnifferServer(error, devId); +} + + int ssl_SetWatchKeyCallback(SSLWatchCb cb, char* error) { WatchCb = cb; - return CreateWatchSnifferServer(error); + return CreateWatchSnifferServer(error, INVALID_DEVID); }