Page MenuHomePhabricator

D7522.id16967.diff
No OneTemporary

D7522.id16967.diff

Index: src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
===================================================================
--- src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
+++ src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
@@ -81,9 +81,17 @@
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);

File Metadata

Mime Type
text/plain
Expires
Oct 19 2024, 5:17 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715276
Default Alt Text
D7522.id16967.diff (983 B)

Event Timeline