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

Side by Side Diff: pkcs11_init.cc

Issue 6823012: cryptohome: Add stub functions to query PKCS11 set up status (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cryptohome.git@master
Patch Set: Created 9 years, 8 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) 2009-2010 The Chromium OS Authors. All rights reserved.
Greg Spencer (Chromium) 2011/04/08 20:21:45 Should just be "2011"
kmixter1 2011/04/08 21:04:14 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Contains the implementation of class Pkcs11Init
6
7 #include "pkcs11_init.h"
8
9 #include <iostream>
10
11 #include <base/logging.h>
12 #include <base/file_util.h>
13 #include <base/string_util.h>
14 #include <glib.h>
15 #include <opencryptoki/pkcs11.h>
16
17 #include "platform.h"
18
19 namespace cryptohome {
20
21 const CK_SLOT_ID kDefaultTpmSlotId = 0;
22 const CK_CHAR kDefaultOpencryptokiSoPin[] = "87654321";
Greg Spencer (Chromium) 2011/04/08 20:21:45 What are these "Opencryptoki" PINs used for, and w
kmixter1 2011/04/08 21:04:14 So this file is a stripped down version of one tha
23 const CK_CHAR kDefaultOpencryptokiUserPin[] = "12345678";
24 const CK_CHAR kDefaultSoPin[] = "000000";
25 const CK_CHAR kDefaultUserPin[] = "111111";
26 const CK_CHAR kDefaultLabel[] = "TPM";
27 const char kOpencryptokiDir[] = "/var/lib/opencryptoki";
28 const char kUserTokenLink[] = "/var/lib/opencryptoki/tpm/chronos";
29 const char kRootTokenLink[] = "/var/lib/opencryptoki/tpm/root";
30 const char kUserTokenDir[] = "/home/chronos/user/.tpm";
31 const char kRootTokenDir[] = "./chronos";
32 const char kPkcs11Group[] = "pkcs11";
33 const char kOldTokenEntry[] = "/var/lib/opencryptoki/pk_config_data";
34
35 extern const char* kTpmOwnedFile;
36 extern const std::string kDefaultSharedUser;
37
38 Pkcs11Init::Pkcs11Init() {
39 }
40
41 Pkcs11Init::~Pkcs11Init() {
42 }
43
44 void Pkcs11Init::GetTpmTokenInfo(gchar **OUT_label,
45 gchar **OUT_so_pin,
46 gchar **OUT_user_pin) {
47 *OUT_label = g_strdup(reinterpret_cast<const gchar *>(kDefaultLabel));
48 *OUT_so_pin = g_strdup(reinterpret_cast<const gchar *>(kDefaultSoPin));
49 *OUT_user_pin = g_strdup(reinterpret_cast<const gchar *>(kDefaultUserPin));
50 }
51
52 } // namespace cryptohome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698