OLD | NEW |
1 /* ssl/s3_clnt.c */ | 1 /* ssl/s3_clnt.c */ |
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 goto err; | 750 goto err; |
751 } | 751 } |
752 /* else use the pre-loaded session */ | 752 /* else use the pre-loaded session */ |
753 | 753 |
754 p=s->s3->client_random; | 754 p=s->s3->client_random; |
755 Time=(unsigned long)time(NULL); /* Time */ | 755 Time=(unsigned long)time(NULL); /* Time */ |
756 l2n(Time,p); | 756 l2n(Time,p); |
757 if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0) | 757 if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0) |
758 goto err; | 758 goto err; |
759 | 759 |
760 » » /* Do the message type and length last */ | 760 » » /* Do the message type and length last. |
| 761 » » * Note: the code to add the padding extension in t1_lib.c |
| 762 » » * depends on the size of this prefix. */ |
761 d=p= &(buf[4]); | 763 d=p= &(buf[4]); |
762 | 764 |
763 /* version indicates the negotiated version: for example from | 765 /* version indicates the negotiated version: for example from |
764 * an SSLv2/v3 compatible client hello). The client_version | 766 * an SSLv2/v3 compatible client hello). The client_version |
765 * field is the maximum version we permit and it is also | 767 * field is the maximum version we permit and it is also |
766 * used in RSA encrypted premaster secrets. Some servers can | 768 * used in RSA encrypted premaster secrets. Some servers can |
767 * choke if we initially report a higher version then | 769 * choke if we initially report a higher version then |
768 * renegotiate to a lower one in the premaster secret. This | 770 * renegotiate to a lower one in the premaster secret. This |
769 * didn't happen with TLS 1.0 as most servers supported it | 771 * didn't happen with TLS 1.0 as most servers supported it |
770 * but it can with TLS 1.1 or later if the server only supports | 772 * but it can with TLS 1.1 or later if the server only supports |
(...skipping 2797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3568 SSL_get_client_CA_list(s), | 3570 SSL_get_client_CA_list(s), |
3569 px509, ppkey, NULL, NULL, NULL); | 3571 px509, ppkey, NULL, NULL, NULL); |
3570 if (i != 0) | 3572 if (i != 0) |
3571 return i; | 3573 return i; |
3572 } | 3574 } |
3573 #endif | 3575 #endif |
3574 if (s->ctx->client_cert_cb) | 3576 if (s->ctx->client_cert_cb) |
3575 i = s->ctx->client_cert_cb(s,px509,ppkey); | 3577 i = s->ctx->client_cert_cb(s,px509,ppkey); |
3576 return i; | 3578 return i; |
3577 } | 3579 } |
OLD | NEW |