OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <dlfcn.h> | 5 #include <dlfcn.h> |
6 #include <glib-object.h> | 6 #include <glib-object.h> |
7 | 7 |
8 #include <iostream> // NOLINT | 8 #include <iostream> // NOLINT |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 if (connection = chromeos::MonitorSession(&monitor, loop)) | 94 if (connection = chromeos::MonitorSession(&monitor, loop)) |
95 LOG(INFO) << "Started monitoring!"; | 95 LOG(INFO) << "Started monitoring!"; |
96 else | 96 else |
97 LOG(FATAL) << "Starting monitoring failed."; | 97 LOG(FATAL) << "Starting monitoring failed."; |
98 | 98 |
99 std::vector<uint8> key(public_key_info, | 99 std::vector<uint8> key(public_key_info, |
100 public_key_info + sizeof(public_key_info)); | 100 public_key_info + sizeof(public_key_info)); |
101 if (chromeos::SetOwnerKey(key)) | 101 if (chromeos::SetOwnerKey(key)) |
102 LOG(INFO) << "Sent key!"; | 102 LOG(INFO) << "Sent key!"; |
103 else | 103 else |
104 LOG(FATAL) << "Setting key failed."; | 104 LOG(ERROR) << "Setting key failed."; |
| 105 |
| 106 if (chromeos::Whitelist("cmasone@gmail.com", key)) |
| 107 LOG(INFO) << "Attempted to whitelist"; |
| 108 else |
| 109 LOG(INFO) << "Could not attempt to whitelist."; |
| 110 |
| 111 if (chromeos::CheckWhitelist("cmasone@gmail.com", &key)) |
| 112 LOG(INFO) << "On the whitelist"; |
| 113 else |
| 114 LOG(INFO) << "Not on the whitelist."; |
105 | 115 |
106 ::g_main_loop_run(loop); | 116 ::g_main_loop_run(loop); |
107 | 117 |
108 chromeos::DisconnectSession(connection); | 118 chromeos::DisconnectSession(connection); |
109 | 119 |
110 return 0; | 120 return 0; |
111 } | 121 } |
OLD | NEW |