From 215fde5a787fd762c840f7470d5a2aa90702c602 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Sun, 25 Oct 2026 17:56:12 -0500 Subject: [PATCH] Fix fetchcontent, add constant time compare for bytearray --- .gitea/workflows/tag.yaml | 10 +++++----- changelog.md | 2 +- cmake/findtf.cmake | 2 +- cmake/version.cmake | 2 +- src/runtime_methods/crypto.cpp | 12 ++++++++++++ 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index 067f33b..08e11b5 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -5,7 +5,7 @@ on: - 'v*' env: - TF_VERSION: 0.0.9 + TF_VERSION: 0.0.10 PACKAGE_AND_BREW: ${{ secrets.PACKAGE_AND_BREW }} VERSION: ${{ gitea.ref_name }} RESULT_IMAGE_NAME: tesses50/crosslang @@ -15,7 +15,7 @@ env: jobs: build-ppc: name: "🔨 Build for PowerPC" - runs-on: asrock + runs-on: msi-walmart container: image: git.tesses.org/tesses50/linux-ppc:latest steps: @@ -44,11 +44,11 @@ jobs: nfpmName: "386" debianName: "i386-linux-gnu" - container: "git.tesses.org/tesses50/linux-arm:latest" - puter: "fw13-ubuntu-latest" + puter: "msi-walmart" nfpmName: "arm7" debianName: "arm-linux-gnueabihf" - container: "git.tesses.org/tesses50/linux-arm64:latest" - puter: "msi-walmart" + puter: "asrock" nfpmName: "arm64" debianName: "aarch64-linux-gnu" - container: "git.tesses.org/tesses50/linux-riscv64:latest" @@ -71,7 +71,7 @@ jobs: update-tap: - runs-on: msi-walmart + runs-on: asrock container: git.tesses.org/tesses50/global-containers-mingw:latest steps: - uses: actions/checkout@v4 diff --git a/changelog.md b/changelog.md index 33e8a6d..3c0de70 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,7 @@ # Changelog ## 0.0.12 -Fix fetchcontent, +Fix fetchcontent, add constant time compare for bytearray ## 0.0.11 Add htmlparser, conditional variables, make alloc_threshold overridable in prefs.json diff --git a/cmake/findtf.cmake b/cmake/findtf.cmake index b85f4ed..fecefa9 100644 --- a/cmake/findtf.cmake +++ b/cmake/findtf.cmake @@ -5,7 +5,7 @@ set(CROSSLANG_STATIC ${TESSESFRAMEWORK_STATIC} CACHE INTERNAL "For CrossLang" FO FetchContent_Declare( TessesFramework GIT_REPOSITORY https://git.tesses.org/tesses50/tessesframework.git - GIT_TAG e4ca34aa597c9b0955aa23c18c500048af697c92 + GIT_TAG d99001d6ebb957272f399dd371bf571c8c16f248 ) set(TESSESFRAMEWORK_ENABLE_EXAMPLES OFF) FetchContent_MakeAvailable(TessesFramework) diff --git a/cmake/version.cmake b/cmake/version.cmake index 37e26f4..a1c6150 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -1,3 +1,3 @@ set(CROSSLANG_MAJOR_VERSION 0) set(CROSSLANG_MINOR_VERSION 0) -set(CROSSLANG_PATCH_VERSION 11) +set(CROSSLANG_PATCH_VERSION 12) diff --git a/src/runtime_methods/crypto.cpp b/src/runtime_methods/crypto.cpp index da35641..3503276 100644 --- a/src/runtime_methods/crypto.cpp +++ b/src/runtime_methods/crypto.cpp @@ -100,6 +100,15 @@ static TObject Crypto_Base64Decode(GCList &ls, std::vector args) { } return nullptr; } +static TObject Crypto_ConstantEquals(GCList &ls, std::vector args) { + TByteArray *left; + TByteArray *right; + if (GetArgumentHeap(args, 0, left) && GetArgumentHeap(args, 1, right)) { + return Tesses::Framework::Crypto::ConstantEquals(left->data, + right->data); + } + return false; +} void TStd::RegisterCrypto(std::shared_ptr gc, TRootEnvironment *env) { env->permissions.canRegisterCrypto = true; @@ -110,6 +119,9 @@ void TStd::RegisterCrypto(std::shared_ptr gc, TRootEnvironment *env) { dict->DeclareFunction(gc, "PBKDF2", "Hash passwords with PBKDF2", {"pass", "salt", "itterations", "keylen", "shanum"}, Crypto_PBKDF2); + dict->DeclareFunction(gc, "ConstantEquals", + "Compare two byte arrays using constant time", + {"array1", "array2"}, Crypto_ConstantEquals); dict->DeclareFunction(gc, "RandomBytes", "Create bytearray but with random bytes in it " "instead of zeros (this uses mbedtls by the way)",