diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 538a4e9..73a07a3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -71,7 +71,7 @@ jobs: if: ${{ matrix.use_alpine }} uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8 with: - options: MUSL_STATIC=ON + options: MUSL_STATIC=ON CMAKE_POLICY_VERSION_MINIMUM=3.5 run-build: true shell: alpine-target.sh {0} @@ -79,7 +79,7 @@ jobs: if: ${{ !matrix.use_alpine }} uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8 with: - options: MUSL_STATIC=ON + options: MUSL_STATIC=ON CMAKE_POLICY_VERSION_MINIMUM=3.5 run-build: true - name: Test UMSKT (Alpine) @@ -116,7 +116,7 @@ jobs: if: ${{ matrix.use_alpine }} uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8 with: - options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=OFF + options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=OFF CMAKE_POLICY_VERSION_MINIMUM=3.5 run-build: true shell: alpine-target.sh {0} @@ -124,7 +124,7 @@ jobs: if: ${{ !matrix.use_alpine }} uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8 with: - options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=OFF + options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=OFF CMAKE_POLICY_VERSION_MINIMUM=3.5 run-build: true - name: Test static internal deps UMSKT (Alpine) @@ -150,7 +150,7 @@ jobs: if: ${{ matrix.use_alpine }} uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8 with: - options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=ON + options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=ON CMAKE_POLICY_VERSION_MINIMUM=3.5 run-build: true shell: alpine-target.sh {0} @@ -158,7 +158,7 @@ jobs: if: ${{ !matrix.use_alpine }} uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8 with: - options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=ON + options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=ON CMAKE_POLICY_VERSION_MINIMUM=3.5 run-build: true - name: Test shared deps UMSKT (Alpine) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2e47cba..80b87f4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -73,7 +73,8 @@ jobs: -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR \ -DOPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \ -DOPENSSL_USE_STATIC_LIBS=TRUE \ - -DBUILD_SHARED_LIBS=OFF + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 make - name: Move files to correct directory diff --git a/.github/workflows/windows-arm.yml b/.github/workflows/windows-arm.yml index 939f11f..a0399c5 100644 --- a/.github/workflows/windows-arm.yml +++ b/.github/workflows/windows-arm.yml @@ -33,22 +33,19 @@ jobs: fail-fast: false matrix: include: - - arch: arm32 - arch_compilename: amd64_arm - vcpkg_arch: arm-windows-static - cmake_arch: ARM - sdk_version: '10.0.17763.0' + # - arch: arm32 + # arch_compilename: amd64_arm + # vcpkg_arch: arm-windows-static + # cmake_arch: ARM - arch: arm64 arch_compilename: amd64_arm64 vcpkg_arch: arm64-windows-static cmake_arch: ARM64 - sdk_version: '10.0.17763.0' steps: - name: Setup MSVC for ${{ matrix.arch }} uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch_compilename }} - sdk: ${{ matrix.sdk_version }} - name: Checkout Source Tree uses: actions/checkout@v4 diff --git a/src/cli.cpp b/src/cli.cpp index 53eaa3b..c1ed25b 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -432,8 +432,8 @@ int CLI::BINK1998Generate() { // using user-provided serial if (this->options.serialSet) { - // just in case, make sure it's less than 999999 - int serialRnd = (this->options.serial % 999999); + // just in case, make sure it's less than 1000000 + int serialRnd = (this->options.serial % 1000000); nRaw += serialRnd; } else { // generate a random number to use as a serial @@ -444,7 +444,7 @@ int CLI::BINK1998Generate() { char *cRaw = BN_bn2dec(bnrand); sscanf(cRaw, "%d", &oRaw); - nRaw += (oRaw % 999999); // ensure our serial is less than 999999 + nRaw += (oRaw % 1000000); // ensure our serial is less than 1000000 BN_free(bnrand); } diff --git a/src/libumskt/pidgen3/util.cpp b/src/libumskt/pidgen3/util.cpp index 2255af5..2a878e5 100644 --- a/src/libumskt/pidgen3/util.cpp +++ b/src/libumskt/pidgen3/util.cpp @@ -115,13 +115,14 @@ int PIDGEN3::BN_bn2lebin(const BIGNUM *a, unsigned char *to, int tolen) { if (a == nullptr || to == nullptr) return 0; - int len = BN_bn2bin(a, to); + int len = BN_num_bytes(a); if (len > tolen) return -1; - // Choke point inside BN_bn2lebinpad: OpenSSL uses len instead of tolen. + memset(to, 0, tolen); + BN_bn2bin(a, to + tolen - len); + endian(to, tolen); - return len; }