Lines Matching refs:rc

236                  const int rc, const char * const msg)  in elog()  argument
240 mbedtls_strerror(rc, buf, sizeof(buf)); in elog()
241 log_error(errh, file, line, "MTLS: %s: %s (-0x%04x)", msg, buf, -rc); in elog()
244 #define elog(errh, file, line, rc, msg) \ argument
245 log_error((errh), (file), (line), "MTLS: %s: (-0x%04x)", (msg), -(rc))
253 const int rc, const char * const fmt, ...) in elogf() argument
260 elog(errh, file, line, rc, msg); in elogf()
318 int rc = 0; /*(will retry on next check interval upon any error)*/ in mod_mbedtls_session_ticket_key_file() local
320 return rc; in mod_mbedtls_session_ticket_key_file()
334 rc = 1; in mod_mbedtls_session_ticket_key_file()
338 return rc; in mod_mbedtls_session_ticket_key_file()
357 int rc = mbedtls_ssl_ticket_rotate(&p->ticket_ctx, in mod_mbedtls_session_ticket_key_check() local
361 if (0 != rc) in mod_mbedtls_session_ticket_key_check()
362 elog(p->srv->errh, __FILE__,__LINE__, rc, in mod_mbedtls_session_ticket_key_check()
378 int rc = mbedtls_cipher_setkey(&key->ctx, stek->tick_aes_key, in mod_mbedtls_session_ticket_key_check()
381 if (0 != rc) { /* expire key immediately if error occurs */ in mod_mbedtls_session_ticket_key_check()
415 int rc = /* init RNG */ in mod_mbedtls_init_once_mbedtls() local
420 if (0 != rc) { in mod_mbedtls_init_once_mbedtls()
421 elog(srv->errh, __FILE__,__LINE__, rc, in mod_mbedtls_init_once_mbedtls()
641 int rc = in mod_mbedtls_construct_crt_chain() local
648 if (0 != rc) { /*(failure not unexpected since already parsed)*/ in mod_mbedtls_construct_crt_chain()
649 elog(errh, __FILE__, __LINE__, rc, "cert copy failed"); in mod_mbedtls_construct_crt_chain()
650 return rc; in mod_mbedtls_construct_crt_chain()
776 int rc = in mod_mbedtls_SNI() local
780 if (0 != rc) { in mod_mbedtls_SNI()
781 elogf(r->conf.errh, __FILE__, __LINE__, rc, in mod_mbedtls_SNI()
850 int rc = MBEDTLS_ERR_X509_FILE_IO_ERROR; in mod_mbedtls_x509_crl_parse_file() local
853 if (NULL == data) return rc; in mod_mbedtls_x509_crl_parse_file()
855 rc = mbedtls_x509_crl_parse(chain, (unsigned char *)data, (size_t)dlen+1); in mod_mbedtls_x509_crl_parse_file()
860 return rc; in mod_mbedtls_x509_crl_parse_file()
896 int rc = mbedtls_asn1_get_tag(&q, end, &len, in mod_mbedtls_x509_crt_ext_cb() local
899 if (0 != rc) in mod_mbedtls_x509_crt_ext_cb()
900 return MBEDTLS_ERR_X509_INVALID_EXTENSIONS + rc; in mod_mbedtls_x509_crt_ext_cb()
918 int rc = MBEDTLS_ERR_X509_FILE_IO_ERROR; in mod_mbedtls_x509_crt_parse_acme() local
921 if (NULL == data) return rc; in mod_mbedtls_x509_crt_parse_acme()
927 rc = mbedtls_pem_read_buffer(&pem, in mod_mbedtls_x509_crt_parse_acme()
931 if (0 == rc) { in mod_mbedtls_x509_crt_parse_acme()
940 rc = mbedtls_x509_crt_parse_der_with_ext_cb(chain,buf,buflen,1,cb,NULL); in mod_mbedtls_x509_crt_parse_acme()
948 return rc; in mod_mbedtls_x509_crt_parse_acme()
957 int rc = MBEDTLS_ERR_X509_FILE_IO_ERROR; in mod_mbedtls_x509_crt_parse_file() local
960 if (NULL == data) return rc; in mod_mbedtls_x509_crt_parse_file()
962 rc = mbedtls_x509_crt_parse(chain, (unsigned char *)data, (size_t)dlen+1); in mod_mbedtls_x509_crt_parse_file()
967 return rc; in mod_mbedtls_x509_crt_parse_file()
974 int rc = MBEDTLS_ERR_PK_FILE_IO_ERROR; in mod_mbedtls_pk_parse_keyfile() local
977 if (NULL == data) return rc; in mod_mbedtls_pk_parse_keyfile()
981 rc = mbedtls_pk_parse_key(ctx, (unsigned char *)data, (size_t)dlen+1, in mod_mbedtls_pk_parse_keyfile()
986 rc = mbedtls_pk_parse_key(ctx, (unsigned char *)data, (size_t)dlen+1, in mod_mbedtls_pk_parse_keyfile()
994 return rc; in mod_mbedtls_pk_parse_keyfile()
1003 int rc; in network_mbedtls_load_pemfile() local
1006 rc = mod_mbedtls_x509_crt_parse_file(&ssl_pemfile_x509, pemfile->ptr); in network_mbedtls_load_pemfile()
1007 if (0 != rc) { in network_mbedtls_load_pemfile()
1008 elogf(srv->errh, __FILE__, __LINE__, rc, in network_mbedtls_load_pemfile()
1018 rc = mod_mbedtls_pk_parse_keyfile(&ssl_pemfile_pkey, privkey->ptr, NULL); in network_mbedtls_load_pemfile()
1019 if (0 != rc) { in network_mbedtls_load_pemfile()
1020 elogf(srv->errh, __FILE__, __LINE__, rc, in network_mbedtls_load_pemfile()
1028 rc = mbedtls_pk_check_pair(&ssl_pemfile_x509.pk, &ssl_pemfile_pkey, in network_mbedtls_load_pemfile()
1031 rc = mbedtls_pk_check_pair(&ssl_pemfile_x509.pk, &ssl_pemfile_pkey); in network_mbedtls_load_pemfile()
1033 if (0 != rc) { in network_mbedtls_load_pemfile()
1034 elogf(srv->errh, __FILE__, __LINE__, rc, in network_mbedtls_load_pemfile()
1081 int rc = MBEDTLS_ERR_SSL_ILLEGAL_PARAMETER; in mod_mbedtls_acme_tls_1() local
1090 if (buffer_is_blank(name)) return rc; in mod_mbedtls_acme_tls_1()
1091 if (NULL != strchr(name->ptr, '/')) return rc; in mod_mbedtls_acme_tls_1()
1092 if (name->ptr[0] == '.') return rc; in mod_mbedtls_acme_tls_1()
1095 return rc; in mod_mbedtls_acme_tls_1()
1106 rc = mod_mbedtls_x509_crt_parse_acme(ssl_pemfile_x509, b->ptr); in mod_mbedtls_acme_tls_1()
1108 rc = mod_mbedtls_x509_crt_parse_file(ssl_pemfile_x509, b->ptr); in mod_mbedtls_acme_tls_1()
1110 if (0 != rc) { in mod_mbedtls_acme_tls_1()
1111 elogf(errh, __FILE__, __LINE__, rc, in mod_mbedtls_acme_tls_1()
1120 rc = mod_mbedtls_pk_parse_keyfile(ssl_pemfile_pkey, b->ptr, NULL); in mod_mbedtls_acme_tls_1()
1121 if (0 != rc) { in mod_mbedtls_acme_tls_1()
1122 elogf(errh, __FILE__, __LINE__, rc, in mod_mbedtls_acme_tls_1()
1127 rc = mbedtls_ssl_set_hs_own_cert(&hctx->ssl, in mod_mbedtls_acme_tls_1()
1129 if (0 != rc) { in mod_mbedtls_acme_tls_1()
1130 elogf(errh, __FILE__, __LINE__, rc, in mod_mbedtls_acme_tls_1()
1151 return rc; in mod_mbedtls_acme_tls_1()
1280 int rc = 0; in mod_mbedtls_cert_cb() local
1285 rc = mod_mbedtls_alpn_selected(hctx, alpn); in mod_mbedtls_cert_cb()
1286 if (0 != rc) return rc; in mod_mbedtls_cert_cb()
1294 rc = mod_mbedtls_SNI(hctx, ssl, servername, len); in mod_mbedtls_cert_cb()
1295 if (0 != rc) return rc; in mod_mbedtls_cert_cb()
1305 rc = mod_mbedtls_conf_verify(hctx); in mod_mbedtls_cert_cb()
1306 if (0 != rc) return rc; in mod_mbedtls_cert_cb()
1309 return rc; in mod_mbedtls_cert_cb()
1335 int rc = 0; in mod_mbedtls_ssl_conf_cmd() local
1348 rc = -1; in mod_mbedtls_ssl_conf_cmd()
1353 rc = -1; in mod_mbedtls_ssl_conf_cmd()
1425 rc = -1; in mod_mbedtls_ssl_conf_cmd()
1427 return rc; in mod_mbedtls_ssl_conf_cmd()
1434 int rc; in network_init_ssl() local
1449 rc = mbedtls_ssl_config_defaults(s->ssl_ctx, in network_init_ssl()
1453 if (0 != rc) { in network_init_ssl()
1454 elog(srv->errh, __FILE__,__LINE__, rc, in network_init_ssl()
1472 rc = mbedtls_ssl_conf_own_cert(s->ssl_ctx, in network_init_ssl()
1474 if (0 != rc) { in network_init_ssl()
1475 elogf(srv->errh, __FILE__, __LINE__, rc, in network_init_ssl()
1504 rc = mbedtls_ssl_conf_alpn_protocols(s->ssl_ctx, alpn_protos); in network_init_ssl()
1505 if (0 != rc) { in network_init_ssl()
1506 elog(srv->errh, __FILE__, __LINE__, rc, "error setting ALPN protocols"); in network_init_ssl()
1530 rc = mbedtls_ssl_ticket_setup(&p->ticket_ctx, mbedtls_ctr_drbg_random, in network_init_ssl()
1533 if (0 != rc) { in network_init_ssl()
1534 elog(srv->errh,__FILE__,__LINE__,rc,"mbedtls_ssl_ticket_setup()"); in network_init_ssl()
1586 int rc = HANDLER_GO_ON; in mod_mbedtls_set_defaults_sockets() local
1656 if (HANDLER_GO_ON != rc) break; in mod_mbedtls_set_defaults_sockets()
1730 rc = HANDLER_ERROR; in mod_mbedtls_set_defaults_sockets()
1740 rc = HANDLER_ERROR; in mod_mbedtls_set_defaults_sockets()
1746 rc = HANDLER_ERROR; in mod_mbedtls_set_defaults_sockets()
1763 rc = HANDLER_ERROR; in mod_mbedtls_set_defaults_sockets()
1768 if (rc == HANDLER_GO_ON && ssl_is_init) in mod_mbedtls_set_defaults_sockets()
1773 return rc; in mod_mbedtls_set_defaults_sockets()
1869 int rc = in SETDEFAULTS_FUNC() local
1871 if (0 == rc) { in SETDEFAULTS_FUNC()
1876 elogf(srv->errh, __FILE__, __LINE__, rc, in SETDEFAULTS_FUNC()
1891 int rc = in SETDEFAULTS_FUNC() local
1893 if (0 == rc) { in SETDEFAULTS_FUNC()
1898 elogf(srv->errh, __FILE__, __LINE__, rc, in SETDEFAULTS_FUNC()
2121 int rc = 0; in mod_mbedtls_ssl_handshake() local
2125 rc = mbedtls_ssl_handshake(&hctx->ssl); in mod_mbedtls_ssl_handshake()
2148 rc = ssl_parse_client_hello(&hctx->ssl, hctx); in mod_mbedtls_ssl_handshake()
2149 if (0 != rc) break; in mod_mbedtls_ssl_handshake()
2154 rc = mbedtls_ssl_handshake_step(&hctx->ssl); in mod_mbedtls_ssl_handshake()
2155 if (0 != rc) break; in mod_mbedtls_ssl_handshake()
2157 if (0 == rc in mod_mbedtls_ssl_handshake()
2162 rc = mod_mbedtls_alpn_selected(hctx, alpn); in mod_mbedtls_ssl_handshake()
2167 if (0 == rc && hctx->conf.ssl_verifyclient /*(after SNI and ALPN)*/ in mod_mbedtls_ssl_handshake()
2177 rc = mbedtls_ssl_handshake_step(&hctx->ssl); in mod_mbedtls_ssl_handshake()
2178 if (0 != rc) break; in mod_mbedtls_ssl_handshake()
2180 if (0 == rc in mod_mbedtls_ssl_handshake()
2182 rc = mod_mbedtls_conf_verify(hctx); in mod_mbedtls_ssl_handshake()
2183 if (0 == rc) in mod_mbedtls_ssl_handshake()
2184 rc = mbedtls_ssl_handshake_step(&hctx->ssl); in mod_mbedtls_ssl_handshake()
2188 if (0 == rc && hctx->conf.ssl_ca_dn_file in mod_mbedtls_ssl_handshake()
2198 if (0 == rc && handshake_state(&hctx->ssl) != MBEDTLS_SSL_HANDSHAKE_OVER) { in mod_mbedtls_ssl_handshake()
2199 rc = mbedtls_ssl_handshake(&hctx->ssl); in mod_mbedtls_ssl_handshake()
2204 switch (rc) { in mod_mbedtls_ssl_handshake()
2236 elog(hctx->r->conf.errh, __FILE__, __LINE__, rc, __func__); in mod_mbedtls_ssl_handshake()
2256 int rc = mod_mbedtls_ssl_handshake(hctx); in connection_read_cq_ssl() local
2257 if (1 != rc) return rc; /* !hctx->handshake_done; not done, or error */ in connection_read_cq_ssl()
2272 int rc = len; in connection_read_cq_ssl() local
2274 switch (rc) { in connection_read_cq_ssl()
2296 elog(hctx->errh, __FILE__, __LINE__, rc, "Reading mbedtls"); in connection_read_cq_ssl()
2337 int rc = mbedtls_ssl_setup(&hctx->ssl, hctx->ssl_ctx); in CONNECTION_FUNC() local
2338 if (0 == rc) { in CONNECTION_FUNC()
2345 elog(r->conf.errh, __FILE__, __LINE__, rc, "ssl_setup() failed"); in CONNECTION_FUNC()
2407 int rc = mbedtls_ssl_close_notify(&hctx->ssl); in mod_mbedtls_close_notify() local
2408 switch (rc) { in mod_mbedtls_close_notify()
2416 elog(hctx->r->conf.errh, __FILE__, __LINE__, rc, in mod_mbedtls_close_notify()
2545 uint32_t rc = (NULL != crt) in https_add_ssl_client_entries() local
2548 if (0xFFFFFFFF == rc) { /*(e.g. no cert, or verify result not available)*/ in https_add_ssl_client_entries()
2552 else if (0 != rc) { in https_add_ssl_client_entries()
2554 https_add_ssl_client_verify_err(vb, rc); in https_add_ssl_client_entries()
3523 int rc = mbedtls_ssl_config_defaults(s->ssl_ctx, in mod_mbedtls_ssl_conf_ciphersuites() local
3527 if (0 != rc) { in mod_mbedtls_ssl_conf_ciphersuites()
3528 elog(srv->errh, __FILE__,__LINE__, rc, in mod_mbedtls_ssl_conf_ciphersuites()
3613 int rc = 1; in mod_mbedtls_ssl_conf_ciphersuites() local
3920 rc = 0; in mod_mbedtls_ssl_conf_ciphersuites()
3924 if (0 == rc) return 0; in mod_mbedtls_ssl_conf_ciphersuites()
4084 int rc = mbedtls_dhm_parse_dhmfile(&dhm, dhparameters->ptr); in mod_mbedtls_ssl_conf_dhparameters() local
4085 if (0 != rc) in mod_mbedtls_ssl_conf_dhparameters()
4086 elogf(srv->errh, __FILE__,__LINE__, rc, in mod_mbedtls_ssl_conf_dhparameters()
4089 rc = mbedtls_ssl_conf_dh_param_ctx(s->ssl_ctx, &dhm); in mod_mbedtls_ssl_conf_dhparameters()
4090 if (0 != rc) in mod_mbedtls_ssl_conf_dhparameters()
4091 elogf(srv->errh, __FILE__,__LINE__, rc, in mod_mbedtls_ssl_conf_dhparameters()
4095 return (0 == rc); in mod_mbedtls_ssl_conf_dhparameters()