Skip to content

Commit

Permalink
Merge pull request #834 from catalyst/issue832-non-breaking
Browse files Browse the repository at this point in the history
[#832] fix the issue when private key was never used
  • Loading branch information
keevan authored Aug 31, 2023
2 parents 4c83e2e + 3079937 commit 955da56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/local/step/sftp_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,11 @@ private function load_key() {
// Because variables use redacted values by default, we evaluate the secret explicitly.
$password = $this->get_variables()->evaluate($this->stepdef->config->password);

$config = $this->stepdef->config;
// Use key authorisation if privkeyfile is set.
if (!empty($config->privkeyfile)) {
$privkeycontents = file_get_contents($this->resolve_path($config->privkeyfile));
$privkeypassphrase = $config->password ?: false;
$privkeypassphrase = $password ?: false;
return PublicKeyLoader::load($privkeycontents, $privkeypassphrase);
}

Expand Down

0 comments on commit 955da56

Please sign in to comment.