Skip to content

Commit

Permalink
[wolfssl] Add feature flags dtls and secret-callback (#33295)
Browse files Browse the repository at this point in the history
* wolfssl: add features `dtls` and `secret-callback`

* bump port version

* add missing cmake options for wolfssl

* update version database

* increment port version to resolve conflicts

* update version database

* fix newline

* update version database again

* set CMAKE_C_FLAGS using detected configuration

* update version database

* update version database
  • Loading branch information
laugengebaeck authored Nov 9, 2023
1 parent a37c3c2 commit 7c5a86f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
23 changes: 22 additions & 1 deletion ports/wolfssl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ vcpkg_from_github(
PATCHES
)

if ("dtls" IN_LIST FEATURES)
set(ENABLE_DTLS yes)
else()
set(ENABLE_DTLS no)
endif()

vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")

foreach(config RELEASE DEBUG)
string(APPEND VCPKG_COMBINED_C_FLAGS_${config} " -DWOLFSSL_ALT_CERT_CHAINS -DWOLFSSL_DES_ECB -DWOLFSSL_CUSTOM_OID -DHAVE_OID_ENCODING -DWOLFSSL_CERT_GEN -DWOLFSSL_ASN_TEMPLATE -DWOLFSSL_KEY_GEN -DHAVE_PKCS7 -DHAVE_AES_KEYWRAP -DWOLFSSL_AES_DIRECT -DHAVE_X963_KDF")
if ("secret-callback" IN_LIST FEATURES)
string(APPEND VCPKG_COMBINED_C_FLAGS_${config} " -DHAVE_SECRET_CALLBACK")
endif()
endforeach()

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
Expand All @@ -21,8 +37,13 @@ vcpkg_cmake_configure(
-DWOLFSSL_OCSPSTAPLING_V2=yes
-DWOLFSSL_CRL=yes
-DWOLFSSL_DES3=yes
-DCMAKE_C_FLAGS='-DWOLFSSL_ALT_CERT_CHAINS\ -DWOLFSSL_DES_ECB\ -DWOLFSSL_CUSTOM_OID\ -DHAVE_OID_ENCODING\ -DWOLFSSL_CERT_GEN\ -DWOLFSSL_ASN_TEMPLATE\ -DWOLFSSL_KEY_GEN\ -DHAVE_PKCS7\ -DHAVE_AES_KEYWRAP\ -DWOLFSSL_AES_DIRECT\ -DHAVE_X963_KDF'
-DWOLFSSL_DTLS=${ENABLE_DTLS}
-DWOLFSSL_DTLS13=${ENABLE_DTLS}
-DWOLFSSL_DTLS_CID=${ENABLE_DTLS}
OPTIONS_RELEASE
-DCMAKE_C_FLAGS=${VCPKG_COMBINED_C_FLAGS_RELEASE}
OPTIONS_DEBUG
-DCMAKE_C_FLAGS=${VCPKG_COMBINED_C_FLAGS_DEBUG}
-DWOLFSSL_DEBUG=yes)

vcpkg_cmake_install()
Expand Down
15 changes: 14 additions & 1 deletion ports/wolfssl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "wolfssl",
"version": "5.6.4",
"port-version": 1,
"description": "TLS and Cryptographic library for many platforms",
"homepage": "https://wolfssl.com",
"license": "GPL-2.0-or-later",
Expand All @@ -13,6 +14,18 @@
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "vcpkg-cmake-get-vars",
"host": true
}
],
"features": {
"dtls": {
"description": "DTLS support"
},
"secret-callback": {
"description": "Enables callback to provide TLS keys for debugging"
}
]
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9022,7 +9022,7 @@
},
"wolfssl": {
"baseline": "5.6.4",
"port-version": 0
"port-version": 1
},
"wolftpm": {
"baseline": "2.7.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wolfssl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "fb8d59a3965864a1330fa99418eef1df5c354a50",
"version": "5.6.4",
"port-version": 1
},
{
"git-tree": "65cc018a18a436969ef0fa7ff531d83994326f43",
"version": "5.6.4",
Expand Down

0 comments on commit 7c5a86f

Please sign in to comment.