Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2f64909
'print_hex_data', 'sprint_hex_data' and 'print_raw_data' refactoring
AenBleidd Jul 5, 2026
16a5670
Refactor 'scan_raw_data', 'scan_hex_data', and 'sscan_hex_data'
AenBleidd Jul 6, 2026
6367584
Refactor 'print_key_hex'
AenBleidd Jul 6, 2026
3a4d446
Refactor 'scan_key_hex' and 'sscan_key_hex'
AenBleidd Jul 8, 2026
328f451
Make 'sscan_key_hex' static
AenBleidd Jul 8, 2026
ca7cb4a
Refactor 'private_to_openssl' and 'public_to_openssl' functions
AenBleidd Jul 14, 2026
507affe
Refactoring of 'sign_file', 'sign_block', and 'generate_signature' fu…
AenBleidd Jul 16, 2026
6eed89d
Refactor 'check_file_signature' and 'check_string_signature' functions
AenBleidd Jul 18, 2026
30126f0
Refactor 'openssl_to_private' and 'openssl_to_keys' functions
AenBleidd Jul 19, 2026
cc05eec
Refactor 'scan_key_hex' function
AenBleidd Jul 22, 2026
4712151
Refactor 'print_key_hex' function
AenBleidd Jul 22, 2026
6a99a21
Fix certificate verification. Add module test
AenBleidd Aug 7, 2026
530280c
Remove unstable tests
AenBleidd Aug 7, 2026
2117d4b
Add unit tests for 'check_validity_of_cert' and 'check_validity' func…
AenBleidd Aug 8, 2026
7053372
Cover 'cert_verify_file' function with unit tests
AenBleidd Aug 8, 2026
a029ec7
Refactor 'check_validity_of_cert' and 'check_validity' functions
AenBleidd Aug 8, 2026
076e635
Remove 'check_validity_of_cert' from exported functions, refactor uni…
AenBleidd Aug 8, 2026
527e284
Refactor 'check_validity' function
AenBleidd Aug 8, 2026
64ab2ea
Refactor 'cert_verify_file' function
AenBleidd Aug 8, 2026
9184b19
Refactor crypt_prog
AenBleidd Aug 8, 2026
5e3aa31
Remove unused headers
AenBleidd Aug 8, 2026
882f736
Refactor 'sign_executable' application
AenBleidd Aug 8, 2026
ec4c8f6
Fix unit tests on Windows
AenBleidd Aug 9, 2026
0283d71
Fix formatting
AenBleidd Aug 9, 2026
c15cfe7
Further crypt.cpp refactoring. Fix errors found by GitHub Copilot
AenBleidd Aug 9, 2026
59c7a83
Simplify the code, fix failing tests on Windows
AenBleidd Aug 9, 2026
133b533
Increase minimal required OpenSSL version to 3.0
AenBleidd Aug 11, 2026
e439429
Fix android build
AenBleidd Aug 11, 2026
6b74ce4
Fix android build
AenBleidd Aug 11, 2026
39bc701
Fix typos
AenBleidd Aug 16, 2026
9eee127
Fix findings by AI
AenBleidd Aug 17, 2026
7fd42eb
Fix AI findings
AenBleidd Aug 17, 2026
c613e64
Fix one more AI finding
AenBleidd Aug 17, 2026
024b9a2
Use 'int' as a status return value
AenBleidd Aug 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
- name: Install dependencies for unit testing
if: success() && matrix.type == 'unit-test'
run: |
sudo apt-get install -y libgtest-dev
sudo apt-get install -y libgtest-dev python3-openssl

- name: Install dependencies for integration testing
if: success() && matrix.type == 'integration-test'
Expand Down Expand Up @@ -458,7 +458,9 @@ jobs:

- name: Execute automation tests
if: success() && matrix.type == 'unit-test'
run: python ./tests/crypt_prog_tests.py ./lib/crypt_prog
run: |
python ./tests/crypt_prog_tests.py ./lib/crypt_prog
python ./tests/sign_executable_tests.py ./tools/sign_executable ./lib/crypt_prog

