Lines Matching refs:end
33 static inline bool fitsBuffer(const uint8_t* begin, const uint8_t* end, uint32_t field_size) { in fitsBuffer() argument
36 && dummy <= reinterpret_cast<uintptr_t>(end); in fitsBuffer()
53 static inline gatekeeper_error_t read_from_buffer(const uint8_t **buffer, const uint8_t *end, in read_from_buffer() argument
56 if (!fitsBuffer(*buffer, end, sizeof(uint32_t))) return ERROR_INVALID; in read_from_buffer()
68 if (!fitsBuffer(*buffer, end, length)) return ERROR_INVALID; in read_from_buffer()
94 uint32_t GateKeeperMessage::Serialize(uint8_t *buffer, const uint8_t *end) const { in Serialize()
96 if (!fitsBuffer(buffer, end, GetSerializedSize())) { in Serialize()
101 if (!fitsBuffer(buffer, end, sizeof(serial_header_t))) return 0; in Serialize()
107 if (!fitsBuffer(buffer, end, sizeof(retry_timeout))) return 0; in Serialize()
112 if (!fitsBuffer(buffer, end, serialized_size)) return 0; in Serialize()
119 gatekeeper_error_t GateKeeperMessage::Deserialize(const uint8_t *payload, const uint8_t *end) { in Deserialize() argument
120 if (!fitsBuffer(payload, end, sizeof(serial_header_t))) return ERROR_INVALID; in Deserialize()
126 return nonErrorDeserialize(payload, end); in Deserialize()
130 if (!fitsBuffer(payload, end, sizeof(retry_timeout))) { in Deserialize()
165 gatekeeper_error_t VerifyRequest::nonErrorDeserialize(const uint8_t *payload, const uint8_t *end) { in nonErrorDeserialize() argument
171 if (!fitsBuffer(payload, end, sizeof(challenge))) return ERROR_INVALID; in nonErrorDeserialize()
176 error = read_from_buffer(&payload, end, &password_handle); in nonErrorDeserialize()
179 return read_from_buffer(&payload, end, &provided_password); in nonErrorDeserialize()
206 gatekeeper_error_t VerifyResponse::nonErrorDeserialize(const uint8_t *payload, const uint8_t *end) { in nonErrorDeserialize() argument
210 gatekeeper_error_t err = read_from_buffer(&payload, end, &auth_token); in nonErrorDeserialize()
215 if (!fitsBuffer(payload, end, sizeof(request_reenroll))) return ERROR_INVALID; in nonErrorDeserialize()
240 gatekeeper_error_t EnrollRequest::nonErrorDeserialize(const uint8_t *payload, const uint8_t *end) { in nonErrorDeserialize() argument
247 ret = read_from_buffer(&payload, end, &provided_password); in nonErrorDeserialize()
252 ret = read_from_buffer(&payload, end, &enrolled_password); in nonErrorDeserialize()
257 return read_from_buffer(&payload, end, &password_handle); in nonErrorDeserialize()
277 gatekeeper_error_t EnrollResponse::nonErrorDeserialize(const uint8_t *payload, const uint8_t *end) { in nonErrorDeserialize() argument
280 return read_from_buffer(&payload, end, &enrolled_password_handle); in nonErrorDeserialize()