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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
142
143
144
145
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
			const char *smartcardManagerAppId = NULL;
			unsigned char buffer[8192];
			struct cackey_certificate *certificates, incomingCertificateCACKey;
			pp::VarDictionary *reply;
			pp::VarArray certificatesPPArray;
			pp::VarArrayBuffer *certificateContents, *incomingCertificateContents, *incomingData, *outgoingData;
			pp::Var command;
			const pp::Var *outgoingDataAsVar = NULL;
			int numCertificates, i;
			unsigned long outgoingDataLength;

			/*
			 * Extract the command
			 */
			command = message->Get("command");
................................................................................
						case CACKEY_CHROME_OK:
							outgoingData = new pp::VarArrayBuffer(outgoingDataLength);

							memcpy(outgoingData->Map(), buffer, outgoingDataLength);

							outgoingData->Unmap();

							outgoingDataAsVar = new pp::Var(outgoingData->pp_var());


							delete outgoingData;

							reply->Set("status", "success");
							reply->Set("signedData", outgoingDataAsVar);

							break;
						case CACKEY_CHROME_ERROR:
							reply->Set("status", "error");
							reply->Set("error", "Unable to sign data");
							break;
						case CACKEY_CHROME_NEEDLOGIN:
................................................................................

			delete reply;

			delete message;

			delete messagePlain;

			if (outgoingDataAsVar) {
				delete outgoingDataAsVar;
			}

			return;
		}

		virtual void HandleMessage(const pp::Var& messagePlain) {
			pp::VarDictionary *message;
			pp::Var *messagePlainCopy;
			pp::Var target;







<







 







|
>


<
<
<







 







<
<
<
<







37
38
39
40
41
42
43

44
45
46
47
48
49
50
...
125
126
127
128
129
130
131
132
133
134
135



136
137
138
139
140
141
142
...
177
178
179
180
181
182
183




184
185
186
187
188
189
190
			const char *smartcardManagerAppId = NULL;
			unsigned char buffer[8192];
			struct cackey_certificate *certificates, incomingCertificateCACKey;
			pp::VarDictionary *reply;
			pp::VarArray certificatesPPArray;
			pp::VarArrayBuffer *certificateContents, *incomingCertificateContents, *incomingData, *outgoingData;
			pp::Var command;

			int numCertificates, i;
			unsigned long outgoingDataLength;

			/*
			 * Extract the command
			 */
			command = message->Get("command");
................................................................................
						case CACKEY_CHROME_OK:
							outgoingData = new pp::VarArrayBuffer(outgoingDataLength);

							memcpy(outgoingData->Map(), buffer, outgoingDataLength);

							outgoingData->Unmap();

							reply->Set("status", "success");
							reply->Set("signedData", *outgoingData);

							delete outgoingData;




							break;
						case CACKEY_CHROME_ERROR:
							reply->Set("status", "error");
							reply->Set("error", "Unable to sign data");
							break;
						case CACKEY_CHROME_NEEDLOGIN:
................................................................................

			delete reply;

			delete message;

			delete messagePlain;





			return;
		}

		virtual void HandleMessage(const pp::Var& messagePlain) {
			pp::VarDictionary *message;
			pp::Var *messagePlainCopy;
			pp::Var target;