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

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

Issue 13006020: net: extract net/cert out of net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
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
11 #include "base/base64.h" 11 #include "base/base64.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chromeos/network/network_event_log.h" 14 #include "chromeos/network/network_event_log.h"
15 #include "chromeos/network/onc/onc_constants.h" 15 #include "chromeos/network/onc/onc_constants.h"
16 #include "net/base/crypto_module.h" 16 #include "net/base/crypto_module.h"
17 #include "net/base/net_errors.h" 17 #include "net/base/net_errors.h"
18 #include "net/base/nss_cert_database.h" 18 #include "net/cert/nss_cert_database.h"
19 #include "net/base/pem_tokenizer.h" 19 #include "net/cert/pem_tokenizer.h"
20 #include "net/base/x509_certificate.h" 20 #include "net/cert/x509_certificate.h"
21 21
22 #define ONC_LOG_WARNING(message) NET_LOG_WARNING("ONC", message) 22 #define ONC_LOG_WARNING(message) NET_LOG_WARNING("ONC", message)
23 #define ONC_LOG_ERROR(message) NET_LOG_ERROR("ONC", message) 23 #define ONC_LOG_ERROR(message) NET_LOG_ERROR("ONC", message)
24 24
25 namespace { 25 namespace {
26 26
27 // The PEM block header used for DER certificates 27 // The PEM block header used for DER certificates
28 const char kCertificateHeader[] = "CERTIFICATE"; 28 const char kCertificateHeader[] = "CERTIFICATE";
29 // This is an older PEM marker for DER certificates. 29 // This is an older PEM marker for DER certificates.
30 const char kX509CertificateHeader[] = "X509 CERTIFICATE"; 30 const char kX509CertificateHeader[] = "X509 CERTIFICATE";
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 PK11_SetPrivateKeyNickname(private_key, const_cast<char*>(guid.c_str())); 350 PK11_SetPrivateKeyNickname(private_key, const_cast<char*>(guid.c_str()));
351 SECKEY_DestroyPrivateKey(private_key); 351 SECKEY_DestroyPrivateKey(private_key);
352 } else { 352 } else {
353 ONC_LOG_WARNING("Unable to find private key for certificate."); 353 ONC_LOG_WARNING("Unable to find private key for certificate.");
354 } 354 }
355 return true; 355 return true;
356 } 356 }
357 357
358 } // namespace onc 358 } // namespace onc
359 } // namespace chromeos 359 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698