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

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

Issue 61903002: ChromeOS: Add more host verification options for OpenVpn. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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_translator.h" 5 #include "chromeos/network/onc/onc_translator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 shill_dictionary_->GetStringWithoutPathExpansion(shill::kTypeProperty, 139 shill_dictionary_->GetStringWithoutPathExpansion(shill::kTypeProperty,
140 &shill_network_type); 140 &shill_network_type);
141 const char* onc_auth = ::onc::ethernet::kNone; 141 const char* onc_auth = ::onc::ethernet::kNone;
142 if (shill_network_type == shill::kTypeEthernetEap) 142 if (shill_network_type == shill::kTypeEthernetEap)
143 onc_auth = ::onc::ethernet::k8021X; 143 onc_auth = ::onc::ethernet::k8021X;
144 onc_object_->SetStringWithoutPathExpansion(::onc::ethernet::kAuthentication, 144 onc_object_->SetStringWithoutPathExpansion(::onc::ethernet::kAuthentication,
145 onc_auth); 145 onc_auth);
146 } 146 }
147 147
148 void ShillToONCTranslator::TranslateOpenVPN() { 148 void ShillToONCTranslator::TranslateOpenVPN() {
149 if (shill_dictionary_->HasKey(shill::kOpenVPNVerifyX509NameProperty))
150 TranslateAndAddNestedObject(::onc::openvpn::kVerifyX509);
bartfab (slow) 2013/11/07 10:48:56 Nit: Indent 2 spaces, not 4.
pneubeck (no reviews) 2013/11/11 11:53:43 Done.
151
149 // Shill supports only one RemoteCertKU but ONC requires a list. If existing, 152 // Shill supports only one RemoteCertKU but ONC requires a list. If existing,
150 // wraps the value into a list. 153 // wraps the value into a list.
151 std::string certKU; 154 std::string certKU;
152 if (shill_dictionary_->GetStringWithoutPathExpansion( 155 if (shill_dictionary_->GetStringWithoutPathExpansion(
153 shill::kOpenVPNRemoteCertKUProperty, &certKU)) { 156 shill::kOpenVPNRemoteCertKUProperty, &certKU)) {
154 scoped_ptr<base::ListValue> certKUs(new base::ListValue); 157 scoped_ptr<base::ListValue> certKUs(new base::ListValue);
155 certKUs->AppendString(certKU); 158 certKUs->AppendString(certKU);
156 onc_object_->SetWithoutPathExpansion(::onc::openvpn::kRemoteCertKU, 159 onc_object_->SetWithoutPathExpansion(::onc::openvpn::kRemoteCertKU,
157 certKUs.release()); 160 certKUs.release());
158 } 161 }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 const base::DictionaryValue& shill_dictionary, 411 const base::DictionaryValue& shill_dictionary,
409 const OncValueSignature* onc_signature) { 412 const OncValueSignature* onc_signature) {
410 CHECK(onc_signature != NULL); 413 CHECK(onc_signature != NULL);
411 414
412 ShillToONCTranslator translator(shill_dictionary, *onc_signature); 415 ShillToONCTranslator translator(shill_dictionary, *onc_signature);
413 return translator.CreateTranslatedONCObject(); 416 return translator.CreateTranslatedONCObject();
414 } 417 }
415 418
416 } // namespace onc 419 } // namespace onc
417 } // namespace chromeos 420 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698