Lines Matching refs:ctx
56 br_ssl_client_context ctx; member
89 static void append_dn(void *ctx, const void *buf, size_t len) in append_dn() argument
91 struct cafile_parser *ca = ctx; in append_dn()
103 static void x509_push(void *ctx, const void *buf, size_t len) in x509_push() argument
105 struct cafile_parser *ca = ctx; in x509_push()
271 static void x509_start_chain(const br_x509_class **ctx, in x509_start_chain() argument
274 struct x509_context *x509 = (struct x509_context *)ctx; in x509_start_chain()
286 static void x509_start_cert(const br_x509_class **ctx, uint32_t length) in x509_start_cert() argument
288 struct x509_context *x509 = (struct x509_context *)ctx; in x509_start_cert()
300 static void x509_append(const br_x509_class **ctx, const unsigned char *buf, in x509_append() argument
303 struct x509_context *x509 = (struct x509_context *)ctx; in x509_append()
314 static void x509_end_cert(const br_x509_class **ctx) in x509_end_cert() argument
316 struct x509_context *x509 = (struct x509_context *)ctx; in x509_end_cert()
326 static unsigned x509_end_chain(const br_x509_class **ctx) in x509_end_chain() argument
328 struct x509_context *x509 = (struct x509_context *)ctx; in x509_end_chain()
337 static const br_x509_pkey *x509_get_pkey(const br_x509_class *const *ctx, in x509_get_pkey() argument
340 struct x509_context *x509 = (struct x509_context *)ctx; in x509_get_pkey()
535 struct ssl_connect_data *connssl = cf->ctx; in bearssl_connect_step1()
585 br_ssl_client_init_full(&backend->ctx, &backend->x509.minimal, in bearssl_connect_step1()
588 ret = bearssl_set_ssl_version_min_max(data, &backend->ctx.eng, conn_config); in bearssl_connect_step1()
592 br_ssl_engine_set_buffer(&backend->ctx.eng, backend->buf, in bearssl_connect_step1()
599 ret = bearssl_set_selected_ciphers(data, &backend->ctx.eng, in bearssl_connect_step1()
609 br_ssl_engine_set_x509(&backend->ctx.eng, &backend->x509.vtable); in bearssl_connect_step1()
621 br_ssl_engine_set_session_parameters(&backend->ctx.eng, session); in bearssl_connect_step1()
635 br_ssl_engine_set_protocol_names(&backend->ctx.eng, backend->protocols, in bearssl_connect_step1()
661 ret = (*data->set.ssl.fsslctx)(data, &backend->ctx, in bearssl_connect_step1()
670 if(!br_ssl_client_reset(&backend->ctx, hostname, session_set)) in bearssl_connect_step1()
683 struct ssl_connect_data *connssl = cf->ctx; in bearssl_run_until()
697 state = br_ssl_engine_current_state(&backend->ctx.eng); in bearssl_run_until()
699 err = br_ssl_engine_last_error(&backend->ctx.eng); in bearssl_run_until()
731 buf = br_ssl_engine_sendrec_buf(&backend->ctx.eng, &len); in bearssl_run_until()
740 br_ssl_engine_sendrec_ack(&backend->ctx.eng, ret); in bearssl_run_until()
743 buf = br_ssl_engine_recvrec_buf(&backend->ctx.eng, &len); in bearssl_run_until()
755 br_ssl_engine_recvrec_ack(&backend->ctx.eng, ret); in bearssl_run_until()
763 struct ssl_connect_data *connssl = cf->ctx; in bearssl_connect_step2()
780 if(br_ssl_engine_current_state(&backend->ctx.eng) == BR_SSL_CLOSED) { in bearssl_connect_step2()
786 tver = br_ssl_engine_get_version(&backend->ctx.eng); in bearssl_connect_step2()
798 br_ssl_engine_get_session_parameters(&backend->ctx.eng, &session); in bearssl_connect_step2()
816 struct ssl_connect_data *connssl = cf->ctx; in bearssl_connect_step3()
829 proto = br_ssl_engine_get_selected_protocol(&backend->ctx.eng); in bearssl_connect_step3()
840 br_ssl_engine_get_session_parameters(&backend->ctx.eng, session); in bearssl_connect_step3()
858 struct ssl_connect_data *connssl = cf->ctx; in bearssl_send()
870 app = br_ssl_engine_sendapp_buf(&backend->ctx.eng, &applen); in bearssl_send()
884 br_ssl_engine_sendapp_ack(&backend->ctx.eng, applen); in bearssl_send()
885 br_ssl_engine_flush(&backend->ctx.eng, 0); in bearssl_send()
893 struct ssl_connect_data *connssl = cf->ctx; in bearssl_recv()
904 app = br_ssl_engine_recvapp_buf(&backend->ctx.eng, &applen); in bearssl_recv()
910 br_ssl_engine_recvapp_ack(&backend->ctx.eng, applen); in bearssl_recv()
921 struct ssl_connect_data *connssl = cf->ctx; in bearssl_connect_common()
1019 struct ssl_connect_data *ctx = cf->ctx; in bearssl_data_pending() local
1023 DEBUGASSERT(ctx && ctx->backend); in bearssl_data_pending()
1024 backend = (struct bearssl_ssl_backend_data *)ctx->backend; in bearssl_data_pending()
1025 return br_ssl_engine_current_state(&backend->ctx.eng) & BR_SSL_RECVAPP; in bearssl_data_pending()
1031 static br_hmac_drbg_context ctx; in bearssl_random() local
1037 br_hmac_drbg_init(&ctx, &br_sha256_vtable, NULL, 0); in bearssl_random()
1039 if(!seeder || !seeder(&ctx.vtable)) in bearssl_random()
1043 br_hmac_drbg_generate(&ctx, entropy, length); in bearssl_random()
1076 return &backend->ctx; in bearssl_get_internals()
1083 struct ssl_connect_data *connssl = cf->ctx; in bearssl_shutdown()
1097 br_ssl_engine_close(&backend->ctx.eng); in bearssl_shutdown()
1118 struct ssl_connect_data *connssl = cf->ctx; in bearssl_close()
1139 br_sha256_context ctx; in bearssl_sha256sum() local
1141 br_sha256_init(&ctx); in bearssl_sha256sum()
1142 br_sha256_update(&ctx, input, inputlen); in bearssl_sha256sum()
1143 br_sha256_out(&ctx, sha256sum); in bearssl_sha256sum()