tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

IndexedDBCipherKeyManager.h (1458B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef DOM_INDEXEDDB_INDEXEDDBCIPHERKEYMANAGER_H_
      8 #define DOM_INDEXEDDB_INDEXEDDBCIPHERKEYMANAGER_H_
      9 
     10 #include "mozilla/dom/quota/CipherKeyManager.h"
     11 #include "mozilla/dom/quota/IPCStreamCipherStrategy.h"
     12 
     13 namespace mozilla::dom {
     14 
     15 // IndexedDBCipherKeyManager is used by IndexedDB operations to store/retrieve
     16 // keys in private browsing mode. All data in IndexedDB must be encrypted
     17 // using a cipher key and unique IV (Initialization Vector). While there's a
     18 // separate cipher key for every blob file; the SQLite database gets encrypted
     19 // using the commmon database key. All keys pertaining to a single IndexedDB
     20 // database get stored together using quota::CipherKeyManager. So, the hashmap
     21 // can be used to look up the common database key and blob keys using "default"
     22 // and blob file ids respectively.
     23 
     24 using IndexedDBCipherStrategy = mozilla::dom::quota::IPCStreamCipherStrategy;
     25 using IndexedDBCipherKeyManager =
     26    mozilla::dom::quota::CipherKeyManager<IndexedDBCipherStrategy>;
     27 using CipherKey = IndexedDBCipherStrategy::KeyType;
     28 
     29 }  // namespace mozilla::dom
     30 
     31 #endif  // DOM_INDEXEDDB_INDEXEDDBCIPHERKEYMANAGER_H_