Skip to content
Permalink
Browse files

Fixes for SSH key generation.

Closes #514, fixes #512
  • Loading branch information...
tvbeek authored and Dan Cryer committed Jul 21, 2014
1 parent 98cc4af commit 17980b623b1dda61a828fbc961e6dbc429c1ad80
Showing with 5 additions and 7 deletions.
  1. +5 −7 PHPCI/Helper/SshKey.php
@@ -29,23 +29,21 @@ public function generate()
mkdir($tempPath);
}
$return = array();
$return = array('private_key' => '', 'public_key' => '');
if ($this->canGenerateKeys()) {
shell_exec('ssh-keygen -q -t rsa -b 2048 -f '.$keyFile.' -N "" -C "deploy@phpci"');
$pub = file_get_contents($keyFile . '.pub');
$prv = file_get_contents($keyFile);
if (empty($pub)) {
$pub = '';
if (!empty($pub)) {
$return['public_key'] = $pub;
}
if (empty($prv)) {
$prv = '';
if (!empty($prv)) {
$return['private_key'] = $prv;
}
$return = array('private_key' => $prv, 'public_key' => $pub);
}
return $return;

0 comments on commit 17980b6

Please sign in to comment.
You can’t perform that action at this time.