Home | History | Annotate | Download | only in ssl

Lines Matching refs:rr

173 static DTLS1_BITMAP *dtls1_get_bitmap(SSL *s, SSL3_RECORD *rr, 
176 static int dtls1_record_needs_buffering(SSL *s, SSL3_RECORD *rr,
381 SSL3_RECORD *rr;
385 rr= &(s->s3->rrec);
388 /* At this point, s->packet_length == SSL3_RT_HEADER_LNGTH + rr->length,
391 rr->input= &(s->packet[DTLS1_RT_HEADER_LENGTH]);
393 /* ok, we can now read from 's->packet' data into 'rr'
394 * rr->input points at rr->length bytes, which
395 * need to be copied into rr->data by either
397 * When the data is 'copied' into the rr->data buffer,
398 * rr->input will be pointed at the new buffer */
401 * rr->length bytes of encrypted compressed stuff. */
404 if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH)
411 /* decrypt in place in 'rr->input' */
412 rr->data=rr->input;
422 rr->length = 0;
428 printf("dec %d\n",rr->length);
429 { unsigned int z; for (z=0; z<rr->length; z++) printf("%02X%c",rr->data[z],((z+1)%16)?' ':'\n'); }
444 /* kludge: *_cbc_remove_padding passes padding length in rr->type */
445 orig_len = rr->length+((unsigned int)rr->type>>8);
470 ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len);
471 rr->length -= mac_size;
478 rr->length -= mac_size;
479 mac = &rr->data[rr->length];
485 if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH+mac_size)
492 rr->length = 0;
500 if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH)
514 if (rr->length > SSL3_RT_MAX_PLAIN_LENGTH)
521 rr->off=0;
555 SSL3_RECORD *rr;
561 rr= &(s->s3->rrec);
593 rr->type= *(p++);
599 n2s(p,rr->epoch);
604 n2s(p,rr->length);
612 rr->length = 0;
621 rr->length = 0;
626 if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH)
629 rr->length = 0;
639 if (rr->length > s->packet_length-DTLS1_RT_HEADER_LENGTH)
642 i=rr->length;
649 rr->length = 0;
654 /* now n == rr->length,
655 * and s->packet_length == DTLS1_RT_HEADER_LENGTH + rr->length */
660 bitmap = dtls1_get_bitmap(s, rr, &is_next_epoch);
663 rr->length = 0;
679 if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
683 rr->length = 0;
692 if (rr->length == 0) goto again;
703 dtls1_buffer_record(s, &(s->d1->unprocessed_rcds), rr->seq_num);
705 rr->length = 0;
712 rr->length = 0;
752 SSL3_RECORD *rr;
803 rr = &(s->s3->rrec);
809 if (s->state == SSL_ST_OK && rr->length == 0)
836 if ((rr->length == 0) || (s->rstate == SSL_ST_READ_BODY))
854 && (rr->type != SSL3_RT_HANDSHAKE))
861 dtls1_buffer_record(s, &(s->d1->buffered_app_data), rr->seq_num);
862 rr->length = 0;
870 rr->length=0;
876 if (type == rr->type) /* SSL3_RT_APPLICATION_DATA or SSL3_RT_HANDSHAKE */
890 if ((unsigned int)len > rr->length)
891 n = rr->length;
895 memcpy(buf,&(rr->data[rr->off]),n);
898 rr->length-=n;
899 rr->off+=n;
900 if (rr->length == 0)
903 rr->off=0;
912 rr->type == SSL3_RT_APPLICATION_DATA &&
935 /* If we get here, then type != rr->type; if we have a handshake
946 if (rr->type == SSL3_RT_HANDSHAKE)
952 else if (rr->type == SSL3_RT_ALERT)
959 else if (rr->type == TLS1_RT_HEARTBEAT)
964 rr->length = 0;
972 else if (rr->type != SSL3_RT_CHANGE_CIPHER_SPEC)
977 if (rr->type == SSL3_RT_APPLICATION_DATA)
998 if ( rr->length < dest_maxlen)
1002 * for normal alerts rr->length is 2, while
1009 rr->length = 0;
1016 dest[k] = rr->data[rr->off++];
1017 rr->length--;
1023 /* s->d1->handshake_fragment_len == 12 iff rr->type == SSL3_RT_HANDSHAKE;
1024 * s->d1->alert_fragment_len == 7 iff rr->type == SSL3_RT_ALERT.
1025 * (Possibly rr is 'empty' now, i.e. rr->length may be 0.) */
1186 rr->length=0;
1190 if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC)
1195 dtls1_get_ccs_header(rr->data, &ccs_hdr);
1203 if ( (rr->length != ccs_hdr_len) ||
1204 (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS))
1211 rr->length=0;
1215 rr->data, 1, s, s->msg_callback_arg);
1256 dtls1_get_message_header(rr->data, &msg_hdr);
1257 if( rr->epoch != s->d1->r_epoch)
1259 rr->length = 0;
1272 rr->length = 0;
1318 switch (rr->type)
1325 rr->length = 0;
1337 * should not happen when type != rr->type */
1786 dtls1_get_bitmap(SSL *s, SSL3_RECORD *rr, unsigned int *is_next_epoch)
1792 if (rr->epoch == s->d1->r_epoch)
1796 else if (rr->epoch == (unsigned long)(s->d1->r_epoch + 1) &&
1797 (rr->type == SSL3_RT_HANDSHAKE ||
1798 rr->type == SSL3_RT_ALERT))
1809 dtls1_record_needs_buffering(SSL *s, SSL3_RECORD *rr, unsigned short *priority,
1814 if ( rr->type == SSL3_RT_APPLICATION_DATA ||
1815 rr->type == SSL3_RT_ALERT)
1823 unsigned char *data = rr->data;
1825 if ( rr->type == SSL3_RT_HANDSHAKE ||
1826 rr->type == SSL3_RT_CHANGE_CIPHER_SPEC)
1832 if ( rr->type == SSL3_RT_HANDSHAKE)
1850 if (rr->type == SSL3_RT_HANDSHAKE &&
1855 (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC ||