Check-in [c53eda4523]
Overview
SHA1:c53eda4523f5b7206dd15c747609bece7db36577
Date: 2016-02-15 06:43:01
User: rkeene
Comment:ChromeOS: Fixed race with specifying the Google Smartcard Manager App ID
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-02-15
06:45
[4509382d11] ChromeOS: Removed extraneous PIN clearing (user: rkeene, tags: trunk)
06:43
[c53eda4523] ChromeOS: Fixed race with specifying the Google Smartcard Manager App ID (user: rkeene, tags: trunk)
06:39
[16b40cb47e] ChromeOS: Restructured initialization so that the Google PCSC Smartcard Manager App ID can be found at runtime (user: rkeene, tags: trunk)
Changes

Modified build/chrome/cackey-chrome-init.cc from [7c0a1742a0] to [7e2a70b757].

     9      9   #include <ppapi/cpp/instance.h>
    10     10   #include <ppapi/cpp/module.h>
    11     11   #include <ppapi/cpp/core.h>
    12     12   #include <ppapi/cpp/var.h>
    13     13   #include <ppapi/cpp/var_dictionary.h>
    14     14   #include <ppapi/cpp/var_array.h>
    15     15   #include <ppapi/cpp/var_array_buffer.h>
           16  +
           17  +#include <string.h>
           18  +#include <stdlib.h>
    16     19   
    17     20   #include "pcsc-nacl.h"
    18     21   #include "cackey-chrome.h"
    19     22   
    20     23   class CACKeyInstance : public pp::Instance {
    21     24   	private:
    22     25   		pp::Core *corePointer;
................................................................................
    50     53   			/*
    51     54   			 * Do the thing we are being asked to do
    52     55   			 */
    53     56   			reply = new pp::VarDictionary();
    54     57   
    55     58   			if (command.AsString() == "init") {
    56     59   				if (message->HasKey("smartcardManagerAppId")) {
    57         -					smartcardManagerAppId = message->Get("smartcardManagerAppId").AsString().c_str();
           60  +					smartcardManagerAppId = strdup(message->Get("smartcardManagerAppId").AsString().c_str());
    58     61   				}
    59     62   
    60     63   				pcscNaClInit(this, corePointer, smartcardManagerAppId, "CACKey");
           64  +
           65  +				free((void *) smartcardManagerAppId);
    61     66   
    62     67   				reply->Set("status", "success");
    63     68   			} else if (command.AsString() == "listcertificates") {
    64     69   				numCertificates = cackey_chrome_listCertificates(&certificates);
    65     70   
    66     71   				certificatesPPArray.SetLength(numCertificates);
    67     72   

Modified build/chrome/cackey.js from [95eeb58033] to [e2d53d74fa].

   302    302   
   303    303   	/*
   304    304   	 * Initialize CACKey with the correct handle to talk to the Google Smartcard Manager App
   305    305   	 */
   306    306   	cackeyHandle.postMessage(
   307    307   		{
   308    308   			"target": "cackey",
   309         -			"command": "init"
          309  +			"command": "init",
          310  +			"smartcardManagerAppId": "khpfeaanjngmcnplbdlpegiifgpfgdco"
   310    311   		}
   311    312   	);
   312    313   
   313    314   	/*
   314    315   	 * Start the Google PCSC Interface
   315    316   	 */
   316    317   	new GoogleSmartCard.PcscNacl(cackeyHandle);