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

Unified Diff: entd.cc

Issue 2833006: Eliminate stale pkcs11 certificate handler implementations. (Closed) Base URL: ssh://git@chromiumos-git/entd.git
Patch Set: Changed default pkcs11 mode and updated tests. Created 10 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
« no previous file with comments | « entd.h ('k') | main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: entd.cc
diff --git a/entd.cc b/entd.cc
index c0d2de2d4e683e79be74d982d1c405ebaf2dc70e..b6955279e001e088aaf8d924ee5ccfbed0158194 100644
--- a/entd.cc
+++ b/entd.cc
@@ -396,23 +396,18 @@ v8::Handle<v8::Object> Entd::ConstructEntd() {
callback_server_->obj(), v8::ReadOnly);
// Build the pkcs11 object
- bool res = false;
pkcs11_.reset(new Pkcs11(NULL, NULL));
- if (pkcs11_mode_ == "opencryptoki") {
- res = pkcs11_->InitializeOpenCryptoki(pkcs11_config_filename_);
- } else if (pkcs11_mode_ == "glaptop") {
- res = pkcs11_->InitializeGLaptop();
- } else if (pkcs11_mode_ == "openssl") {
- res = pkcs11_->InitializeOpenSSL();
- } else if (!pkcs11_mode_.empty()) {
- LOG(ERROR) << "Unrecognized pkcs11 mode: " << pkcs11_mode_;
- } else {
- res = pkcs11_->Initialize();
+ bool res = pkcs11_->Initialize();
+ if (pkcs11_mode_ == "openssl") {
+ res = res && pkcs11_->SetOpenSSLHandlers();
+ } else if (pkcs11_mode_ != "test") {
+ res = res && pkcs11_->SetOpenCryptokiHandlers();
}
if (!res) {
LOG(ERROR) << "Error initializing entd.pkcs11";
exit(1);
}
+
entd->Set(v8::String::New("pkcs11"),
pkcs11_->obj(), v8::ReadOnly);
« no previous file with comments | « entd.h ('k') | main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698