Mercurial > hg > nginx-quic
comparison src/event/ngx_event_openssl.c @ 5330:314c3d7cc3a5
Backed out f1a91825730a and 7094bd12c1ff.
While ngx_get_full_name() might have a bit more descriptive arguments,
the ngx_conf_full_name() is generally easier to use when parsing
configuration and limits exposure of cycle->prefix / cycle->conf_prefix
details.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 20 Aug 2013 21:11:19 +0400 |
parents | f1a91825730a |
children | 6c35a1f428f2 |
comparison
equal
deleted
inserted
replaced
5329:00bdc9f08a16 | 5330:314c3d7cc3a5 |
---|---|
238 { | 238 { |
239 BIO *bio; | 239 BIO *bio; |
240 X509 *x509; | 240 X509 *x509; |
241 u_long n; | 241 u_long n; |
242 | 242 |
243 if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, cert) != NGX_OK) { | 243 if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) { |
244 return NGX_ERROR; | 244 return NGX_ERROR; |
245 } | 245 } |
246 | 246 |
247 /* | 247 /* |
248 * we can't use SSL_CTX_use_certificate_chain_file() as it doesn't | 248 * we can't use SSL_CTX_use_certificate_chain_file() as it doesn't |
317 } | 317 } |
318 } | 318 } |
319 | 319 |
320 BIO_free(bio); | 320 BIO_free(bio); |
321 | 321 |
322 if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, key) != NGX_OK) { | 322 if (ngx_conf_full_name(cf->cycle, key, 1) != NGX_OK) { |
323 return NGX_ERROR; | 323 return NGX_ERROR; |
324 } | 324 } |
325 | 325 |
326 if (SSL_CTX_use_PrivateKey_file(ssl->ctx, (char *) key->data, | 326 if (SSL_CTX_use_PrivateKey_file(ssl->ctx, (char *) key->data, |
327 SSL_FILETYPE_PEM) | 327 SSL_FILETYPE_PEM) |
348 | 348 |
349 if (cert->len == 0) { | 349 if (cert->len == 0) { |
350 return NGX_OK; | 350 return NGX_OK; |
351 } | 351 } |
352 | 352 |
353 if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, cert) != NGX_OK) { | 353 if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) { |
354 return NGX_ERROR; | 354 return NGX_ERROR; |
355 } | 355 } |
356 | 356 |
357 if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL) | 357 if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL) |
358 == 0) | 358 == 0) |
392 | 392 |
393 if (cert->len == 0) { | 393 if (cert->len == 0) { |
394 return NGX_OK; | 394 return NGX_OK; |
395 } | 395 } |
396 | 396 |
397 if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, cert) != NGX_OK) { | 397 if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) { |
398 return NGX_ERROR; | 398 return NGX_ERROR; |
399 } | 399 } |
400 | 400 |
401 if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL) | 401 if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL) |
402 == 0) | 402 == 0) |
419 | 419 |
420 if (crl->len == 0) { | 420 if (crl->len == 0) { |
421 return NGX_OK; | 421 return NGX_OK; |
422 } | 422 } |
423 | 423 |
424 if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, crl) != NGX_OK) { | 424 if (ngx_conf_full_name(cf->cycle, crl, 1) != NGX_OK) { |
425 return NGX_ERROR; | 425 return NGX_ERROR; |
426 } | 426 } |
427 | 427 |
428 store = SSL_CTX_get_cert_store(ssl->ctx); | 428 store = SSL_CTX_get_cert_store(ssl->ctx); |
429 | 429 |
585 DH_free(dh); | 585 DH_free(dh); |
586 | 586 |
587 return NGX_OK; | 587 return NGX_OK; |
588 } | 588 } |
589 | 589 |
590 if (ngx_get_full_name(cf->pool, &cf->cycle->conf_prefix, file) != NGX_OK) { | 590 if (ngx_conf_full_name(cf->cycle, file, 1) != NGX_OK) { |
591 return NGX_ERROR; | 591 return NGX_ERROR; |
592 } | 592 } |
593 | 593 |
594 bio = BIO_new_file((char *) file->data, "r"); | 594 bio = BIO_new_file((char *) file->data, "r"); |
595 if (bio == NULL) { | 595 if (bio == NULL) { |