Skip to content

Commit 971f122

Browse files
fix: validate engine name in migration to prevent installation failures
During app installation, the migration Version13000Date20251031165700 was attempting to generate a CA identifier with an invalid or 'none' engine name, causing InvalidArgumentException. This fix adds validation to ensure only valid engine names ('openssl' or 'cfssl') are used when generating the CA identifier. Invalid values are now safely ignored. Fixes installation error: 'Database error when running migration 13000Date20251031165700 for app libresign - Invalid engine name: none' Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 559002c commit 971f122

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Migration/Version13000Date20251031165700.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ private function migrateToNewestConfigFormat(): void {
138138
$originalCaId = $this->appConfig->getValueString(Application::APP_ID, 'ca_id');
139139
if (empty($originalCaId)) {
140140
$engineName = $this->appConfig->getValueString(Application::APP_ID, 'certificate_engine');
141-
if ($engineName) {
141+
$validEngines = ['openssl', 'cfssl'];
142+
if (!empty($engineName) && in_array($engineName, $validEngines, true)) {
142143
$originalCaId = $this->caIdentifierService->generateCaId($engineName);
143144
}
144145
}

0 commit comments

Comments
 (0)