OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/keygen_handler.h" | 5 #include "net/base/keygen_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace { | 27 namespace { |
28 | 28 |
29 #if defined(USE_NSS) | 29 #if defined(USE_NSS) |
30 class StubCryptoModuleDelegate : public crypto::NSSCryptoModuleDelegate { | 30 class StubCryptoModuleDelegate : public crypto::NSSCryptoModuleDelegate { |
31 public: | 31 public: |
32 explicit StubCryptoModuleDelegate(crypto::ScopedPK11Slot slot) | 32 explicit StubCryptoModuleDelegate(crypto::ScopedPK11Slot slot) |
33 : slot_(slot.Pass()) {} | 33 : slot_(slot.Pass()) {} |
34 | 34 |
35 virtual std::string RequestPassword(const std::string& slot_name, | 35 virtual std::string RequestPassword(const std::string& slot_name, |
36 bool retry, | 36 bool retry, |
37 bool* cancelled) OVERRIDE{ | 37 bool* cancelled) override{ |
38 return std::string(); | 38 return std::string(); |
39 } | 39 } |
40 | 40 |
41 virtual crypto::ScopedPK11Slot RequestSlot() OVERRIDE { | 41 virtual crypto::ScopedPK11Slot RequestSlot() override { |
42 return crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot_.get())); | 42 return crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot_.get())); |
43 } | 43 } |
44 | 44 |
45 private: | 45 private: |
46 crypto::ScopedPK11Slot slot_; | 46 crypto::ScopedPK11Slot slot_; |
47 }; | 47 }; |
48 #endif | 48 #endif |
49 | 49 |
50 class KeygenHandlerTest : public ::testing::Test { | 50 class KeygenHandlerTest : public ::testing::Test { |
51 public: | 51 public: |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 events[i] = NULL; | 161 events[i] = NULL; |
162 | 162 |
163 VLOG(1) << "KeygenHandler " << i << " produced: " << results[i]; | 163 VLOG(1) << "KeygenHandler " << i << " produced: " << results[i]; |
164 AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge"); | 164 AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge"); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 } // namespace | 168 } // namespace |
169 | 169 |
170 } // namespace net | 170 } // namespace net |
OLD | NEW |