Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,34 @@ on:
branches: [ '*' ]

jobs:
espressif:
uses: ./.github/workflows/docker-Espressif.yml
multi-compiler:
uses: ./.github/workflows/multi-compiler.yml
openwrt:
uses: ./.github/workflows/docker-OpenWrt.yml
os-check:
uses: ./.github/workflows/os-check.yml
async:
uses: ./.github/workflows/async.yml
stunnel:
uses: ./.github/workflows/stunnel.yml
openvpn:
uses: ./.github/workflows/openvpn.yml
hostap:
uses: ./.github/workflows/hostap.yml
nginx:
uses: ./.github/workflows/nginx.yml
zephyr:
uses: ./.github/workflows/zephyr.yml
hitch:
uses: ./.github/workflows/hitch.yml
curl:
uses: ./.github/workflows/curl.yml
krb5:
uses: ./.github/workflows/krb5.yml
# espressif:
# uses: ./.github/workflows/docker-Espressif.yml
# multi-compiler:
# uses: ./.github/workflows/multi-compiler.yml
# openwrt:
# uses: ./.github/workflows/docker-OpenWrt.yml
# os-check:
# uses: ./.github/workflows/os-check.yml
# async:
# uses: ./.github/workflows/async.yml
# stunnel:
# uses: ./.github/workflows/stunnel.yml
# openvpn:
# uses: ./.github/workflows/openvpn.yml
# hostap:
# uses: ./.github/workflows/hostap.yml
# nginx:
# uses: ./.github/workflows/nginx.yml
# zephyr:
# uses: ./.github/workflows/zephyr.yml
# hitch:
# uses: ./.github/workflows/hitch.yml
# curl:
# uses: ./.github/workflows/curl.yml
# krb5:
# uses: ./.github/workflows/krb5.yml
memcached:
uses: ./.github/workflows/memcached.yml
# TODO: Currently this test fails. Enable it once it becomes passing.
# haproxy:
# uses: ./.github/workflows/haproxy.yml
82 changes: 82 additions & 0 deletions .github/workflows/memcached.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: memcached Tests

on:
workflow_call:

jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-memcached
install: true

- name: Upload built lib
uses: actions/upload-artifact@v3
with:
name: wolf-install-memcached
path: build-dir
retention-days: 1

memcached_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
include:
- ref: 1.6.19
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v3
with:
name: wolf-install-memcached
path: build-dir

- name: Checkout OSP
uses: actions/checkout@v3
with:
# TODO: Change to upstream wolfssl/osp once merged
repository: kareem-wolfssl/osp
ref: memcached
path: osp

- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y libevent-dev automake pkg-config make

- name: Checkout memcached
uses: actions/checkout@v3
with:
repository: memcached/memcached
ref: 1.6.19
path: memcached

- name: Configure and build memcached
run: |
cd $GITHUB_WORKSPACE/memcached/
patch -p1 < $GITHUB_WORKSPACE/osp/memcached/memcached_1.6.19.patch
./autogen.sh
./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir
make -j$(nproc)

- name: Confirm memcached built with wolfSSL
working-directory: ./memcached
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
ldd memcached | grep wolfssl

- name: Run memcached tests
working-directory: ./memcached
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
make -j$(nproc) test
17 changes: 16 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ AC_ARG_ENABLE([mcast],
# strongSwan (--enable-strongswan)
# OpenLDAP (--enable-openldap)
# hitch (--enable-hitch)
# memcached (--enable-memcached)

# Bind DNS compatibility Build
AC_ARG_ENABLE([bind],
Expand Down Expand Up @@ -1694,6 +1695,13 @@ AC_ARG_ENABLE([hitch],
[ ENABLED_HITCH=no ]
)

# memcached support
AC_ARG_ENABLE([memcached],
[AS_HELP_STRING([--enable-memcached],[Enable memcached support (default: disabled)])],
[ ENABLED_MEMCACHED=$enableval ],
[ ENABLED_MEMCACHED=no ]
)

# OpenSSL Coexist
AC_ARG_ENABLE([opensslcoexist],
[AS_HELP_STRING([--enable-opensslcoexist],[Enable coexistence of wolfssl/openssl (default: disabled)])],
Expand Down Expand Up @@ -6156,6 +6164,12 @@ then
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS -DWOLFSSL_CIPHER_INTERNALNAME"
fi

if test "$ENABLED_MEMCACHED" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SESSION_ID_CTX"
AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE -DHAVE_MEMCACHED"
fi


if test "$ENABLED_NGINX" = "yes"|| test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
then
Expand Down Expand Up @@ -8416,7 +8430,7 @@ then
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DWOLFSSL_ALWAYS_VERIFY_CB"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VERIFY_CB_ALL_CERTS -DWOLFSSL_EXTRA_ALERTS"
AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE -DWOLFSSL_FORCE_CACHE_ON_TICKET"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AKID_NAME -DHAVE_CTS"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AKID_NAME -DHAVE_CTS -DWOLFSSL_SESSION_ID_CTX"
fi

if test "$ENABLED_OPENSSLEXTRA" = "x509small"
Expand Down Expand Up @@ -9388,6 +9402,7 @@ echo " * chrony: $ENABLED_CHRONY"
echo " * strongSwan: $ENABLED_STRONGSWAN"
echo " * OpenLDAP: $ENABLED_OPENLDAP"
echo " * hitch: $ENABLED_HITCH"
echo " * memcached: $ENABLED_MEMCACHED"
echo " * ERROR_STRINGS: $ENABLED_ERROR_STRINGS"
echo " * DTLS: $ENABLED_DTLS"
echo " * DTLS v1.3: $ENABLED_DTLS13"
Expand Down
4 changes: 3 additions & 1 deletion src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -7307,10 +7307,12 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
ssl->alert_history.last_tx.code = -1;
ssl->alert_history.last_tx.level = -1;

#ifdef OPENSSL_EXTRA
#ifdef WOLFSSL_SESSION_ID_CTX
/* copy over application session context ID */
ssl->sessionCtxSz = ctx->sessionCtxSz;
XMEMCPY(ssl->sessionCtx, ctx->sessionCtx, ctx->sessionCtxSz);
#endif
#ifdef OPENSSL_EXTRA
ssl->cbioFlag = ctx->cbioFlag;

ssl->protoMsgCb = ctx->protoMsgCb;
Expand Down
Loading