Index: build/chrome/cackey-chrome-init.cc ================================================================== --- build/chrome/cackey-chrome-init.cc +++ build/chrome/cackey-chrome-init.cc @@ -11,10 +11,13 @@ #include #include #include #include #include + +#include +#include #include "pcsc-nacl.h" #include "cackey-chrome.h" class CACKeyInstance : public pp::Instance { @@ -52,14 +55,16 @@ */ reply = new pp::VarDictionary(); if (command.AsString() == "init") { if (message->HasKey("smartcardManagerAppId")) { - smartcardManagerAppId = message->Get("smartcardManagerAppId").AsString().c_str(); + smartcardManagerAppId = strdup(message->Get("smartcardManagerAppId").AsString().c_str()); } pcscNaClInit(this, corePointer, smartcardManagerAppId, "CACKey"); + + free((void *) smartcardManagerAppId); reply->Set("status", "success"); } else if (command.AsString() == "listcertificates") { numCertificates = cackey_chrome_listCertificates(&certificates); Index: build/chrome/cackey.js ================================================================== --- build/chrome/cackey.js +++ build/chrome/cackey.js @@ -304,11 +304,12 @@ * Initialize CACKey with the correct handle to talk to the Google Smartcard Manager App */ cackeyHandle.postMessage( { "target": "cackey", - "command": "init" + "command": "init", + "smartcardManagerAppId": "khpfeaanjngmcnplbdlpegiifgpfgdco" } ); /* * Start the Google PCSC Interface