Lines Matching refs:rr

288 	SSL3_RECORD *rr;
304 rr= &(s->s3->rrec);
332 rr->type= *(p++);
336 n2s(p,rr->length);
338 fprintf(stderr, "Record type=%d, Length=%d\n", rr->type, rr->length);
364 if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH - align)
366 if ((p=OPENSSL_realloc(s->s3->rbuf.buf, rr->length + SSL3_RT_HEADER_LENGTH + align))==NULL)
372 s->s3->rbuf.len=rr->length + SSL3_RT_HEADER_LENGTH + align;
376 if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH)
388 if (rr->length > s->packet_length-SSL3_RT_HEADER_LENGTH)
391 i=rr->length;
394 /* now n == rr->length,
395 * and s->packet_length == SSL3_RT_HEADER_LENGTH + rr->length */
400 /* At this point, s->packet_length == SSL3_RT_HEADER_LNGTH + rr->length,
403 rr->input= &(s->packet[SSL3_RT_HEADER_LENGTH]);
405 /* ok, we can now read from 's->packet' data into 'rr'
406 * rr->input points at rr->length bytes, which
407 * need to be copied into rr->data by either
409 * When the data is 'copied' into the rr->data buffer,
410 * rr->input will be pointed at the new buffer */
413 * rr->length bytes of encrypted compressed stuff. */
416 if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH+extra)
423 /* decrypt in place in 'rr->input' */
424 rr->data=rr->input;
441 printf("dec %d\n",rr->length);
442 { unsigned int z; for (z=0; z<rr->length; z++) printf("%02X%c",rr->data[z],((z+1)%16)?' ':'\n'); }
458 if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH+extra+mac_size)
460 #if 0 /* OK only for stream ciphers (then rr->length is visible from ciphertext anyway) */
468 /* check the MAC for rr->input (it's in mac_size bytes at the tail) */
469 if (rr->length >= (unsigned int)mac_size)
471 rr->length -= mac_size;
472 mac = &rr->data[rr->length];
483 rr->length = 0;
508 if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH+extra)
522 if (rr->length > SSL3_RT_MAX_PLAIN_LENGTH+extra)
529 rr->off=0;
542 if (rr->length == 0) goto again;
545 fprintf(stderr, "Ultimate Record type=%d, Length=%d\n", rr->type, rr->length);
560 SSL3_RECORD *rr;
562 rr= &(ssl->s3->rrec);
563 i=COMP_expand_block(ssl->expand,rr->comp,
564 SSL3_RT_MAX_PLAIN_LENGTH,rr->data,(int)rr->length);
568 rr->length=i;
569 rr->data=rr->comp;
979 SSL3_RECORD *rr;
1034 rr = &(s->s3->rrec);
1037 if ((rr->length == 0) || (s->rstate == SSL_ST_READ_BODY))
1047 && (rr->type != SSL3_RT_HANDSHAKE))
1058 rr->length=0;
1064 if (type == rr->type) /* SSL3_RT_APPLICATION_DATA or SSL3_RT_HANDSHAKE */
1078 if ((unsigned int)len > rr->length)
1079 n = rr->length;
1083 memcpy(buf,&(rr->data[rr->off]),n);
1086 rr->length-=n;
1087 rr->off+=n;
1088 if (rr->length == 0)
1091 rr->off=0;
1100 /* If we get here, then type != rr->type; if we have a handshake
1111 if (rr->type == SSL3_RT_HANDSHAKE)
1117 else if (rr->type == SSL3_RT_ALERT)
1124 else if (rr->type == TLS1_RT_HEARTBEAT)
1129 rr->length = 0;
1140 if (rr->length < n)
1141 n = rr->length; /* available bytes */
1146 dest[(*dest_len)++] = rr->data[rr->off++];
1147 rr->length--;
1155 /* s->s3->handshake_fragment_len == 4 iff rr->type == SSL3_RT_HANDSHAKE;
1156 * s->s3->alert_fragment_len == 2 iff rr->type == SSL3_RT_ALERT.
1157 * (Possibly rr is 'empty' now, i.e. rr->length may be 0.) */
1231 rr->length = 0;
1310 rr->length=0;
1314 if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC)
1318 if ( (rr->length != 1) || (rr->off != 0) ||
1319 (rr->data[0] != SSL3_MT_CCS))
1334 rr->length=0;
1337 s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, rr->data, 1, s, s->msg_callback_arg);
1391 switch (rr->type)
1400 rr->length = 0;
1412 * should not happen when type != rr->type */