Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |