Skip to content

refactor: remove occ integrity:sign-app / integrity:sign-core commands - #41712

Merged
DeepDiver1975 merged 3 commits into
masterfrom
feature/remove-occ-signing-commands
Jul 22, 2026
Merged

refactor: remove occ integrity:sign-app / integrity:sign-core commands#41712
DeepDiver1975 merged 3 commits into
masterfrom
feature/remove-occ-signing-commands

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Description

Removes the occ integrity:sign-app and integrity:sign-core console commands and all signing-only code from the integrity subsystem:

  • Deleted core/Command/Integrity/SignApp.php and SignCore.php and unregistered them in core/register_command.php (the CheckApp/CheckCore verification commands stay).
  • Removed the signing-only methods from Checker (createSignatureData(), writeAppSignature(), writeCoreSignature()), the now-unused phpseclib3 RSA/PrivateKey/X509 imports, and rewrote the class docblock as verification-only. The shared generateHashes()/getFolderIterator() helpers remain (used by verify()).
  • Deleted the signing command tests and the testWrite* methods from CheckerTest, plus the now-orphaned signing key/cert fixtures (SomeApp.{key,crt}, core.{key,crt}).

Verification is untouchedintegrity:check-app / integrity:check-core and all Checker::verify* code (which delegates to the Verifier subsystem) remain fully functional.

Related Issue

  • Fixes

Motivation and Context

Code signing is a release/CI concern, not an operator action to perform against a running instance. The Checker::write*Signature() API was effectively dead weight inside the security-sensitive integrity subsystem; removing it shrinks the attack/maintenance surface while leaving integrity verification intact.

How Has This Been Tested?

  • test environment: PHP 8.3, PHPUnit 9.6, sqlite
  • test case 1: tests/lib/IntegrityCheck/CheckerTest.php — 30/30 pass
  • test case 2: full tests/lib/IntegrityCheck/ suite — 191/191 pass
  • test case 3: occ list shows only integrity:check-app / integrity:check-core; occ integrity:sign-core → "Command not defined"; occ integrity:check-core runs clean (exit 0)
  • test case 4: git grep for writeAppSignature|writeCoreSignature|createSignatureData|integrity:sign|SignApp|SignCore → no dangling references

Types of changes

  • Breaking change (removes the integrity:sign-app / integrity:sign-core occ commands)
  • Technical debt

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

🤖 Generated with Claude Code

Code signing is a release/CI concern, not an operator action against a
running instance, and the Checker::write*Signature() API was dead weight
in the security-sensitive integrity subsystem. Remove the two signing
commands, their tests, the signing-only Checker methods
(createSignatureData/writeAppSignature/writeCoreSignature), the unused
phpseclib RSA/X509 imports, and the now-orphaned signing key/cert
fixtures.

Verification is untouched: integrity:check-app / integrity:check-core and
all Checker::verify* code (which delegates to the Verifier subsystem)
remain fully functional. The shared generateHashes()/getFolderIterator()
helpers stay.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 requested a review from a team as a code owner July 22, 2026 07:25
@update-docs

This comment was marked as resolved.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Comment thread lib/private/IntegrityCheck/Checker.php Outdated
Comment on lines +51 to +52
* applications. For example the author of the application "calendar" would only
* receive a certificate only valid for this application.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* applications. For example the author of the application "calendar" would only
* receive a certificate only valid for this application.
* applications. For example, the author of the application "calendar" would only
* receive a certificate that is valid for this application.

The word "only" was repeated (that was already in the original text).
Not sure if it is worth bothering to adjust the grammar of this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1c68ffd — applied the suggestion: dropped the duplicated "only" and added the comma after "For example".

Addresses review feedback on #41712.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 merged commit cc632e5 into master Jul 22, 2026
29 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feature/remove-occ-signing-commands branch July 22, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants