Check-in [c27bb81788]
Overview
SHA1:c27bb81788ccbcd0304cde28403b7d8106f8f626
Date: 2016-02-26 18:20:59
User: rkeene
Edited Comment: ChromeOS: Fixed issue with including signed data in the reply
Original Comment: Fixed issue with including signed data in the reply
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-02-26
18:21
[8668b85846] ChromeOS: Updated to only enable debugging symbols in a debugging build (user: rkeene, tags: trunk)
18:20
[c27bb81788] ChromeOS: Fixed issue with including signed data in the reply (user: rkeene, tags: trunk)
16:35
[3783f79015] ChromeOS: Updated to pass original message back correctly (user: rkeene, tags: trunk)
Changes

Modified build/chrome/cackey-chrome-init.cc from [cd9d30207a] to [02273309f5].

    37     37   			const char *smartcardManagerAppId = NULL;
    38     38   			unsigned char buffer[8192];
    39     39   			struct cackey_certificate *certificates, incomingCertificateCACKey;
    40     40   			pp::VarDictionary *reply;
    41     41   			pp::VarArray certificatesPPArray;
    42     42   			pp::VarArrayBuffer *certificateContents, *incomingCertificateContents, *incomingData, *outgoingData;
    43     43   			pp::Var command;
    44         -			const pp::Var *outgoingDataAsVar = NULL;
    45     44   			int numCertificates, i;
    46     45   			unsigned long outgoingDataLength;
    47     46   
    48     47   			/*
    49     48   			 * Extract the command
    50     49   			 */
    51     50   			command = message->Get("command");
................................................................................
   126    125   						case CACKEY_CHROME_OK:
   127    126   							outgoingData = new pp::VarArrayBuffer(outgoingDataLength);
   128    127   
   129    128   							memcpy(outgoingData->Map(), buffer, outgoingDataLength);
   130    129   
   131    130   							outgoingData->Unmap();
   132    131   
   133         -							outgoingDataAsVar = new pp::Var(outgoingData->pp_var());
   134         -
   135         -							delete outgoingData;
   136         -
   137    132   							reply->Set("status", "success");
   138         -							reply->Set("signedData", outgoingDataAsVar);
          133  +							reply->Set("signedData", *outgoingData);
          134  +
          135  +							delete outgoingData;
   139    136   
   140    137   							break;
   141    138   						case CACKEY_CHROME_ERROR:
   142    139   							reply->Set("status", "error");
   143    140   							reply->Set("error", "Unable to sign data");
   144    141   							break;
   145    142   						case CACKEY_CHROME_NEEDLOGIN:
................................................................................
   180    177   
   181    178   			delete reply;
   182    179   
   183    180   			delete message;
   184    181   
   185    182   			delete messagePlain;
   186    183   
   187         -			if (outgoingDataAsVar) {
   188         -				delete outgoingDataAsVar;
   189         -			}
   190         -
   191    184   			return;
   192    185   		}
   193    186   
   194    187   		virtual void HandleMessage(const pp::Var& messagePlain) {
   195    188   			pp::VarDictionary *message;
   196    189   			pp::Var *messagePlainCopy;
   197    190   			pp::Var target;