1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-03 10:28:23 +01:00
phorge-phorge/src/applications/auth/exception
epriestley 2adc36ba0b Correctly identify more SSH private key problems as "formatting" or "passphrase" related
Summary:
Ref T13454. Fixes T13006. When a user provide us with an SSH private key and (possibly) a passphrase:

  # Try to verify that they're correct by extracting the public key.
  # If that fails, try to figure out why it didn't work.

Our success in step (2) will vary depending on what the problem is, and we may end up falling through to a very generic error, but the outcome should generally be better than the old approach.

Previously, we had a very unsophisticated test for the text "ENCRYPTED" in the key body and questionable handling of the results: for example, providing a passphrase when a key did not require one did not raise an error.

Test Plan:
Created and edited credentials with:

  - Valid, passphrase-free keys.
  - Valid, passphrased keys with the right passphrase.
  - Valid, passphrase-free keys with a passphrase ("surplus passphrase" error).
  - Valid, passphrased keys with no passphrase ("missing passphrase" error).
  - Valid, passphrased keys with an invalid passphrase ("invalid passphrase" error).
  - Invalid keys ("format" error).

The precision of these errors will vary depending on how helpful "ssh-keygen" is.

Maniphest Tasks: T13454, T13006

Differential Revision: https://secure.phabricator.com/D20905
2019-11-13 10:22:00 -08:00
..
privatekey Correctly identify more SSH private key problems as "formatting" or "passphrase" related 2019-11-13 10:22:00 -08:00
PhabricatorAuthHighSecurityRequiredException.php Improve UI messaging around "one-shot" vs "session upgrade" MFA 2018-12-28 00:11:36 -08:00
PhabricatorAuthInviteAccountException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhabricatorAuthInviteDialogException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhabricatorAuthInviteException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhabricatorAuthInviteInvalidException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhabricatorAuthInviteLoginException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhabricatorAuthInviteRegisteredException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhabricatorAuthInviteVerifyException.php Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
PhutilAuthConfigurationException.php Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00
PhutilAuthCredentialException.php Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00
PhutilAuthException.php Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00
PhutilAuthUserAbortedException.php Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00