| OLD | NEW |
| 1 /* ssl/t1_lib.c */ | 1 /* ssl/t1_lib.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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 ret += 2; | 265 ret += 2; |
| 266 itmp = i2d_OCSP_RESPID(id, &ret); | 266 itmp = i2d_OCSP_RESPID(id, &ret); |
| 267 /* write id len */ | 267 /* write id len */ |
| 268 s2n(itmp, q); | 268 s2n(itmp, q); |
| 269 } | 269 } |
| 270 s2n(extlen, ret); | 270 s2n(extlen, ret); |
| 271 if (extlen > 0) | 271 if (extlen > 0) |
| 272 i2d_X509_EXTENSIONS(s->tlsext_ocsp_exts, &ret); | 272 i2d_X509_EXTENSIONS(s->tlsext_ocsp_exts, &ret); |
| 273 } | 273 } |
| 274 | 274 |
| 275 » if (s->ctx->next_proto_select_cb) | 275 » if (s->next_proto_select_cb) |
| 276 { | 276 { |
| 277 /* The client advertises an emtpy extension to indicate its | 277 /* The client advertises an emtpy extension to indicate its |
| 278 * support for Next Protocol Negotiation */ | 278 * support for Next Protocol Negotiation */ |
| 279 if (limit - ret - 4 < 0) | 279 if (limit - ret - 4 < 0) |
| 280 return NULL; | 280 return NULL; |
| 281 s2n(TLSEXT_TYPE_next_proto_neg,ret); | 281 s2n(TLSEXT_TYPE_next_proto_neg,ret); |
| 282 s2n(0,ret); | 282 s2n(0,ret); |
| 283 } | 283 } |
| 284 | 284 |
| 285 if ((extdatalen = ret-p-2)== 0) | 285 if ((extdatalen = ret-p-2)== 0) |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 } | 915 } |
| 916 /* Set flag to expect CertificateStatus message */ | 916 /* Set flag to expect CertificateStatus message */ |
| 917 s->tlsext_status_expected = 1; | 917 s->tlsext_status_expected = 1; |
| 918 } | 918 } |
| 919 else if (type == TLSEXT_TYPE_next_proto_neg) | 919 else if (type == TLSEXT_TYPE_next_proto_neg) |
| 920 { | 920 { |
| 921 unsigned char *selected; | 921 unsigned char *selected; |
| 922 unsigned char selected_len; | 922 unsigned char selected_len; |
| 923 | 923 |
| 924 /* We must have requested it. */ | 924 /* We must have requested it. */ |
| 925 » » » if ((s->ctx->next_proto_select_cb == NULL)) | 925 » » » if ((s->next_proto_select_cb == NULL)) |
| 926 { | 926 { |
| 927 *al = TLS1_AD_UNSUPPORTED_EXTENSION; | 927 *al = TLS1_AD_UNSUPPORTED_EXTENSION; |
| 928 return 0; | 928 return 0; |
| 929 } | 929 } |
| 930 /* The data must be valid */ | 930 /* The data must be valid */ |
| 931 if (!ssl_next_proto_validate(data, size)) | 931 if (!ssl_next_proto_validate(data, size)) |
| 932 { | 932 { |
| 933 *al = TLS1_AD_DECODE_ERROR; | 933 *al = TLS1_AD_DECODE_ERROR; |
| 934 return 0; | 934 return 0; |
| 935 } | 935 } |
| 936 » » » if (s->ctx->next_proto_select_cb(s, &selected, &selected
_len, data, size, s->ctx->next_proto_select_cb_arg) != SSL_TLSEXT_ERR_OK) | 936 » » » if (s->next_proto_select_cb(s, &selected, &selected_len,
data, size, s->next_proto_select_cb_arg) != SSL_TLSEXT_ERR_OK) |
| 937 { | 937 { |
| 938 *al = TLS1_AD_INTERNAL_ERROR; | 938 *al = TLS1_AD_INTERNAL_ERROR; |
| 939 return 0; | 939 return 0; |
| 940 } | 940 } |
| 941 s->next_proto_negotiated = OPENSSL_malloc(selected_len); | 941 s->next_proto_negotiated = OPENSSL_malloc(selected_len); |
| 942 if (!s->next_proto_negotiated) | 942 if (!s->next_proto_negotiated) |
| 943 { | 943 { |
| 944 *al = TLS1_AD_INTERNAL_ERROR; | 944 *al = TLS1_AD_INTERNAL_ERROR; |
| 945 return 0; | 945 return 0; |
| 946 } | 946 } |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 } | 1276 } |
| 1277 /* If session decrypt failure indicate a cache miss and set state to | 1277 /* If session decrypt failure indicate a cache miss and set state to |
| 1278 * send a new ticket | 1278 * send a new ticket |
| 1279 */ | 1279 */ |
| 1280 tickerr: | 1280 tickerr: |
| 1281 s->tlsext_ticket_expected = 1; | 1281 s->tlsext_ticket_expected = 1; |
| 1282 return 0; | 1282 return 0; |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 #endif | 1285 #endif |
| OLD | NEW |