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

Unified Diff: chromeos/network/onc/onc_utils.h

Issue 16946002: Resolve certificate references in ONC by PEM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/network/onc/onc_utils.h
diff --git a/chromeos/network/onc/onc_utils.h b/chromeos/network/onc/onc_utils.h
index d604cfc67a755252ffa17a2d988619db718514b4..f1b7b99e4f92399cfa63dc9aa54c10102ca908f5 100644
--- a/chromeos/network/onc/onc_utils.h
+++ b/chromeos/network/onc/onc_utils.h
@@ -5,20 +5,25 @@
#ifndef CHROMEOS_NETWORK_ONC_ONC_UTILS_H_
#define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_
+#include <map>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/network/onc/onc_constants.h"
-#include "net/cert/x509_certificate.h"
namespace base {
class DictionaryValue;
class ListValue;
}
+namespace net {
+class X509Certificate;
+}
+
namespace chromeos {
namespace onc {
@@ -91,8 +96,25 @@ CHROMEOS_EXPORT bool ParseAndValidateOncForImport(
// Parse the given PEM encoded certificate |pem_encoded| and create a
// X509Certificate from it.
CHROMEOS_EXPORT scoped_refptr<net::X509Certificate> DecodePEMCertificate(
- const std::string& pem_encoded,
- const std::string& nickname);
+ const std::string& pem_encoded);
+
+// Replaces all references by GUID to Server or CA certs by their PEM
+// encoding. Returns true if all references could be resolved. Otherwise returns
+// false and network configurations with unresolveable references are removed
+// from |network_configs|. |network_configs| must be a list of ONC
+// NetworkConfiguration dictionaries.
+CHROMEOS_EXPORT bool ResolveServerCertRefsInNetworks(
+ const std::map<std::string,
+ scoped_refptr<net::X509Certificate> >& certs_by_guid,
stevenjb 2013/06/28 18:00:27 These should use a typedef
pneubeck (no reviews) 2013/07/01 15:12:14 Done.
+ base::ListValue* network_configs);
+
+// Replaces all references by GUID to Server or CA certs by their PEM
+// encoding. Returns true if all references could be resolved. |network_config|
+// must be a ONC NetworkConfiguration.
+CHROMEOS_EXPORT bool ResolveServerCertRefsInNetwork(
+ const std::map<std::string,
+ scoped_refptr<net::X509Certificate> >& certs_by_guid,
+ base::DictionaryValue* network_config);
} // namespace onc
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698