• Home
  • Raw
  • Download

Lines Matching refs:frag

155   UniquePtr<hm_fragment> frag = MakeUnique<hm_fragment>();  in dtls1_hm_fragment_new()  local
156 if (!frag) { in dtls1_hm_fragment_new()
159 frag->type = msg_hdr->type; in dtls1_hm_fragment_new()
160 frag->seq = msg_hdr->seq; in dtls1_hm_fragment_new()
161 frag->msg_len = msg_hdr->msg_len; in dtls1_hm_fragment_new()
164 frag->data = in dtls1_hm_fragment_new()
166 if (frag->data == NULL) { in dtls1_hm_fragment_new()
171 if (!CBB_init_fixed(cbb.get(), frag->data, DTLS1_HM_HEADER_LENGTH) || in dtls1_hm_fragment_new()
190 frag->reassembly = (uint8_t *)OPENSSL_malloc(bitmask_len); in dtls1_hm_fragment_new()
191 if (frag->reassembly == NULL) { in dtls1_hm_fragment_new()
195 OPENSSL_memset(frag->reassembly, 0, bitmask_len); in dtls1_hm_fragment_new()
198 return frag; in dtls1_hm_fragment_new()
211 static void dtls1_hm_fragment_mark(hm_fragment *frag, size_t start, in dtls1_hm_fragment_mark() argument
213 size_t msg_len = frag->msg_len; in dtls1_hm_fragment_mark()
215 if (frag->reassembly == NULL || start > end || end > msg_len) { in dtls1_hm_fragment_mark()
227 frag->reassembly[start >> 3] |= bit_range(start & 7, end & 7); in dtls1_hm_fragment_mark()
229 frag->reassembly[start >> 3] |= bit_range(start & 7, 8); in dtls1_hm_fragment_mark()
231 frag->reassembly[i] = 0xff; in dtls1_hm_fragment_mark()
234 frag->reassembly[end >> 3] |= bit_range(0, end & 7); in dtls1_hm_fragment_mark()
240 if (frag->reassembly[i] != 0xff) { in dtls1_hm_fragment_mark()
245 frag->reassembly[msg_len >> 3] != bit_range(0, msg_len & 7)) { in dtls1_hm_fragment_mark()
249 OPENSSL_free(frag->reassembly); in dtls1_hm_fragment_mark()
250 frag->reassembly = NULL; in dtls1_hm_fragment_mark()
257 hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); in dtls1_is_current_message_complete() local
258 return frag != NULL && frag->reassembly == NULL; in dtls1_is_current_message_complete()
274 hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); in dtls1_get_incoming_message() local
275 if (frag != NULL) { in dtls1_get_incoming_message()
276 assert(frag->seq == msg_hdr->seq); in dtls1_get_incoming_message()
279 if (frag->type != msg_hdr->type || in dtls1_get_incoming_message()
280 frag->msg_len != msg_hdr->msg_len) { in dtls1_get_incoming_message()
285 return frag; in dtls1_get_incoming_message()
387 hm_fragment *frag = dtls1_get_incoming_message(ssl, out_alert, &msg_hdr); in dtls1_open_handshake() local
388 if (frag == NULL) { in dtls1_open_handshake()
391 assert(frag->msg_len == msg_len); in dtls1_open_handshake()
393 if (frag->reassembly == NULL) { in dtls1_open_handshake()
400 OPENSSL_memcpy(frag->data + DTLS1_HM_HEADER_LENGTH + frag_off, in dtls1_open_handshake()
402 dtls1_hm_fragment_mark(frag, frag_off, frag_off + frag_len); in dtls1_open_handshake()
414 hm_fragment *frag = ssl->d1->incoming_messages[idx].get(); in dtls1_get_message() local
415 out->type = frag->type; in dtls1_get_message()
416 CBS_init(&out->body, frag->data + DTLS1_HM_HEADER_LENGTH, frag->msg_len); in dtls1_get_message()
417 CBS_init(&out->raw, frag->data, DTLS1_HM_HEADER_LENGTH + frag->msg_len); in dtls1_get_message()
695 uint8_t *frag = out + prefix; in seal_next_message() local
697 if (!CBB_init_fixed(cbb.get(), frag, max_frag) || in seal_next_message()
710 MakeSpan(frag, frag_len)); in seal_next_message()