• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/OpenSSL098-52/src/ssl/

Lines Matching defs:?r

20  * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
23 * Redistribution and use in source and binary forms, with or without
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
37 * 4. If you include any Windows specific code (or a derivative thereof) from
53 * The licence and distribution terms for any publically available version or
61 * Redistribution and use in source and binary forms, with or without
70 * the documentation and/or other materials provided with the
73 * 3. All advertising materials mentioning features or use of this
79 * endorse or promote products derived from this software without
233 * or non-blocking IO.
244 SSL3_RECORD *rr;
252 rr= &(s->s3->rrec);
273 if (n <= 0) return(n); /* error or non-blocking */
279 rr->type= *(p++);
283 n2s(p,rr->length);
305 if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH+extra)
317 if (rr->length > s->packet_length-SSL3_RT_HEADER_LENGTH)
320 i=rr->length;
322 if (n <= 0) return(n); /* error or non-blocking io */
323 /* now n == rr->length,
324 * and s->packet_length == SSL3_RT_HEADER_LENGTH + rr->length */
329 /* At this point, s->packet_length == SSL3_RT_HEADER_LNGTH + rr->length,
332 rr->input= &(s->packet[SSL3_RT_HEADER_LENGTH]);
334 /* ok, we can now read from 's->packet' data into 'rr'
335 * rr->input points at rr->length bytes, which
336 * need to be copied into rr->data by either
337 * the decryption or by the decompression
338 * When the data is 'copied' into the rr->data buffer,
339 * rr->input will be pointed at the new buffer */
342 * rr->length bytes of encrypted compressed stuff. */
345 if (rr->length > SSL3_RT_MAX_ENCRYPTED_LENGTH+extra)
352 /* decrypt in place in 'rr->input' */
353 rr->data=rr->input;
368 printf("dec %d\n",rr->length);
369 { unsigned int z; for (z=0; z<rr->length; z++) printf("%02X%c",rr->data[z],((z+1)%16)?' ':'\n'); }
384 /* kludge: *_cbc_remove_padding passes padding length in rr->type */
385 orig_len = rr->length+((unsigned int)rr->type>>8);
410 ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len);
411 rr->length -= mac_size;
418 rr->length -= mac_size;
419 mac = &rr->data[rr->length];
425 if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH+extra+mac_size)
444 if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH+extra)
458 if (rr->length > SSL3_RT_MAX_PLAIN_LENGTH+extra)
465 rr->off=0;
478 if (rr->length == 0) goto again;
492 SSL3_RECORD *rr;
494 rr= &(ssl->s3->rrec);
495 i=COMP_expand_block(ssl->expand,rr->comp,
496 SSL3_RT_MAX_PLAIN_LENGTH,rr->data,(int)rr->length);
500 rr->length=i;
501 rr->data=rr->comp;
510 SSL3_RECORD *wr;
512 wr= &(ssl->s3->wrec);
513 i=COMP_compress_block(ssl->compress,wr->data,
515 wr->input,(int)wr->length);
519 wr->length=i;
521 wr->input=wr->data;
527 * It will return <= 0 if not all data has been sent or non-blocking IO.
604 SSL3_RECORD *wr;
625 wr= &(s->s3->wrec);
671 wr->type=type;
681 wr->data=p;
682 wr->length=(int)len;
683 wr->input=(unsigned char *)buf;
685 /* we now 'read' from wr->input, wr->length bytes into
686 * wr->data */
699 memcpy(wr->data,wr->input,wr->length);
700 wr->input=wr->data;
703 /* we should still have the output to wr->data and the input
704 * from wr->input. Length should be wr->length.
705 * wr->data still points in the wb->buf */
709 s->method->ssl3_enc->mac(s,&(p[wr->length]),1);
710 wr->length+=mac_size;
711 wr->input=p;
712 wr->data=p;
719 s2n(wr->length,plen);
722 * wr->data pointing to the encrypted data, which is
723 * wr->length long */
724 wr->type=type; /* not needed but helps for debugging */
725 wr->length+=SSL3_RT_HEADER_LENGTH;
732 return wr->length;
736 wb->left = prefix_len + wr->length;
814 * a surprise, but handled as if it were), or renegotiation requests.
833 SSL3_RECORD *rr;
888 rr = &(s->s3->rrec);
891 if ((rr->length == 0) || (s->rstate == SSL_ST_READ_BODY))
901 && (rr->type != SSL3_RT_HANDSHAKE))
912 rr->length=0;
918 if (type == rr->type) /* SSL3_RT_APPLICATION_DATA or SSL3_RT_HANDSHAKE */
932 if ((unsigned int)len > rr->length)
933 n = rr->length;
937 memcpy(buf,&(rr->data[rr->off]),n);
940 rr->length-=n;
941 rr->off+=n;
942 if (rr->length == 0)
945 rr->off=0;
952 /* If we get here, then type != rr->type; if we have a handshake
953 * message, then it was unexpected (Hello Request or Client Hello). */
963 if (rr->type == SSL3_RT_HANDSHAKE)
969 else if (rr->type == SSL3_RT_ALERT)
979 if (rr->length < n)
980 n = rr->length; /* available bytes */
985 dest[(*dest_len)++] = rr->data[rr->off++];
986 rr->length--;
994 /* s->s3->handshake_fragment_len == 4 iff rr->type == SSL3_RT_HANDSHAKE;
995 * s->s3->alert_fragment_len == 2 iff rr->type == SSL3_RT_ALERT.
996 * (Possibly rr is 'empty' now, i.e. rr->length may be 0.) */
1051 /* we either finished a handshake or ignored the request,
1070 rr->length = 0;
1145 rr->length=0;
1149 if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC)
1153 if ( (rr->length != 1) || (rr->off != 0) ||
1154 (rr->data[0] != SSL3_MT_CCS))
1178 rr->length=0;
1181 s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, rr->data, 1, s, s->msg_callback_arg);
1190 /* Unexpected handshake message (Client Hello, or protocol violation) */
1234 switch (rr->type)
1241 rr->length = 0;
1253 * should not happen when type != rr->type */