From 34940b08d7328a0baa51256781f5bb802a966217 Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 22 Mar 2012 19:35:37 +0000 Subject: Add encryption for the SQLite sessions database --- src/tls/tls_session.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/tls/tls_session.h') diff --git a/src/tls/tls_session.h b/src/tls/tls_session.h index ab11154c9..0c57201a4 100644 --- a/src/tls/tls_session.h +++ b/src/tls/tls_session.h @@ -76,16 +76,30 @@ class BOTAN_DLL Session * Encrypt a session (useful for serialization or session tickets) */ MemoryVector encrypt(const SymmetricKey& key, - RandomNumberGenerator& rng); + RandomNumberGenerator& rng) const; + /** * Decrypt a session created by encrypt * @param ctext the ciphertext returned by encrypt + * @param ctext_size the size of ctext in bytes * @param key the same key used by the encrypting side */ - static Session decrypt(const MemoryRegion& ctext, + static Session decrypt(const byte ctext[], + size_t ctext_size, const SymmetricKey& key); + /** + * Decrypt a session created by encrypt + * @param ctext the ciphertext returned by encrypt + * @param key the same key used by the encrypting side + */ + static inline Session decrypt(const MemoryRegion& ctext, + const SymmetricKey& key) + { + return Session::decrypt(&ctext[0], ctext.size(), key); + } + /** * Encode this session data for storage * @warning if the master secret is compromised so is the -- cgit v1.2.3