[new port] Add wolfSSL projects (#24348)

* Add wolfSSL port

* Add wolfMQTT

* Add wolfTPM

* Update ci.baseline.txt for wolfSSL, wolfMQTT, wolfTPM

* curl: Add wolfSSL feature

* wolfSSL: Always build out of tree and enable DES3

* wolfssl: support !uwp and use PORT variable for copyright install

* curl: use `VCPKG_TARGET_IS_WINDOWS` instead of triplet and `MATCHES`

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* curl[wolfssl]: add DES_ECB and add patch to resolve ntlm includes

* Fix version database.

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
elms 2022-05-17 11:13:39 -07:00 committed by GitHub
parent 306c9a9e22
commit fe2d25fa90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 236 additions and 1 deletions

View File

@ -13,6 +13,7 @@ vcpkg_from_github(
0022-deduplicate-libs.patch
mbedtls-ws2_32.patch
export-components.patch
wolfssl-ntlm.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB)
@ -38,6 +39,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
# Support HTTP2 TLS Download https://curl.haxx.se/ca/cacert.pem rename to curl-ca-bundle.crt, copy it to libcurl.dll location.
http2 USE_NGHTTP2
wolfssl CURL_USE_WOLFSSL
openssl CURL_USE_OPENSSL
mbedtls CURL_USE_MBEDTLS
ssh CURL_USE_LIBSSH2

View File

@ -1,6 +1,7 @@
{
"name": "curl",
"version": "7.83.1",
"port-version": 1,
"description": "A library for transferring data with URLs",
"homepage": "https://curl.se/",
"license": null,
@ -183,6 +184,12 @@
]
}
]
},
"wolfssl": {
"description": "SSL support (wolfSSL)",
"dependencies": [
"wolfssl"
]
}
}
}

View File

@ -0,0 +1,38 @@
--- a/lib/curl_ntlm_core.c
+++ b/lib/curl_ntlm_core.c
@@ -60,12 +60,17 @@
#ifdef USE_WOLFSSL
#include <wolfssl/options.h>
-#endif
-
+# include <wolfssl/openssl/des.h>
+# include <wolfssl/openssl/md5.h>
+# include <wolfssl/openssl/ssl.h>
+# include <wolfssl/openssl/rand.h>
+#else
# include <openssl/des.h>
# include <openssl/md5.h>
# include <openssl/ssl.h>
# include <openssl/rand.h>
+#endif
+
# if (defined(OPENSSL_VERSION_NUMBER) && \
(OPENSSL_VERSION_NUMBER < 0x00907001L)) && !defined(USE_WOLFSSL)
# define DES_key_schedule des_key_schedule
diff -ur a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h
--- a/lib/curl_ntlm_core.h 2022-05-10 23:11:15.000000000 -0700
+++ b/lib/curl_ntlm_core.h 2022-05-16 16:48:39.931726300 -0700
@@ -35,10 +35,10 @@
#define NTLM_NEEDS_NSS_INIT
#endif
-#if defined(USE_OPENSSL) || defined(USE_WOLFSSL)
#ifdef USE_WOLFSSL
# include <wolfssl/options.h>
-#endif
+# include <wolfssl/openssl/ssl.h>
+#else
# include <openssl/ssl.h>
#endif

View File

@ -0,0 +1,28 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wolfssl/wolfmqtt
REF v1.13.0
SHA512 2bd05471c548bacf6fc5166d9c2ee546b3ce5c4fab89ff16175de9ab7696b8b570cdd7d4377378fc0cb579447488dbf727cb938192eb3180ed007414cb949a8a
HEAD_REF master
)
vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DWOLFMQTT_EXAMPLES=no
OPTIONS_DEBUG
-DCMAKE_C_FLAGS='-DDEBUG_MQTT'
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
RENAME copyright)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/wolfmqtt)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

19
ports/wolfmqtt/vcpkg.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "wolfmqtt",
"version": "1.13.0",
"description": "MQTT library used with wolfSSL libraray for many platforms",
"homepage": "https://wolfssl.com",
"license": "GPL-2.0-or-later",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"wolfssl"
]
}

View File

@ -0,0 +1,36 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wolfssl/wolfssl
REF v5.3.0-stable
SHA512 399d2b8aad58471d237d21dea68c33fde2b9a3c117c554c241d9174db02847a6c31afae2908839d18f9ada317b2388560a24c077b76014f663227061342bf045
HEAD_REF master
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DWOLFSSL_BUILD_OUT_OF_TREE=yes
-DWOLFSSL_EXAMPLES=no
-DWOLFSSL_CRYPT_TESTS=no
-DWOLFSSL_OPENSSLEXTRA=yes
-DWOLFSSL_TPM=yes
-DWOLFSSL_TLSX=yes
-DWOLFSSL_OCSP=yes
-DWOLFSSL_OCSPSTAPLING=yes
-DWOLFSSL_OCSPSTAPLING_V2=yes
-DWOLFSSL_CRL=yes
-DWOLFSSL_DES3=yes
-DCMAKE_C_FLAGS='-DWOLFSSL_ALT_CERT_CHAINS\ -DWOLFSSL_DES_ECB'
OPTIONS_DEBUG
-DWOLFSSL_DEBUG=yes)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/wolfssl)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

18
ports/wolfssl/vcpkg.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "wolfssl",
"version": "5.3.0",
"description": "TLS and Cryptographic libraray for many platforms",
"homepage": "https://wolfssl.com",
"license": "GPL-2.0-or-later",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,24 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wolfssl/wolftpm
REF v2.4.0
SHA512 82aa43f8773cc230d403d7e6cdbc4dc7dc8a3cb8e2f942c810a5ef0d60647d288ce82910820127ed6e67771d3900cfc55c5f9d87b722e0847bcb6a81c4e41441
HEAD_REF master
)
vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DWOLFTPM_EXAMPLES=no
OPTIONS_DEBUG
-DCMAKE_C_FLAGS='-DDEBUG_WOLFTPM'
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/wolftpm)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

19
ports/wolftpm/vcpkg.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "wolftpm",
"version": "2.4.0",
"description": "TPM library used with wolfSSL libraray for many platforms",
"homepage": "https://wolfssl.com",
"license": "GPL-2.0-or-later",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"wolfssl"
]
}

View File

@ -1746,7 +1746,7 @@
},
"curl": {
"baseline": "7.83.1",
"port-version": 0
"port-version": 1
},
"curlpp": {
"baseline": "2018-06-15",
@ -7524,6 +7524,18 @@
"baseline": "1.0.2",
"port-version": 3
},
"wolfmqtt": {
"baseline": "1.13.0",
"port-version": 0
},
"wolfssl": {
"baseline": "5.3.0",
"port-version": 0
},
"wolftpm": {
"baseline": "2.4.0",
"port-version": 0
},
"wordnet": {
"baseline": "3.0",
"port-version": 1

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "69e1aaae731455f5ed18b7eea4da75ee10bd073a",
"version": "7.83.1",
"port-version": 1
},
{
"git-tree": "6f536c70dc927199fe430fde4e93f8d66d53b6f6",
"version": "7.83.1",

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "bc6b26e4254f8938dc9db7f7b5dc84958a45c877",
"version": "1.13.0",
"port-version": 0
}
]
}

9
versions/w-/wolfssl.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "4dee782f3dda81bc4a72959bcda6d1377a24cbaa",
"version": "5.3.0",
"port-version": 0
}
]
}

9
versions/w-/wolftpm.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "647740c5ad277ccf2d910605595118087f3bc342",
"version": "2.4.0",
"port-version": 0
}
]
}