Lines Matching refs:deserialized
43 Message* deserialized = new Message(ver); in round_trip() local
45 EXPECT_TRUE(deserialized->Deserialize(&p, p + size)); in round_trip()
47 return deserialized; in round_trip()
71 UniquePtr<EmptyKeymasterResponse> deserialized(round_trip(ver, msg, 5)); in TEST() local
80 UniquePtr<EmptyKeymasterResponse> deserialized(round_trip(ver, msg, 4)); in TEST() local
89 UniquePtr<SupportedByAlgorithmRequest> deserialized(round_trip(ver, req, 4)); in TEST() local
90 EXPECT_EQ(KM_ALGORITHM_EC, deserialized->algorithm); in TEST()
100 UniquePtr<SupportedByAlgorithmAndPurposeRequest> deserialized(round_trip(ver, req, 8)); in TEST() local
101 EXPECT_EQ(KM_ALGORITHM_EC, deserialized->algorithm); in TEST()
102 EXPECT_EQ(KM_PURPOSE_DECRYPT, deserialized->purpose); in TEST()
113 UniquePtr<SupportedResponse<keymaster_digest_t>> deserialized(round_trip(ver, rsp, 20)); in TEST() local
114 EXPECT_EQ(array_length(digests), deserialized->results_length); in TEST()
115 EXPECT_EQ(0, memcmp(deserialized->results, digests, array_size(digests))); in TEST()
134 UniquePtr<GenerateKeyRequest> deserialized(round_trip(ver, req, 78)); in TEST() local
135 EXPECT_EQ(deserialized->key_description, req.key_description); in TEST()
147 UniquePtr<GenerateKeyResponse> deserialized(round_trip(ver, rsp, 109)); in TEST() local
148 EXPECT_EQ(KM_ERROR_OK, deserialized->error); in TEST()
149 EXPECT_EQ(deserialized->enforced, rsp.enforced); in TEST()
150 EXPECT_EQ(deserialized->unenforced, rsp.unenforced); in TEST()
162 UniquePtr<GenerateKeyResponse> deserialized(round_trip(ver, rsp, 4)); in TEST() local
163 EXPECT_EQ(KM_ERROR_UNSUPPORTED_ALGORITHM, deserialized->error); in TEST()
164 EXPECT_EQ(0U, deserialized->enforced.size()); in TEST()
165 EXPECT_EQ(0U, deserialized->unenforced.size()); in TEST()
166 EXPECT_EQ(0U, deserialized->key_blob.key_material_size); in TEST()
176 UniquePtr<GetKeyCharacteristicsRequest> deserialized(round_trip(ver, req, 85)); in TEST() local
177 EXPECT_EQ(7U, deserialized->additional_params.size()); in TEST()
178 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST()
179 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3)); in TEST()
190 UniquePtr<GetKeyCharacteristicsResponse> deserialized(round_trip(ver, msg, 160)); in TEST() local
191 EXPECT_EQ(msg.enforced, deserialized->enforced); in TEST()
192 EXPECT_EQ(msg.unenforced, deserialized->unenforced); in TEST()
203 UniquePtr<BeginOperationRequest> deserialized(round_trip(ver, msg, 89)); in TEST() local
204 EXPECT_EQ(KM_PURPOSE_SIGN, deserialized->purpose); in TEST()
205 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST()
206 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3)); in TEST()
207 EXPECT_EQ(msg.additional_params, deserialized->additional_params); in TEST()
218 UniquePtr<BeginOperationResponse> deserialized; in TEST() local
221 deserialized.reset(round_trip(ver, msg, 12)); in TEST()
226 deserialized.reset(round_trip(ver, msg, 39)); in TEST()
232 EXPECT_EQ(KM_ERROR_OK, deserialized->error); in TEST()
233 EXPECT_EQ(0xDEADBEEF, deserialized->op_handle); in TEST()
237 EXPECT_EQ(0U, deserialized->output_params.size()); in TEST()
242 EXPECT_EQ(msg.output_params, deserialized->output_params); in TEST()
256 UniquePtr<BeginOperationResponse> deserialized(round_trip(ver, msg, 4)); in TEST() local
257 EXPECT_EQ(KM_ERROR_INVALID_OPERATION_HANDLE, deserialized->error); in TEST()
267 UniquePtr<UpdateOperationRequest> deserialized; in TEST() local
270 deserialized.reset(round_trip(ver, msg, 15)); in TEST()
275 deserialized.reset(round_trip(ver, msg, 27)); in TEST()
280 EXPECT_EQ(3U, deserialized->input.available_read()); in TEST()
281 EXPECT_EQ(0, memcmp(deserialized->input.peek_read(), "foo", 3)); in TEST()
293 UniquePtr<UpdateOperationResponse> deserialized; in TEST() local
296 deserialized.reset(round_trip(ver, msg, 11)); in TEST()
299 deserialized.reset(round_trip(ver, msg, 15)); in TEST()
303 deserialized.reset(round_trip(ver, msg, 42)); in TEST()
308 EXPECT_EQ(KM_ERROR_OK, deserialized->error); in TEST()
309 EXPECT_EQ(3U, deserialized->output.available_read()); in TEST()
310 EXPECT_EQ(0, memcmp(deserialized->output.peek_read(), "foo", 3)); in TEST()
314 EXPECT_EQ(0U, deserialized->input_consumed); in TEST()
317 EXPECT_EQ(99U, deserialized->input_consumed); in TEST()
321 EXPECT_EQ(99U, deserialized->input_consumed); in TEST()
322 EXPECT_EQ(1U, deserialized->output_params.size()); in TEST()
337 UniquePtr<FinishOperationRequest> deserialized; in TEST() local
340 deserialized.reset(round_trip(ver, msg, 15)); in TEST()
344 deserialized.reset(round_trip(ver, msg, 27)); in TEST()
347 deserialized.reset(round_trip(ver, msg, 34)); in TEST()
352 EXPECT_EQ(0xDEADBEEF, deserialized->op_handle); in TEST()
353 EXPECT_EQ(3U, deserialized->signature.available_read()); in TEST()
354 EXPECT_EQ(0, memcmp(deserialized->signature.peek_read(), "bar", 3)); in TEST()
364 UniquePtr<FinishOperationResponse> deserialized; in TEST() local
368 deserialized.reset(round_trip(ver, msg, 11)); in TEST()
372 deserialized.reset(round_trip(ver, msg, 23)); in TEST()
377 EXPECT_EQ(msg.error, deserialized->error); in TEST()
378 EXPECT_EQ(msg.output.available_read(), deserialized->output.available_read()); in TEST()
379 EXPECT_EQ(0, memcmp(msg.output.peek_read(), deserialized->output.peek_read(), in TEST()
391 UniquePtr<ImportKeyRequest> deserialized(round_trip(ver, msg, 89)); in TEST() local
392 EXPECT_EQ(msg.key_description, deserialized->key_description); in TEST()
393 EXPECT_EQ(msg.key_format, deserialized->key_format); in TEST()
394 EXPECT_EQ(msg.key_data_length, deserialized->key_data_length); in TEST()
395 EXPECT_EQ(0, memcmp(msg.key_data, deserialized->key_data, msg.key_data_length)); in TEST()
407 UniquePtr<ImportKeyResponse> deserialized(round_trip(ver, msg, 167)); in TEST() local
408 EXPECT_EQ(msg.error, deserialized->error); in TEST()
409 EXPECT_EQ(msg.key_blob.key_material_size, deserialized->key_blob.key_material_size); in TEST()
410 EXPECT_EQ(0, memcmp(msg.key_blob.key_material, deserialized->key_blob.key_material, in TEST()
412 EXPECT_EQ(msg.enforced, deserialized->enforced); in TEST()
413 EXPECT_EQ(msg.unenforced, deserialized->unenforced); in TEST()
424 UniquePtr<ExportKeyRequest> deserialized(round_trip(ver, msg, 89)); in TEST() local
425 EXPECT_EQ(msg.additional_params, deserialized->additional_params); in TEST()
426 EXPECT_EQ(msg.key_format, deserialized->key_format); in TEST()
427 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST()
428 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST()
438 UniquePtr<ExportKeyResponse> deserialized(round_trip(ver, msg, 11)); in TEST() local
439 EXPECT_EQ(3U, deserialized->key_data_length); in TEST()
440 EXPECT_EQ(0, memcmp("foo", deserialized->key_data, 3)); in TEST()
449 UniquePtr<DeleteKeyRequest> deserialized(round_trip(ver, msg, 7)); in TEST() local
450 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST()
451 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST()
458 UniquePtr<DeleteKeyResponse> deserialized(round_trip(ver, msg, 4)); in TEST() local
465 UniquePtr<DeleteAllKeysRequest> deserialized(round_trip(ver, msg, 0)); in TEST() local
472 UniquePtr<DeleteAllKeysResponse> deserialized(round_trip(ver, msg, 4)); in TEST() local
485 GetVersionRequest deserialized; in TEST() local
487 EXPECT_TRUE(deserialized.Deserialize(&p, p + size)); in TEST()
504 GetVersionResponse deserialized; in TEST() local
506 EXPECT_TRUE(deserialized.Deserialize(&p, p + size)); in TEST()
519 UniquePtr<ConfigureRequest> deserialized(round_trip(ver, req, 8)); in TEST() local
520 EXPECT_EQ(deserialized->os_version, req.os_version); in TEST()
521 EXPECT_EQ(deserialized->os_patchlevel, req.os_patchlevel); in TEST()
528 UniquePtr<ConfigureResponse> deserialized(round_trip(ver, rsp, 4)); in TEST() local
537 UniquePtr<AddEntropyRequest> deserialized(round_trip(ver, msg, 7)); in TEST() local
538 EXPECT_EQ(3U, deserialized->random_data.available_read()); in TEST()
539 EXPECT_EQ(0, memcmp("foo", deserialized->random_data.peek_read(), 3)); in TEST()
546 UniquePtr<AddEntropyResponse> deserialized(round_trip(ver, msg, 4)); in TEST() local
553 UniquePtr<AbortOperationRequest> deserialized(round_trip(ver, msg, 8)); in TEST() local
560 UniquePtr<AbortOperationResponse> deserialized(round_trip(ver, msg, 4)); in TEST() local
570 UniquePtr<AttestKeyRequest> deserialized(round_trip(ver, msg, 85)); in TEST() local
571 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST()
572 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST()
573 EXPECT_EQ(msg.attest_params, deserialized->attest_params); in TEST()
586 UniquePtr<AttestKeyResponse> deserialized(round_trip(ver, msg, 29)); in TEST() local
587 keymaster_cert_chain_t* chain = &deserialized->certificate_chain; in TEST()
606 UniquePtr<UpgradeKeyRequest> deserialized(round_trip(ver, msg, 85)); in TEST() local
607 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST()
608 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST()
609 EXPECT_EQ(msg.upgrade_params, deserialized->upgrade_params); in TEST()
620 UniquePtr<UpgradeKeyResponse> deserialized(round_trip(ver, req, 19)); in TEST() local
621 EXPECT_EQ(KM_ERROR_OK, deserialized->error); in TEST()
622 EXPECT_EQ(req.upgraded_key.key_material_size, deserialized->upgraded_key.key_material_size); in TEST()
623 EXPECT_EQ(0, memcmp(req.upgraded_key.key_material, deserialized->upgraded_key.key_material, in TEST()