Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: chrome/browser/managed_mode/managed_user_passphrase.h

Issue 11783008: Add a lock to the managed user settings page and require authentication for unlocking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Several fixes Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11
12 // This class can be used to derive a hash of a provided passphrase. When an
13 // empty salt is given as parameter to the constructor, a new salt is
14 // generated randomly, which can be accessed through the |GetSalt| method.
15 class ManagedUserPassphrase {
16 public:
17 explicit ManagedUserPassphrase(const std::string& salt);
18 ~ManagedUserPassphrase();
19
20 std::string GetSalt();
Bernhard Bauer 2013/01/08 17:43:14 Newlines before comments would be nice.
Adrian Kuegel 2013/01/09 12:10:05 Done.
21 // This function generates a hash from a passphrase, which should be provided
22 // as the first parameter. On return, the second parameter will contain the
23 // Base64-encoded hash of the password.
24 void GenerateHashFromPassphrase(const std::string& passphrase,
25 std::string* encoded_passphrase_hash);
Bernhard Bauer 2013/01/08 17:43:14 Align the parameter please.
Adrian Kuegel 2013/01/09 12:10:05 Done.
26
27 private:
28 void GetPassphraseHash(const std::string& passphrase,
29 std::string* passphrase_hash);
Bernhard Bauer 2013/01/08 17:43:14 Align please.
Adrian Kuegel 2013/01/09 12:10:05 Done.
30 void GenerateRandomSalt();
31
32 std::string salt_;
33
34 DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphrase);
35 };
36
37 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_PASSPHRASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698