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:
parent
038f5323c0
commit
0e65740c2d
1 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue