"Fossies" - the Fresh Open Source Software Archive

Member "filezilla-3.44.2/src/interface/loginmanager.h" (13 Aug 2019, 1574 Bytes) of package /linux/misc/FileZilla_3.44.2_src.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "loginmanager.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.44.1_vs_3.44.2.

    1 #ifndef FILEZILLA_INTERFACE_LOGINMANAGER_HEADER
    2 #define FILEZILLA_INTERFACE_LOGINMANAGER_HEADER
    3 
    4 #include "serverdata.h"
    5 
    6 #include <list>
    7 
    8 // The purpose of this class is to manage some aspects of the login
    9 // behaviour. These are:
   10 // - Password dialog for servers with ASK or INTERACTIVE logontype
   11 // - Storage of passwords for ASK servers for duration of current session
   12 
   13 class CLoginManager
   14 {
   15 public:
   16     static CLoginManager& Get() { return m_theLoginManager; }
   17 
   18     bool GetPassword(Site & site, bool silent);
   19     bool GetPassword(Site & site, bool silent, std::wstring const& challenge, bool canRemember);
   20 
   21     void CachedPasswordFailed(CServer const& server, std::wstring const& challenge = std::wstring());
   22 
   23     void RememberPassword(Site & site, std::wstring const& challenge = std::wstring());
   24 
   25     bool AskDecryptor(fz::public_key const& pub, bool allowForgotten, bool allowCancel);
   26     fz::private_key GetDecryptor(fz::public_key const& pub);
   27     void Remember(fz::private_key const& key);
   28 
   29 protected:
   30     bool DisplayDialogForEncrypted(Site & site);
   31     bool DisplayDialog(Site & site, std::wstring const& challenge, bool canRemember);
   32 
   33     static CLoginManager m_theLoginManager;
   34 
   35     // Session password cache for Ask-type servers
   36     struct t_passwordcache
   37     {
   38         std::wstring host;
   39         unsigned int port{};
   40         std::wstring user;
   41         std::wstring password;
   42         std::wstring challenge;
   43     };
   44 
   45     std::list<t_passwordcache>::iterator FindItem(CServer const& server, std::wstring const& challenge);
   46 
   47     std::list<t_passwordcache> m_passwordCache;
   48 
   49     std::map<fz::public_key, fz::private_key> decryptors_;
   50 };
   51 
   52 #endif