Skip to content

Commit 1b4682b

Browse files
H0zenclaude
authored andcommitted
Retire the build policy that guarded a provider there no longer is
CI caught this and I did not, because I ran the test binary directly instead of ctest -- and build_policy is a ctest, not a case inside mangos_tests. The suite reported 191 passing while the twelfth test was never asked. The rule required mangosd to leave through `return 1` when the OpenSSL provider manager failed to initialise. That is a good rule for the reason it gives: returning 0 tells a supervisor the process exited cleanly, so nothing restarts it. It has simply run out of subject. RC4 was the only algorithm this tree ever fetched from the legacy provider, it is implemented here now, and mangosd performs no fallible crypto init at start-up at all -- SHA-1, SHA-256 and the bignum work come from the default provider, which is inside libcrypto and cannot be absent while libcrypto is present. Deleted rather than loosened, and replaced by its own inverse: mangosd must not mention OpenSSLProvider again. A policy that matches nothing is worse than no policy, because it passes for the right reason today and for the wrong reason the moment somebody reintroduces a start-up check and forgets its exit code. This way, whoever brings a fallible crypto init back is told to bring the exit rule with it. 12 of 12 ctest cases pass, which is how this should have been checked the first time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent bf3ed34 commit 1b4682b

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

src/tests/CheckBuildPolicy.cmake

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,24 @@ foreach(REQUIRED_TEXT
3131
endif()
3232
endforeach()
3333

34-
# The provider manager is a Meyers singleton in mangos_two and an RAII local in
35-
# the other three cores. Either spelling is accepted; what is not negotiable is
36-
# that a failed crypto init leaves through `return 1`. Returning 0 tells a
37-
# supervisor the process exited cleanly, so nothing restarts it.
38-
string(REGEX MATCH
39-
"if \\(![A-Za-z_:.()]*IsInitialized\\(\\)\\)[^\n]*[\r\n]+[^\n]*\\{[\r\n]+[^\n]*Log::WaitBeforeContinueIfNeed\\(\\);[\r\n]+[^\n]*return 1;"
40-
PROVIDER_FAILURE "${MANGOSD_SOURCE}")
41-
if(NOT PROVIDER_FAILURE)
42-
message(FATAL_ERROR "mangosd provider failure must return 1")
34+
# The provider clause is gone, with the provider it guarded.
35+
#
36+
# It required mangosd to leave through `return 1` when the OpenSSL provider manager
37+
# failed to initialise -- a good rule, because returning 0 tells a supervisor the
38+
# process exited cleanly and nothing restarts it. There is no longer anything for it to
39+
# describe: RC4 was the only algorithm this tree fetched from the legacy provider, it is
40+
# implemented in the tree now, and mangosd performs no fallible crypto init at start-up
41+
# at all. SHA-1, SHA-256 and the bignum work come from the default provider, which is
42+
# inside libcrypto and cannot be absent while libcrypto is present.
43+
#
44+
# Deleted rather than loosened. A policy that matches nothing is worse than no policy:
45+
# it passes for the right reason today and for the wrong reason the moment someone
46+
# reintroduces a start-up check and forgets its exit code.
47+
string(FIND "${MANGOSD_SOURCE}" "OpenSSLProvider" POSITION)
48+
if(NOT POSITION EQUAL -1)
49+
message(FATAL_ERROR
50+
"mangosd reaches for OpenSSLProvider again; if a fallible crypto init is back, so "
51+
"must be the rule that it exits with 1")
4352
endif()
4453

4554
string(FIND "${SRC_CMAKE}" "Upstream realmd passes the *file*" POSITION)

0 commit comments

Comments
 (0)