bug fix by WindowsAddict (#177)

+ entropy fix for GitHub Actions
This commit is contained in:
TheTank20
2026-04-11 20:46:30 -04:00
committed by GitHub
parent bb030e6d0b
commit 0fdae6b053
5 changed files with 19 additions and 20 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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;
}