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

Side by Side Diff: chromeos/network/onc/onc_certificate_importer.cc

Issue 11962048: This adds Cellular to the Shill to ONC translation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some semantics 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "chromeos/network/onc/onc_certificate_importer.h" 5 #include "chromeos/network/onc/onc_certificate_importer.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 else if (successful_imports == 0) 67 else if (successful_imports == 0)
68 return IMPORT_FAILED; 68 return IMPORT_FAILED;
69 else 69 else
70 return IMPORT_INCOMPLETE; 70 return IMPORT_INCOMPLETE;
71 } 71 }
72 72
73 bool CertificateImporter::ParseAndStoreCertificate( 73 bool CertificateImporter::ParseAndStoreCertificate(
74 const base::DictionaryValue& certificate) { 74 const base::DictionaryValue& certificate) {
75 // Get out the attributes of the given certificate. 75 // Get out the attributes of the given certificate.
76 std::string guid; 76 std::string guid;
77 if (!certificate.GetString(kGUID, &guid) || guid.empty()) { 77 if (!certificate.GetString(network_config::kGUID, &guid) || guid.empty()) {
pneubeck (no reviews) 2013/01/18 10:27:41 (onc::)kGUID, see comment in onc_constant.h
78 ONC_LOG_ERROR("Certificate missing GUID identifier"); 78 ONC_LOG_ERROR("Certificate missing GUID identifier");
79 return false; 79 return false;
80 } 80 }
81 81
82 bool remove = false; 82 bool remove = false;
83 if (certificate.GetBoolean(kRemove, &remove) && remove) { 83 if (certificate.GetBoolean(kRemove, &remove) && remove) {
84 if (!DeleteCertAndKeyByNickname(guid)) { 84 if (!DeleteCertAndKeyByNickname(guid)) {
85 ONC_LOG_ERROR("Unable to delete certificate"); 85 ONC_LOG_ERROR("Unable to delete certificate");
86 return false; 86 return false;
87 } else { 87 } else {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 PK11_SetPrivateKeyNickname(private_key, const_cast<char*>(guid.c_str())); 365 PK11_SetPrivateKeyNickname(private_key, const_cast<char*>(guid.c_str()));
366 SECKEY_DestroyPrivateKey(private_key); 366 SECKEY_DestroyPrivateKey(private_key);
367 } else { 367 } else {
368 ONC_LOG_WARNING("Unable to find private key for certificate."); 368 ONC_LOG_WARNING("Unable to find private key for certificate.");
369 } 369 }
370 return true; 370 return true;
371 } 371 }
372 372
373 } // namespace onc 373 } // namespace onc
374 } // namespace chromeos 374 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698