Skip to content

Commit

Permalink
Merge pull request #169 from lsnepomuceno/fix/path-locations-with-esc…
Browse files Browse the repository at this point in the history
…apeshellarg-function

fix(manage cert): fix pfx path and output file on shell args
  • Loading branch information
lsnepomuceno authored Nov 22, 2024
2 parents 9ad77cc + e661808 commit 344d717
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Sign/ManageCert.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ public function fromPfx(string $pfxPath, string $password, bool $usePathEnv = fa
}

$this->password = $password;
$shellArgPassword = escapeshellarg($password);
$output = a1TempDir(true, '.crt');
$shellPfxPath = escapeshellarg($pfxPath);
$shellOutput = escapeshellarg($output);
$shellArgPassword = escapeshellarg($password);
$legacyFlag = $this->isLegacy ? self::LEGACY_FLAG : '';
$openSslCommand = "openssl pkcs12 -in {$pfxPath} -out {$output} -nodes -password pass:{$shellArgPassword} {$legacyFlag}";
$openSslCommand = "openssl pkcs12 -in {$shellPfxPath} -out {$shellOutput} -nodes -password pass:{$shellArgPassword} {$legacyFlag}";

runCliCommandProcesses($openSslCommand, $usePathEnv);

Expand Down

0 comments on commit 344d717

Please sign in to comment.