163 | 163 |
|
164 | 164 |
#endif
|
165 | 165 |
|
166 | |
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
167 | 166 |
#ifndef SSL_OP_NO_COMPRESSION
|
168 | 167 |
{
|
169 | 168 |
/*
|
|
181 | 180 |
}
|
182 | 181 |
}
|
183 | 182 |
#endif
|
184 | |
#endif
|
185 | 183 |
|
186 | 184 |
ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
|
187 | 185 |
|
|
902 | 900 |
"SSL_load_client_CA_file(\"%s\") failed", cert->data);
|
903 | 901 |
return NGX_ERROR;
|
904 | 902 |
}
|
905 | |
|
906 | |
/*
|
907 | |
* before 0.9.7h and 0.9.8 SSL_load_client_CA_file()
|
908 | |
* always leaved an error in the error queue
|
909 | |
*/
|
910 | |
|
911 | |
ERR_clear_error();
|
912 | 903 |
|
913 | 904 |
SSL_CTX_set_client_CA_list(ssl->ctx, list);
|
914 | 905 |
|
|
1075 | 1066 |
* added to wbio, and set buffer size.
|
1076 | 1067 |
*/
|
1077 | 1068 |
|
1078 | |
rbio = SSL_get_rbio((ngx_ssl_conn_t *) ssl_conn);
|
1079 | |
wbio = SSL_get_wbio((ngx_ssl_conn_t *) ssl_conn);
|
|
1069 |
rbio = SSL_get_rbio(ssl_conn);
|
|
1070 |
wbio = SSL_get_wbio(ssl_conn);
|
1080 | 1071 |
|
1081 | 1072 |
if (rbio != wbio) {
|
1082 | 1073 |
(void) BIO_set_write_buffer_size(wbio, NGX_SSL_BUFSIZE);
|
|
1359 | 1350 |
ngx_int_t
|
1360 | 1351 |
ngx_ssl_ecdh_curve(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *name)
|
1361 | 1352 |
{
|
1362 | |
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
1363 | 1353 |
#ifndef OPENSSL_NO_ECDH
|
1364 | 1354 |
|
1365 | 1355 |
/*
|
|
1432 | 1422 |
SSL_CTX_set_tmp_ecdh(ssl->ctx, ecdh);
|
1433 | 1423 |
|
1434 | 1424 |
EC_KEY_free(ecdh);
|
1435 | |
#endif
|
1436 | 1425 |
#endif
|
1437 | 1426 |
#endif
|
1438 | 1427 |
|
|
3363 | 3352 |
}
|
3364 | 3353 |
}
|
3365 | 3354 |
|
3366 | |
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
3367 | |
|
3368 | 3355 |
session_id = (u_char *) SSL_SESSION_get_id(sess, &session_id_length);
|
3369 | |
|
3370 | |
#else
|
3371 | |
|
3372 | |
session_id = sess->session_id;
|
3373 | |
session_id_length = sess->session_id_length;
|
3374 | |
|
3375 | |
#endif
|
3376 | 3356 |
|
3377 | 3357 |
#if (NGX_PTR_SIZE == 8)
|
3378 | 3358 |
|
|
3449 | 3429 |
#endif
|
3450 | 3430 |
u_char *id, int len, int *copy)
|
3451 | 3431 |
{
|
3452 | |
#if OPENSSL_VERSION_NUMBER >= 0x0090707fL
|
3453 | |
const
|
3454 | |
#endif
|
3455 | |
u_char *p;
|
3456 | 3432 |
size_t slen;
|
3457 | 3433 |
uint32_t hash;
|
3458 | 3434 |
ngx_int_t rc;
|
|
3435 |
const u_char *p;
|
3459 | 3436 |
ngx_shm_zone_t *shm_zone;
|
3460 | 3437 |
ngx_slab_pool_t *shpool;
|
3461 | 3438 |
ngx_rbtree_node_t *node, *sentinel;
|
|
3577 | 3554 |
|
3578 | 3555 |
cache = shm_zone->data;
|
3579 | 3556 |
|
3580 | |
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
3581 | |
|
3582 | 3557 |
id = (u_char *) SSL_SESSION_get_id(sess, &len);
|
3583 | |
|
3584 | |
#else
|
3585 | |
|
3586 | |
id = sess->session_id;
|
3587 | |
len = sess->session_id_length;
|
3588 | |
|
3589 | |
#endif
|
3590 | 3558 |
|
3591 | 3559 |
hash = ngx_crc32_short(id, len);
|
3592 | 3560 |
|
|
4386 | 4354 |
return NGX_OK;
|
4387 | 4355 |
}
|
4388 | 4356 |
|
4389 | |
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
4390 | |
|
4391 | 4357 |
buf = (u_char *) SSL_SESSION_get_id(sess, &len);
|
4392 | |
|
4393 | |
#else
|
4394 | |
|
4395 | |
buf = sess->session_id;
|
4396 | |
len = sess->session_id_length;
|
4397 | |
|
4398 | |
#endif
|
4399 | 4358 |
|
4400 | 4359 |
s->len = 2 * len;
|
4401 | 4360 |
s->data = ngx_pnalloc(pool, 2 * len);
|