aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
blob: 04b2f3e9e563c8f253d1402f171721bb914cfe0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*************************************************
* User Interface Source File                     *
* (C) 1999-2007 The Botan Project                *
*************************************************/

#include <botan/ui.h>
#include <botan/libstate.h>

namespace Botan {

/*************************************************
* Get a passphrase from the user                 *
*************************************************/
std::string User_Interface::get_passphrase(const std::string&,
                                           const std::string&,
                                           UI_Result& action) const
   {
   action = OK;

   if(!first_try)
      action = CANCEL_ACTION;

   return preset_passphrase;
   }

/*************************************************
* User_Interface Constructor                     *
*************************************************/
User_Interface::User_Interface(const std::string& preset) :
   preset_passphrase(preset)
   {
   first_try = true;
   }

}