- name: Execute integration-test
if: success() && matrix.type == 'integration-test'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ jobs:
if: success() && matrix.platform == 'x64' && matrix.configuration == 'Release'
working-directory: win_build\Build\${{matrix.platform}}\${{matrix.configuration}}
run: |
python -m pip install pyopenssl
python -m pip install cryptography
${{github.workspace}}\temp\OpenCppCoverage\OpenCppCoverage.exe --cover_children --optimized_build --modules ${{github.workspace}} --sources ${{github.workspace}} --input_coverage=gtest.cov --export_type=cobertura:cobertura.xml -- python ${{github.workspace}}\tests\crypt_prog_tests.py ${{github.workspace}}\win_build\Build\x64\${{matrix.configuration}}\crypt_prog.exe

- name: Verify MSI file
Expand Down
8 changes: 4 additions & 4 deletions client/acct_mgr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2017 University of California
// https://boinc.berkeley.edu
// Copyright (C) 2026 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -765,8 +765,8 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
continue;
}

retval = check_string_signature2(
acct.url.c_str(), acct.url_signature, ami.signing_key, verified
std::tie(retval, verified) = check_string_signature(
acct.url, acct.url_signature, ami.signing_key
);
if (retval || !verified) {
msg_printf(NULL, MSG_INTERNAL_ERROR,
Expand Down
11 changes: 5 additions & 6 deletions client/async_file.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2012 University of California
// https://boinc.berkeley.edu
// Copyright (C) 2026 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -229,10 +229,9 @@ void ASYNC_VERIFY::finish() {
}
md5_buf[32] = 0;
if (fip->signature_required) {
bool verified;
retval = check_file_signature2(md5_buf, fip->file_signature,
fip->project->code_sign_key, verified
);
bool verified = false;
std::tie(retval, verified) = check_file_signature(md5_buf,
fip->file_signature, fip->project->code_sign_key);
if (retval) {
error(retval);
return;
Expand Down
9 changes: 4 additions & 5 deletions client/cs_files.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2025 University of California
// Copyright (C) 2026 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -123,7 +123,7 @@ bool FILE_INFO::verify_file_certs() {
if (!is_dir(CERTIFICATE_DIRECTORY)) return false;
DIRREF dir = dir_open(CERTIFICATE_DIRECTORY);
while (!dir_scan(file, dir, sizeof(file))) {
if (cert_verify_file(cert_sigs, file, CERTIFICATE_DIRECTORY)) {
if (!cert_verify_file(cert_sigs, file, CERTIFICATE_DIRECTORY)) {
msg_printf(project, MSG_INFO,
"Signature verified using certificate %s", file
);
Expand Down Expand Up @@ -302,9 +302,8 @@ int FILE_INFO::verify_file(
return retval;
}
}
retval = check_file_signature2(
cksum, file_signature, project->code_sign_key, verified
);
std::tie(retval, verified) = check_file_signature(
cksum, file_signature, project->code_sign_key);
if (retval) {
msg_printf(project, MSG_INTERNAL_ERROR,
"Signature verification error for %s",
Expand Down
6 changes: 3 additions & 3 deletions client/cs_scheduler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// https://boinc.berkeley.edu
// Copyright (C) 2025 University of California
// Copyright (C) 2026 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -826,9 +826,9 @@ int CLIENT_STATE::handle_scheduler_reply(
safe_strcpy(project->code_sign_key, sr.code_sign_key);
} else {
if (sr.code_sign_key_signature) {
retval = check_string_signature2(
std::tie(retval, signature_valid) = check_string_signature(
sr.code_sign_key, sr.code_sign_key_signature,
project->code_sign_key, signature_valid
project->code_sign_key
);
if (!retval && signature_valid) {
safe_strcpy(project->code_sign_key, sr.code_sign_key);
Expand Down
Loading
Loading