~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to src/lib/tls/sessions_sqlite3/tls_session_manager_sqlite.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* SQLite3 TLS Session Manager
 
3
* (C) 2012 Jack Lloyd
 
4
*
 
5
* Botan is released under the Simplified BSD License (see license.txt)
 
6
*/
 
7
 
 
8
#ifndef BOTAN_TLS_SQLITE3_SESSION_MANAGER_H_
 
9
#define BOTAN_TLS_SQLITE3_SESSION_MANAGER_H_
 
10
 
 
11
#include <botan/tls_session_manager_sql.h>
 
12
 
 
13
namespace Botan {
 
14
 
 
15
class RandomNumberGenerator;
 
16
 
 
17
namespace TLS {
 
18
 
 
19
/**
 
20
* An implementation of Session_Manager that saves values in a SQLite3
 
21
* database file, with the session data encrypted using a passphrase.
 
22
*
 
23
* @warning For clients, the hostnames associated with the saved
 
24
* sessions are stored in the database in plaintext. This may be a
 
25
* serious privacy risk in some situations.
 
26
*/
 
27
class BOTAN_PUBLIC_API(2,0)
 
28
Session_Manager_SQLite final : public Session_Manager_SQL
 
29
   {
 
30
   public:
 
31
      /**
 
32
      * @param passphrase used to encrypt the session data
 
33
      * @param rng a random number generator
 
34
      * @param db_filename filename of the SQLite database file.
 
35
               The table names tls_sessions and tls_sessions_metadata
 
36
               will be used
 
37
      * @param max_sessions a hint on the maximum number of sessions
 
38
      *        to keep in memory at any one time. (If zero, don't cap)
 
39
      * @param session_lifetime sessions are expired after this many
 
40
      *        seconds have elapsed from initial handshake.
 
41
      */
 
42
      Session_Manager_SQLite(const std::string& passphrase,
 
43
                             RandomNumberGenerator& rng,
 
44
                             const std::string& db_filename,
 
45
                             size_t max_sessions = 1000,
 
46
                             std::chrono::seconds session_lifetime = std::chrono::seconds(7200));
 
47
};
 
48
 
 
49
}
 
50
 
 
51
}
 
52
 
 
53
#endif