Lines Matching refs:buf_ptr

46 bool deserialize_key_blob(keymaster_key_blob_t* key_blob, const uint8_t** buf_ptr,  in deserialize_key_blob()  argument
51 if (!copy_size_and_data_from_buf(buf_ptr, end, &key_blob->key_material_size, in deserialize_key_blob()
74 bool deserialize_blob(keymaster_blob_t* blob, const uint8_t** buf_ptr, const uint8_t* end) { in deserialize_blob() argument
78 if (!copy_size_and_data_from_buf(buf_ptr, end, &blob->data_length, &deserialized_blob)) in deserialize_blob()
108 CertificateChain deserialize_chain(const uint8_t** buf_ptr, const uint8_t* end) { in deserialize_chain() argument
110 if (!copy_uint32_from_buf(buf_ptr, end, &entry_count) || entry_count > kMaxChainEntryCount) { in deserialize_chain()
120 if (!copy_size_and_data_from_buf(buf_ptr, end, &data_length, &data)) return {}; in deserialize_chain()
178 bool KeymasterResponse::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
179 if (!copy_uint32_from_buf(buf_ptr, end, &error)) return false; in Deserialize()
181 return NonErrorDeserialize(buf_ptr, end); in Deserialize()
201 bool GenerateKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
202 if (!key_description.Deserialize(buf_ptr, end)) return false; in Deserialize()
204 return deserialize_key_blob(&attestation_signing_key_blob, buf_ptr, end) // in Deserialize()
205 && attest_key_params.Deserialize(buf_ptr, end) // in Deserialize()
206 && deserialize_blob(&issuer_subject, buf_ptr, end); in Deserialize()
224 bool GenerateKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
225 if (!deserialize_key_blob(&key_blob, buf_ptr, end) || // in NonErrorDeserialize()
226 !enforced.Deserialize(buf_ptr, end) || // in NonErrorDeserialize()
227 !unenforced.Deserialize(buf_ptr, end)) { in NonErrorDeserialize()
231 certificate_chain = deserialize_chain(buf_ptr, end); in NonErrorDeserialize()
244 bool GenerateRkpKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
245 return deserialize_key_blob(&key_blob, buf_ptr, end) && in NonErrorDeserialize()
246 deserialize_blob(&maced_public_key, buf_ptr, end); in NonErrorDeserialize()
270 bool GenerateCsrRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
271 if (!copy_from_buf(buf_ptr, end, &test_mode, sizeof(uint8_t)) || in Deserialize()
272 !copy_from_buf(buf_ptr, end, &num_keys, sizeof(uint32_t))) { in Deserialize()
278 if (!deserialize_blob(&keys_to_sign_array[i], buf_ptr, end)) return false; in Deserialize()
280 return deserialize_blob(&endpoint_enc_cert_chain, buf_ptr, end) && in Deserialize()
281 deserialize_blob(&challenge, buf_ptr, end); in Deserialize()
310 bool GenerateCsrResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
311 return deserialize_blob(&keys_to_sign_mac, buf_ptr, end) && in NonErrorDeserialize()
312 deserialize_blob(&device_info_blob, buf_ptr, end) && in NonErrorDeserialize()
313 deserialize_blob(&protected_data_blob, buf_ptr, end); in NonErrorDeserialize()
333 bool GenerateCsrV2Request::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
334 if (!copy_from_buf(buf_ptr, end, &num_keys, sizeof(uint32_t))) return false; in Deserialize()
339 if (!deserialize_blob(&keys_to_sign_array[i], buf_ptr, end)) return false; in Deserialize()
341 return deserialize_blob(&challenge, buf_ptr, end); in Deserialize()
372 bool GenerateCsrV2Response::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
373 return deserialize_blob(&csr, buf_ptr, end); in NonErrorDeserialize()
393 bool GetKeyCharacteristicsRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
394 return deserialize_key_blob(&key_blob, buf_ptr, end) && in Deserialize()
395 additional_params.Deserialize(buf_ptr, end); in Deserialize()
407 bool GetKeyCharacteristicsResponse::NonErrorDeserialize(const uint8_t** buf_ptr, in NonErrorDeserialize() argument
409 return enforced.Deserialize(buf_ptr, end) && unenforced.Deserialize(buf_ptr, end); in NonErrorDeserialize()
427 bool BeginOperationRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
428 return copy_uint32_from_buf(buf_ptr, end, &purpose) && in Deserialize()
429 deserialize_key_blob(&key_blob, buf_ptr, end) && in Deserialize()
430 additional_params.Deserialize(buf_ptr, end); in Deserialize()
446 bool BeginOperationResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
447 bool retval = copy_uint64_from_buf(buf_ptr, end, &op_handle); in NonErrorDeserialize()
448 if (retval && message_version > 0) retval = output_params.Deserialize(buf_ptr, end); in NonErrorDeserialize()
466 bool UpdateOperationRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
467 bool retval = copy_uint64_from_buf(buf_ptr, end, &op_handle) && input.Deserialize(buf_ptr, end); in Deserialize()
468 if (retval && message_version > 0) retval = additional_params.Deserialize(buf_ptr, end); in Deserialize()
501 bool UpdateOperationResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
502 bool retval = output.Deserialize(buf_ptr, end); in NonErrorDeserialize()
503 if (retval && message_version > 0) retval = copy_uint32_from_buf(buf_ptr, end, &input_consumed); in NonErrorDeserialize()
504 if (retval && message_version > 1) retval = output_params.Deserialize(buf_ptr, end); in NonErrorDeserialize()
538 bool FinishOperationRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
540 copy_uint64_from_buf(buf_ptr, end, &op_handle) && signature.Deserialize(buf_ptr, end); in Deserialize()
541 if (retval && message_version > 0) retval = additional_params.Deserialize(buf_ptr, end); in Deserialize()
542 if (retval && message_version > 2) retval = input.Deserialize(buf_ptr, end); in Deserialize()
559 bool FinishOperationResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
560 bool retval = output.Deserialize(buf_ptr, end); in NonErrorDeserialize()
561 if (retval && message_version > 1) retval = output_params.Deserialize(buf_ptr, end); in NonErrorDeserialize()
573 bool AddEntropyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
574 return random_data.Deserialize(buf_ptr, end); in Deserialize()
598 bool ImportKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
599 if (!(key_description.Deserialize(buf_ptr, end) && in Deserialize()
600 copy_uint32_from_buf(buf_ptr, end, &key_format) && in Deserialize()
601 deserialize_key_blob(&key_data, buf_ptr, end))) { in Deserialize()
606 return deserialize_key_blob(&attestation_signing_key_blob, buf_ptr, end) // in Deserialize()
607 && attest_key_params.Deserialize(buf_ptr, end) // in Deserialize()
608 && deserialize_blob(&issuer_subject, buf_ptr, end); in Deserialize()
630 bool ImportKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
631 if (!deserialize_key_blob(&key_blob, buf_ptr, end) || // in NonErrorDeserialize()
632 !enforced.Deserialize(buf_ptr, end) || // in NonErrorDeserialize()
633 !unenforced.Deserialize(buf_ptr, end)) { in NonErrorDeserialize()
637 certificate_chain = deserialize_chain(buf_ptr, end); in NonErrorDeserialize()
656 bool ExportKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
657 return additional_params.Deserialize(buf_ptr, end) && in Deserialize()
658 copy_uint32_from_buf(buf_ptr, end, &key_format) && in Deserialize()
659 deserialize_key_blob(&key_blob, buf_ptr, end); in Deserialize()
676 bool ExportKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
680 if (!copy_size_and_data_from_buf(buf_ptr, end, &key_data_length, &deserialized_key_material)) in NonErrorDeserialize()
698 bool DeleteKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
699 return deserialize_key_blob(&key_blob, buf_ptr, end); in Deserialize()
717 bool GetVersionResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
718 if (*buf_ptr + NonErrorSerializedSize() > end) return false; in NonErrorDeserialize()
719 const uint8_t* tmp = *buf_ptr; in NonErrorDeserialize()
723 *buf_ptr = tmp; in NonErrorDeserialize()
744 bool AttestKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
745 return deserialize_key_blob(&key_blob, buf_ptr, end) && attest_params.Deserialize(buf_ptr, end); in Deserialize()
756 bool AttestKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
757 certificate_chain = deserialize_chain(buf_ptr, end); in NonErrorDeserialize()
778 bool UpgradeKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
779 return deserialize_key_blob(&key_blob, buf_ptr, end) && in Deserialize()
780 upgrade_params.Deserialize(buf_ptr, end); in Deserialize()
795 bool UpgradeKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
796 return deserialize_key_blob(&upgraded_key, buf_ptr, end); in NonErrorDeserialize()
808 bool HmacSharingParameters::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
809 return deserialize_blob(&seed, buf_ptr, end) && in Deserialize()
810 copy_from_buf(buf_ptr, end, nonce, sizeof(nonce)); in Deserialize()
829 bool HmacSharingParametersArray::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
830 if (!copy_uint32_from_buf(buf_ptr, end, &num_params)) return false; in Deserialize()
835 if (!params_array[i].Deserialize(buf_ptr, end)) return false; in Deserialize()
848 bool ComputeSharedHmacResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
849 return deserialize_blob(&sharing_check, buf_ptr, end); in NonErrorDeserialize()
867 bool ImportWrappedKeyRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
868 return deserialize_key_blob(&wrapped_key, buf_ptr, end) && in Deserialize()
869 deserialize_key_blob(&wrapping_key, buf_ptr, end) && in Deserialize()
870 deserialize_key_blob(&masking_key, buf_ptr, end) && in Deserialize()
871 additional_params.Deserialize(buf_ptr, end) && in Deserialize()
872 copy_uint64_from_buf(buf_ptr, end, &password_sid) && in Deserialize()
873 copy_uint64_from_buf(buf_ptr, end, &biometric_sid); in Deserialize()
907 bool ImportWrappedKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
908 if (!deserialize_key_blob(&key_blob, buf_ptr, end) || // in NonErrorDeserialize()
909 !enforced.Deserialize(buf_ptr, end) || // in NonErrorDeserialize()
910 !unenforced.Deserialize(buf_ptr, end)) { in NonErrorDeserialize()
914 certificate_chain = deserialize_chain(buf_ptr, end); in NonErrorDeserialize()
932 bool HardwareAuthToken::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
933 return copy_uint64_from_buf(buf_ptr, end, &challenge) && in Deserialize()
934 copy_uint64_from_buf(buf_ptr, end, &user_id) && in Deserialize()
935 copy_uint64_from_buf(buf_ptr, end, &authenticator_id) && in Deserialize()
936 copy_uint32_from_buf(buf_ptr, end, &authenticator_type) && in Deserialize()
937 copy_uint64_from_buf(buf_ptr, end, &timestamp) && // in Deserialize()
938 deserialize_blob(&mac, buf_ptr, end); in Deserialize()
954 bool VerificationToken::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
955 return copy_uint64_from_buf(buf_ptr, end, &challenge) && in Deserialize()
956 copy_uint64_from_buf(buf_ptr, end, &timestamp) && in Deserialize()
957 parameters_verified.Deserialize(buf_ptr, end) && in Deserialize()
958 copy_uint32_from_buf(buf_ptr, end, &security_level) && in Deserialize()
959 deserialize_blob(&mac, buf_ptr, end); in Deserialize()
974 bool GetVersion2Response::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
975 return copy_uint32_from_buf(buf_ptr, end, &max_message_version) && in NonErrorDeserialize()
976 copy_uint32_from_buf(buf_ptr, end, &km_version) && in NonErrorDeserialize()
977 copy_uint32_from_buf(buf_ptr, end, &km_date); in NonErrorDeserialize()