1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Support ecdsa-sha2-nistp256 SSH keys

Summary:
See discussion in <https://github.com/facebook/phabricator/issues/430>.

(If we end up with more than like 5 of these we should probably make this a warning or something instead, the only goal is to prevent user error.)

Test Plan:
{F79196}

{F79197}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran, enko

Differential Revision: https://secure.phabricator.com/D7522
This commit is contained in:
epriestley 2013-11-07 11:33:46 -08:00
parent 038f5323c0
commit 0e65740c2d

View file

@ -81,9 +81,17 @@ final class PhabricatorSettingsPanelSSHKeys
if (!$errors) {
list($type, $body, $comment) = $parts;
if (!preg_match('/^ssh-dsa|ssh-rsa$/', $type)) {
$recognized_keys = array(
'ssh-dsa',
'ssh-rsa',
'ecdsa-sha2-nistp256',
);
if (!in_array($type, $recognized_keys)) {
$e_key = pht('Invalid');
$errors[] = pht('Public key should be "ssh-dsa" or "ssh-rsa".');
$type_list = implode(', ', $recognized_keys);
$errors[] = pht('Public key should be one of: %s', $type_list);
} else {
$key->setKeyType($type);
$key->setKeyBody($body);