Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR disables SHA1-based MAC algorithms (hmac-sha1, [email protected], hmac-sha1-96) by default in libssh2, while preserving an opt-in build-time escape hatch (LIBSSH2_HMAC_SHA1_ENABLE). It updates the test harness to skip SHA1 MAC test cases when those algorithms are compiled out, and ensures CI still exercises these legacy algorithms in the “legacy-options” matrix.
Changes:
- Compile out SHA1-based MAC method implementations and registration unless
LIBSSH2_HMAC_SHA1_ENABLEis defined. - Skip SHA1 MAC tests by default when SHA1 MACs are disabled at build time.
- Document the default-disable + opt-in macro in RELEASE-NOTES and enable it in CI legacy-options jobs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/session_fixture.c |
Skips SHA1 MAC-related tests when SHA1 MACs are not enabled at build time. |
src/mac.c |
Gates SHA1 MAC implementations and their registration behind LIBSSH2_HMAC_SHA1_ENABLE. |
RELEASE-NOTES |
Documents that SHA1 MACs are now disabled by default and can be re-enabled via macro. |
.github/workflows/ci.yml |
Ensures legacy CI configurations still test with SHA1 MACs enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Nice, the fuzzer is hanging after this change too. Same effect as seen here: #2199 |
… minutes
```
2026-07-28 23:29:54,441 - root - INFO - Starting fuzzing
Traceback (most recent call last):
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 106, in <module>
sys.exit(main())
^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 102, in main
return run_fuzzers_entrypoint()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 72, in run_fuzzers_entrypoint
result = run_fuzzers.run_fuzzers(config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers.py", line 316, in run_fuzzers
if not fuzz_target_runner.run_fuzz_targets():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers.py", line 131, in run_fuzz_targets
result = self.run_fuzz_target(target)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers.py", line 259, in run_fuzz_target
return fuzz_target_obj.fuzz()
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/fuzz_target.py", line 209, in fuzz
result = engine_impl.fuzz(self.target_path, options, artifacts_dir,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/bot/fuzzers/libFuzzer/engine.py", line 278, in fuzz
fuzz_result = runner.fuzz(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/bot/fuzzers/libfuzzer.py", line 401, in fuzz
return LibFuzzerCommon.fuzz(self, corpus_directories, fuzz_timeout,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/bot/fuzzers/libfuzzer.py", line 217, in fuzz
return self.run_and_wait(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/system/new_process.py", line 419, in run_and_wait
result = ProcessRunner.run_and_wait(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/system/new_process.py", line 403, in run_and_wait
result = wait_process(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/system/new_process.py", line 110, in wait_process
output = process.communicate(input_data)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/clusterfuzz/_internal/system/new_process.py", line 190, in communicate
stdout, stderr = self._popen.communicate(input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/subprocess.py", line 1201, in communicate
self.wait()
File "/usr/local/lib/python3.11/subprocess.py", line 1264, in wait
return self._wait(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/subprocess.py", line 2053, in _wait
(pid, sts) = self._try_wait(0)
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/subprocess.py", line 2011, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
```
https://github.com/libssh2/libssh2/actions/runs/30407183421
|
Work around oss-fuzz hang/timeout by keeping the insecure MACs enabled in that build. It's suspicious that it's now the second hang caused by touching the elements of algo |
…x fallouts They are `ssh-rsa` and `[email protected]`, and insecure due to their reliance on SHA1 hashes. Also: - hostkey: fix to accept all RSA hostkey methods in common `hostkey_method_ssh_rsa_init()`. - mbedtls: add missing RSA SHA1/SHA2 guards. - mbedtls: cleanup on error in `mbed_pub_priv_key()`. - os400qc3: add missing RSA SHA1/SHA2 guards. (untested) - wincng: add missing RSA SHA1/SHA2 guards. - crypto.h: add missing `#endif` comments. - GHA: move stray `-DLIBSSH2_DSA_ENABLE` to its place. Follow-up to b7ab0fa #1435 - tests: fix to guard RSA tests with `LIBSSH2_RSA`, replacing `LIBSSH2_RSA_SHA1` to keep test coverage. Keep using the latter for testing SHA1-based signatures in `test_auth_pubkey_ok_rsa_signed`. Follow-up to 3e14d67 #2444 Follow-up to 99f9353 #2443 Closes #2501
Also:
SHA1-based MACs enabled in the fuzzer build.
Ref: mac: disable SHA1-based MACs by default #2444 (comment)
Follow-up to 99f9353 #2443