MCPcopy Create free account
hub / github.com/apache/httpd / ssl_init_Engine

Function ssl_init_Engine

modules/ssl/ssl_engine_init.c:595–631  ·  view source on GitHub ↗

* Support for external a Crypto Device ("engine"), usually * a hardware accelerator card for crypto operations. */

Source from the content-addressed store, hash-verified

593 * a hardware accelerator card for crypto operations.
594 */
595apr_status_t ssl_init_Engine(server_rec *s, apr_pool_t *p)
596{
597#if MODSSL_HAVE_ENGINE_API
598 SSLModConfigRec *mc = myModConfig(s);
599 ENGINE *e;
600
601 if (mc->szCryptoDevice) {
602 if (!(e = ENGINE_by_id(mc->szCryptoDevice))) {
603 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01888)
604 "Init: Failed to load Crypto Device API `%s'",
605 mc->szCryptoDevice);
606 ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
607 return ssl_die(s);
608 }
609
610#ifdef ENGINE_CTRL_CHIL_SET_FORKCHECK
611 if (strEQ(mc->szCryptoDevice, "chil")) {
612 ENGINE_ctrl(e, ENGINE_CTRL_CHIL_SET_FORKCHECK, 1, 0, 0);
613 }
614#endif
615
616 if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
617 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01889)
618 "Init: Failed to enable Crypto Device API `%s'",
619 mc->szCryptoDevice);
620 ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
621 return ssl_die(s);
622 }
623 ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, APLOGNO(01890)
624 "Init: loaded Crypto Device API `%s'",
625 mc->szCryptoDevice);
626
627 ENGINE_free(e);
628 }
629#endif
630 return APR_SUCCESS;
631}
632
633#ifdef HAVE_TLSEXT
634static apr_status_t ssl_init_ctx_tls_extensions(server_rec *s,

Callers 1

ssl_init_ModuleFunction · 0.85

Calls 3

ssl_log_ssl_errorFunction · 0.85
ssl_dieFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected