diff --git a/ports/gsoap/CONTROL b/ports/gsoap/CONTROL index ae1d1625bce395..364deb380bc17b 100644 --- a/ports/gsoap/CONTROL +++ b/ports/gsoap/CONTROL @@ -1,4 +1,4 @@ Source: gsoap -Version: 2.8.82-2 +Version: 2.8.84-1 Build-Depends: curl Description: The gSOAP toolkit is a C and C++ software development toolkit for SOAP and REST XML Web services and generic C/C++ XML data bindings. \ No newline at end of file diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake index 5924ff5adbdb1e..79270c7cb13ecd 100644 --- a/ports/gsoap/portfile.cmake +++ b/ports/gsoap/portfile.cmake @@ -1,12 +1,12 @@ include(vcpkg_common_functions) set(GSOAP_VERSION 2.8) -set(GSOAP_SUB_VERSION .82) +set(GSOAP_SUB_VERSION .84) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gsoap-${GSOAP_VERSION}) vcpkg_download_distfile(ARCHIVE URLS "https://ayera.dl.sourceforge.net/project/gsoap2/gsoap-${GSOAP_VERSION}/gsoap_${GSOAP_VERSION}${GSOAP_SUB_VERSION}.zip" FILENAME "gsoap_${GSOAP_VERSION}${GSOAP_SUB_VERSION}.zip" - SHA512 daf6a1870fe43beb20d0faf646b171c92629885708baabea5bbce79fa5a8030f014dbe5c0bf4024031df993dd3ed3a90449db813946cfdfa9c12318096b57eec + SHA512 ec050119cd3e480b266cad36823f4862fe0ac21045ce901c3c91a552eae2fbf9e1cd515458835807cce54c04df7835a980a299d37f418190cd57684fd6bdcf79 ) vcpkg_extract_source_archive_ex( diff --git a/ports/libu2f-server/CMakeLists.txt b/ports/libu2f-server/CMakeLists.txt new file mode 100644 index 00000000000000..5e1f50e521ee46 --- /dev/null +++ b/ports/libu2f-server/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.5) + +project(libu2f-server C) + +file(GLOB_RECURSE LIBU2F_SERVER_HEADERS u2f-server/*.h) +file(GLOB_RECURSE LIBU2F_SERVER_SOURCE u2f-server/*.c) + +add_library(libu2f-server ${LIBU2F_SERVER_SOURCE}) + +target_include_directories(libu2f-server PUBLIC $ $) +target_compile_definitions(libu2f-server PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE) + +find_package(json-c CONFIG REQUIRED) +find_package(OpenSSL REQUIRED) +target_link_libraries(libu2f-server PRIVATE OpenSSL::SSL OpenSSL::Crypto json-c::json-c) + +install(TARGETS libu2f-server + EXPORT libu2f-serverConfig + RUNTIME DESTINATION "bin" + ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" +) + +INSTALL(FILES ${LIBU2F_SERVER_HEADERS} DESTINATION "include/libu2f-server") + +install(EXPORT libu2f-serverConfig + FILE libu2f-serverConfig.cmake + NAMESPACE libu2f-server:: + DESTINATION "share/libu2f-server" +) \ No newline at end of file diff --git a/ports/libu2f-server/CONTROL b/ports/libu2f-server/CONTROL new file mode 100644 index 00000000000000..26803fbb7ecd09 --- /dev/null +++ b/ports/libu2f-server/CONTROL @@ -0,0 +1,4 @@ +Source: libu2f-server +Version: 1.1.0 +Build-Depends: openssl, json-c +Description: Yubico Universal 2nd Factor (U2F) Server C Library diff --git a/ports/libu2f-server/portfile.cmake b/ports/libu2f-server/portfile.cmake new file mode 100644 index 00000000000000..86e5d9bbebf2b8 --- /dev/null +++ b/ports/libu2f-server/portfile.cmake @@ -0,0 +1,31 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Yubico/libu2f-server + REF libu2f-server-1.1.0 + SHA512 085f8e7d74c1efb347747b8930386f18ba870f668f82e9bd479c9f8431585c5dc7f95b2f6b82bdd3a6de0c06f8cb2fbf51c363ced54255a936ab96536158ee59 + HEAD_REF master + PATCHES + windows.patch + strndup-fix.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/u2f-server-version.h DESTINATION ${SOURCE_PATH}/u2f-server) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + ) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +vcpkg_copy_pdbs() + +# Handle copyright +configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/libu2f-server/strndup-fix.patch b/ports/libu2f-server/strndup-fix.patch new file mode 100644 index 00000000000000..f5b7ffd8a7e510 --- /dev/null +++ b/ports/libu2f-server/strndup-fix.patch @@ -0,0 +1,31 @@ +diff --git a/u2f-server/core.c b/u2f-server/core.c +index 294c94b..746932b 100644 +--- a/u2f-server/core.c ++++ b/u2f-server/core.c +@@ -211,7 +211,7 @@ u2fs_rc u2fs_set_keyHandle(u2fs_ctx_t * ctx, const char *keyHandle) + ctx->keyHandle = NULL; + } + +- ctx->keyHandle = strndup(keyHandle, strlen(keyHandle)); ++ ctx->keyHandle = strdup(keyHandle); + + if (ctx->keyHandle == NULL) + return U2FS_MEMORY_ERROR; +@@ -726,7 +726,7 @@ static u2fs_rc decode_clientData(const char *clientData, char **output) + fprintf(stderr, "clientData: %s\n", data); + } + +- *output = strndup(data, strlen(data)); ++ *output = strdup(data); + + free(data); + data = NULL; +@@ -870,7 +870,7 @@ u2fs_rc u2fs_registration_verify(u2fs_ctx_t * ctx, const char *response, + goto failure; + + u2fs_EC_KEY_t *key_ptr; +- (*output)->keyHandle = strndup(buf, strlen(buf)); ++ (*output)->keyHandle = strdup(buf); + + rc = decode_user_key(user_public_key, &key_ptr); + if (rc != U2FS_OK) diff --git a/ports/libu2f-server/u2f-server-version.h b/ports/libu2f-server/u2f-server-version.h new file mode 100644 index 00000000000000..b38ccac814a0ea --- /dev/null +++ b/ports/libu2f-server/u2f-server-version.h @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2014 Yubico AB +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef U2F_SERVER_VERSION_H +#define U2F_SERVER_VERSION_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * U2FS_VERSION_STRING + * + * Pre-processor symbol with a string that describe the header file + * version number. Used together with u2fs_check_version() to verify + * header file and run-time library consistency. + */ +#define U2FS_VERSION_STRING "1.1.0" + +/** + * U2FS_VERSION_NUMBER + * + * Pre-processor symbol with a hexadecimal value describing the header + * file version number. For example, when the header version is 1.2.3 + * this symbol will have the value 0x01020300. The last two digits + * are only used between public releases, and will otherwise be 00. + */ +#define U2FS_VERSION_NUMBER 0x01010000 + +/** + * U2FS_VERSION_MAJOR + * + * Pre-processor symbol with a decimal value that describe the major + * level of the header file version number. For example, when the + * header version is 1.2.3 this symbol will be 1. + */ +#define U2FS_VERSION_MAJOR 1 + +/** + * U2FS_VERSION_MINOR + * + * Pre-processor symbol with a decimal value that describe the minor + * level of the header file version number. For example, when the + * header version is 1.2.3 this symbol will be 2. + */ +#define U2FS_VERSION_MINOR 1 + +/** + * U2FS_VERSION_PATCH + * + * Pre-processor symbol with a decimal value that describe the patch + * level of the header file version number. For example, when the + * header version is 1.2.3 this symbol will be 3. + */ +#define U2FS_VERSION_PATCH 0 + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ports/libu2f-server/windows.patch b/ports/libu2f-server/windows.patch new file mode 100644 index 00000000000000..2cc68ec9bf5de6 --- /dev/null +++ b/ports/libu2f-server/windows.patch @@ -0,0 +1,41 @@ +diff --git a/u2f-server/cdecode.c b/u2f-server/cdecode.c +index 6fff114..dc05ca5 100644 +--- a/u2f-server/cdecode.c ++++ b/u2f-server/cdecode.c +@@ -5,7 +5,7 @@ This is part of the libb64 project, and has been placed in the public domain. + For details, see http://sourceforge.net/projects/libb64 + */ + +-#include ++#include "b64/cdecode.h" + + int base64_decode_value(char value_in) + { +diff --git a/u2f-server/cencode.c b/u2f-server/cencode.c +index eebb24a..f3b7fa4 100644 +--- a/u2f-server/cencode.c ++++ b/u2f-server/cencode.c +@@ -5,7 +5,7 @@ This is part of the libb64 project, and has been placed in the public domain. + For details, see http://sourceforge.net/projects/libb64 + */ + +-#include ++#include "b64/cencode.h" + + const int CHARS_PER_LINE = 72; + +diff --git a/u2f-server/core.c b/u2f-server/core.c +index da440ec..294c94b 100644 +--- a/u2f-server/core.c ++++ b/u2f-server/core.c +@@ -30,8 +30,7 @@ + #include "internal.h" + + #include +-#include +-#include ++#include + #include "crypto.h" + #include "b64/cencode.h" + #include "b64/cdecode.h" + \ No newline at end of file