summaryrefslogtreecommitdiffstats
path: root/tdeioslave/sftp/tdeio_sftp.h
Commit message (Collapse)AuthorAgeFilesLines
* tdeioslave/sftp: save/restore seqNr for multi-factor authAlexander Golubev2024-03-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the server is set up for multi-factor authentication we could be have to query several things from the user like password, a key passphrase, their mother's maiden name etc. It doesn't make a big difference during an initial connection, but it butchers the reconnection process: it can retrieve the answer of the user to the first question (e.g. their password), but it fails to retrieve the second one (e.g. the key passphrase). So the user would be forced to reenter the answer for the second question upon each reconnection. The reason for this is the passwdserver's desig (see DESIGN [1]): Each query for AuthInfo with the openPassDlg() has an secNr number associated with it. If it's smaller than the one of the one stored for the privious request, than the one from the cache will be returned automagically, if it's bigger the dialog will be prompted to the user. Each call to openPassDlg() advances s_seqNr to the last value reported by the passwdserver. So the first call will return the cached value and subsequent calls will actually display the dialog to the user (assuming authentication with the cached data failed). But in case of multi-factor auth we have to query user for several independent values. And we want to try to retrieve each one of those from the cache. So we have to get a bit hacky and manually manipulate the SlaveBase::s_seqNr value. [1]: https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs/src/branch/master/tdeio/kpasswdserver/DESIGN Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: imbue error messages with errors from libsshAlexander Golubev2024-03-041-0/+3
| | | | Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: pass correct username to openPassDlg()Alexander Golubev2024-03-041-1/+5
| | | | | | | | | | | | We should always pass to the openPassDlg() exactly the same username otherwise it may result in incorrect caching of passwords especially in case if the username is changed by the user. Also don't allow username change in case it was passed to setHost() (i.e. it was specified in the URL like e.g. sftp://username@host/). In such a case after changing it'd be impossible to properly cache it. Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: even bigger authentication overhaulAlexander Golubev2024-03-041-9/+40
| | | | | | | | | - Move authentication methods into separate functions so it would be easier to correctly handle error after those and select which should be called in which order. - A lot of minor improvements along the way Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: use realmValue to distinguish different promptsAlexander Golubev2024-03-041-1/+1
| | | | | | | | | | This will help kpasswdserver not to confuse different user's answers to different questions. Also avoid passing/returning TDE::AuthInfo for kb-interactive auth as it isn't really necessary when we don't manually caching passwords anymore. Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: avoid explicit password cachingAlexander Golubev2024-03-041-1/+2
| | | | | | | All password caching we need actually already autmagically done by openPassDlg(). Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: split off connection init to a dedicated functionAlexander Golubev2024-03-041-0/+3
| | | | Signed-off-by: Alexander Golubev <[email protected]>
* tdeioslave/sftp: overhaul publickey authAlexander Golubev2024-03-041-3/+16
| | | | | | | | | | | | | | | | Several enhancements to public key authentication and some other stuff: - Fix passphrase entry for encrypted keys (was either hanging up or segfaulting) - Use scope guard idiom for cleanup calls for more reliable cleanup in case of errors - Add normal prompt for public key's passphrase entry dialog - Correctly differentiate passphrase to password when cached (yes they are getting cached regardless of keepPassword, at least for some duration of time) - Centrilize AuthInfo initialization and some rejig of it kbd-interactive authentification Signed-off-by: Alexander Golubev <[email protected]>
* SFTP: compatibility with older libssh versionsMavridis Philippe2022-07-151-0/+18
| | | | | Signed-off-by: Mavridis Philippe <[email protected]> Signed-off-by: Slávek Banko <[email protected]>
* SFTP: Various fixes and improvementsMavridis Philippe2022-07-151-2/+6
| | | | | | | | | | | For details see PR #279. Portions of code borrowed from KDE5 SFTP ioslave: Source: https://invent.kde.org/network/kio-extras/-/blob/master/sftp/kio_sftp.cpp Licence: LGPLv2 or later Signed-off-by: Mavridis Philippe <[email protected]>
* Replaced old sftp ioslave with backported versionMavridis Philippe2022-07-151-105/+90
| | | | | | | | | Source: https://github.com/sandsmark/kde2-kio-sftp-kde4 Licence: GPLv2 or later This resolves issue #276. Signed-off-by: Mavridis Philippe <[email protected]>
* Additional k => tde renaming and fixesSlávek Banko2013-09-031-1/+1
|
* Rename kioslavesTimothy Pearson2013-01-271-0/+149