diff --git a/Package.swift b/Package.swift index f041a67e..d3ed324c 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ // // This source file is part of the SwiftCrypto open source project // -// Copyright (c) 2019 Apple Inc. and the SwiftCrypto project authors +// Copyright (c) 2019-2023 Apple Inc. and the SwiftCrypto project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -107,7 +107,18 @@ let package = Package( ], swiftSettings: swiftSettings ), - .target(name: "_CryptoExtras", dependencies: ["CCryptoBoringSSL", "CCryptoBoringSSLShims", "CryptoBoringWrapper", "Crypto"]), + .target( + name: "_CryptoExtras", + dependencies: [ + "CCryptoBoringSSL", + "CCryptoBoringSSLShims", + "CryptoBoringWrapper", + "Crypto" + ], + exclude: [ + "CMakeLists.txt", + ] + ), .target( name: "CryptoBoringWrapper", dependencies: [ diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 35d3fd8c..238d9af3 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -2,7 +2,7 @@ ## ## This source file is part of the SwiftCrypto open source project ## -## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors +## Copyright (c) 2021-2023 Apple Inc. and the SwiftCrypto project authors ## Licensed under Apache License v2.0 ## ## See LICENSE.txt for license information @@ -16,3 +16,4 @@ add_subdirectory(CCryptoBoringSSL) add_subdirectory(CCryptoBoringSSLShims) add_subdirectory(CryptoBoringWrapper) add_subdirectory(Crypto) +add_subdirectory(_CryptoExtras) diff --git a/Sources/_CryptoExtras/CMakeLists.txt b/Sources/_CryptoExtras/CMakeLists.txt new file mode 100644 index 00000000..b98f2917 --- /dev/null +++ b/Sources/_CryptoExtras/CMakeLists.txt @@ -0,0 +1,46 @@ +##===----------------------------------------------------------------------===## +## +## This source file is part of the SwiftCrypto open source project +## +## Copyright (c) 2023 Apple Inc. and the SwiftCrypto project authors +## Licensed under Apache License v2.0 +## +## See LICENSE.txt for license information +## See CONTRIBUTORS.md for the list of SwiftCrypto project authors +## +## SPDX-License-Identifier: Apache-2.0 +## +##===----------------------------------------------------------------------===## + +add_library(_CryptoExtras + "AES/AES_GCM_SIV.swift" + "AES/Block Function.swift" + "AES/BoringSSL/AES_GCM_SIV_boring.swift" + "RSA/RSA.swift" + "RSA/RSA_boring.swift" + "RSA/RSA_security.swift" + "Util/BoringSSLHelpers.swift" + "Util/CryptoKitErrors_boring.swift" + "Util/DigestType.swift" + "Util/Error.swift" + "Util/PEMDocument.swift" + "Util/RandomBytes.swift") + +target_include_directories(_CryptoExtras PRIVATE + $ + $) + +target_link_libraries(_CryptoExtras PUBLIC + $<$>:Foundation> + Crypto + CryptoBoringWrapper + CCryptoBoringSSL + CCryptoBoringSSLShims) + +target_link_options(_CryptoExtras PRIVATE + "$<$:SHELL:-Xlinker -framework -Xlinker Security>") + +set_target_properties(_CryptoExtras PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) + +set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS _CryptoExtras) diff --git a/scripts/soundness.sh b/scripts/soundness.sh index 9c4fbb07..06b8fcfe 100755 --- a/scripts/soundness.sh +++ b/scripts/soundness.sh @@ -3,7 +3,7 @@ ## ## This source file is part of the SwiftCrypto open source project ## -## Copyright (c) 2019-2021 Apple Inc. and the SwiftCrypto project authors +## Copyright (c) 2019-2023 Apple Inc. and the SwiftCrypto project authors ## Licensed under Apache License v2.0 ## ## See LICENSE.txt for license information @@ -17,7 +17,7 @@ set -eu here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function replace_acceptable_years() { # this needs to replace all acceptable forms with 'YEARS' - sed -e 's/20[12][890]-20[12][1290]/YEARS/' -e 's/20[12][90123]/YEARS/' + sed -e 's/20[12][8901]-20[12][90123]/YEARS/' -e 's/20[12][90123]/YEARS/' } printf "=> Checking for unacceptable language... " diff --git a/scripts/update_cmakelists.sh b/scripts/update_cmakelists.sh index be2f847d..e1fcc2d9 100755 --- a/scripts/update_cmakelists.sh +++ b/scripts/update_cmakelists.sh @@ -3,7 +3,7 @@ ## ## This source file is part of the SwiftCrypto open source project ## -## Copyright (c) 2021 Apple Inc. and the SwiftCrypto project authors +## Copyright (c) 2021-2023 Apple Inc. and the SwiftCrypto project authors ## Licensed under Apache License v2.0 ## ## See LICENSE.txt for license information @@ -80,6 +80,8 @@ function update_cmakelists_assembly() { update_cmakelists_source "CCryptoBoringSSL" "*.c" update_cmakelists_source "CCryptoBoringSSLShims" "*.c" +update_cmakelists_source "CryptoBoringWrapper" "*.swift" update_cmakelists_source "Crypto" "*.swift" +update_cmakelists_source "_CryptoExtras" "*.swift" update_cmakelists_assembly "CCryptoBoringSSL"