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

Unified Diff: net/base/keygen_handler.h

Issue 3186021: DONOTLAND: Start of PK11 password dialog for Linux/NSS (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Start of hooking up the hang monitor, probably requires WebKit changes Created 10 years, 3 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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | net/base/keygen_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/keygen_handler.h
diff --git a/net/base/keygen_handler.h b/net/base/keygen_handler.h
index 5ca6027ba2c3164f3a0ba1b86f522c507876a58c..39258f14303b6918add5a3dd1fa4f36703765971 100644
--- a/net/base/keygen_handler.h
+++ b/net/base/keygen_handler.h
@@ -8,8 +8,14 @@
#include <string>
+#include "base/scoped_ptr.h"
+#include "build/build_config.h"
#include "googleurl/src/gurl.h"
+namespace base {
+class PK11BlockingPasswordDelegate;
+};
+
namespace net {
// This class handles keypair generation for generating client
@@ -22,9 +28,11 @@ class KeygenHandler {
// Creates a handler that will generate a key with the given key size and
// incorporate the |challenge| into the Netscape SPKAC structure. The request
// for the key originated from |url|.
- inline KeygenHandler(int key_size_in_bits,
- const std::string& challenge,
- const GURL& url);
+ KeygenHandler(int key_size_in_bits,
+ const std::string& challenge,
+ const GURL& url);
+ // Define the destructor elsewhere to forward-declare PK11PasswordCallback.
+ ~KeygenHandler();
// Actually generates the key-pair and the cert request (SPKAC), and returns
// a base64-encoded string suitable for use as the form value of <keygen>.
@@ -33,22 +41,24 @@ class KeygenHandler {
// Exposed only for unit tests.
void set_stores_key(bool store) { stores_key_ = store;}
+#if defined(USE_NSS)
+ // On NSS, the token may be unauthenticated. We pass the blocking delegate for
+ // simplicity; GenKeyAndSignChallenge will block on generating a key anyway,
+ // so this is used on a worker thread. Takes ownership of the delegate.
+ void set_pk11_password_delegate(base::PK11BlockingPasswordDelegate* delegate);
+#endif // defined(USE_NSS)
+
private:
int key_size_in_bits_; // key size in bits (usually 2048)
std::string challenge_; // challenge string sent by server
GURL url_; // the URL that requested the key
bool stores_key_; // should the generated key-pair be stored persistently?
+#if defined(USE_NSS)
+ // The callback for requesting a password to the PKCS#11 store.
+ scoped_ptr<base::PK11BlockingPasswordDelegate> pk11_password_delegate_;
+#endif // defined(USE_NSS)
};
-KeygenHandler::KeygenHandler(int key_size_in_bits,
- const std::string& challenge,
- const GURL& url)
- : key_size_in_bits_(key_size_in_bits),
- challenge_(challenge),
- url_(url),
- stores_key_(true) {
-}
-
} // namespace net
#endif // NET_BASE_KEYGEN_HANDLER_H_
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | net/base/keygen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698