Lines Matching refs:sc
3315 static int sslcon_undefined_function_1(SSL_CONNECTION *sc, unsigned char *r, in sslcon_undefined_function_1() argument
3326 return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc)); in sslcon_undefined_function_1()
3388 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl3_new() local
3390 if (sc == NULL) in ssl3_new()
3393 if (!ssl_srp_ctx_init_intern(sc)) in ssl3_new()
3405 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl3_free() local
3407 if (sc == NULL) in ssl3_free()
3410 ssl3_cleanup_key_block(sc); in ssl3_free()
3412 EVP_PKEY_free(sc->s3.peer_tmp); in ssl3_free()
3413 sc->s3.peer_tmp = NULL; in ssl3_free()
3414 EVP_PKEY_free(sc->s3.tmp.pkey); in ssl3_free()
3415 sc->s3.tmp.pkey = NULL; in ssl3_free()
3417 ssl_evp_cipher_free(sc->s3.tmp.new_sym_enc); in ssl3_free()
3418 ssl_evp_md_free(sc->s3.tmp.new_hash); in ssl3_free()
3420 OPENSSL_free(sc->s3.tmp.ctype); in ssl3_free()
3421 sk_X509_NAME_pop_free(sc->s3.tmp.peer_ca_names, X509_NAME_free); in ssl3_free()
3422 OPENSSL_free(sc->s3.tmp.ciphers_raw); in ssl3_free()
3423 OPENSSL_clear_free(sc->s3.tmp.pms, sc->s3.tmp.pmslen); in ssl3_free()
3424 OPENSSL_free(sc->s3.tmp.peer_sigalgs); in ssl3_free()
3425 OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs); in ssl3_free()
3426 OPENSSL_free(sc->s3.tmp.valid_flags); in ssl3_free()
3427 ssl3_free_digest_list(sc); in ssl3_free()
3428 OPENSSL_free(sc->s3.alpn_selected); in ssl3_free()
3429 OPENSSL_free(sc->s3.alpn_proposed); in ssl3_free()
3432 OPENSSL_free(sc->s3.tmp.psk); in ssl3_free()
3436 ssl_srp_ctx_free_intern(sc); in ssl3_free()
3438 memset(&sc->s3, 0, sizeof(sc->s3)); in ssl3_free()
3443 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl3_clear() local
3446 if (sc == NULL) in ssl3_clear()
3449 ssl3_cleanup_key_block(sc); in ssl3_clear()
3450 OPENSSL_free(sc->s3.tmp.ctype); in ssl3_clear()
3451 sk_X509_NAME_pop_free(sc->s3.tmp.peer_ca_names, X509_NAME_free); in ssl3_clear()
3452 OPENSSL_free(sc->s3.tmp.ciphers_raw); in ssl3_clear()
3453 OPENSSL_clear_free(sc->s3.tmp.pms, sc->s3.tmp.pmslen); in ssl3_clear()
3454 OPENSSL_free(sc->s3.tmp.peer_sigalgs); in ssl3_clear()
3455 OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs); in ssl3_clear()
3456 OPENSSL_free(sc->s3.tmp.valid_flags); in ssl3_clear()
3458 EVP_PKEY_free(sc->s3.tmp.pkey); in ssl3_clear()
3459 EVP_PKEY_free(sc->s3.peer_tmp); in ssl3_clear()
3461 ssl3_free_digest_list(sc); in ssl3_clear()
3463 OPENSSL_free(sc->s3.alpn_selected); in ssl3_clear()
3464 OPENSSL_free(sc->s3.alpn_proposed); in ssl3_clear()
3470 flags = sc->s3.flags & TLS1_FLAGS_QUIC; in ssl3_clear()
3471 memset(&sc->s3, 0, sizeof(sc->s3)); in ssl3_clear()
3472 sc->s3.flags |= flags; in ssl3_clear()
3474 if (!ssl_free_wbio_buffer(sc)) in ssl3_clear()
3477 sc->version = SSL3_VERSION; in ssl3_clear()
3480 OPENSSL_free(sc->ext.npn); in ssl3_clear()
3481 sc->ext.npn = NULL; in ssl3_clear()
3482 sc->ext.npn_len = 0; in ssl3_clear()
3491 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in srp_password_from_info_cb() local
3493 if (sc == NULL) in srp_password_from_info_cb()
3496 return OPENSSL_strdup(sc->srp_ctx.info); in srp_password_from_info_cb()
3505 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl3_ctrl() local
3507 if (sc == NULL) in ssl3_ctrl()
3514 ret = sc->s3.num_renegotiations; in ssl3_ctrl()
3517 ret = sc->s3.num_renegotiations; in ssl3_ctrl()
3518 sc->s3.num_renegotiations = 0; in ssl3_ctrl()
3521 ret = sc->s3.total_renegotiations; in ssl3_ctrl()
3524 ret = (int)(sc->s3.flags); in ssl3_ctrl()
3553 sc->cert->dh_tmp_auto = larg; in ssl3_ctrl()
3562 return ssl_set_tmp_ecdh_groups(&sc->ext.supportedgroups, in ssl3_ctrl()
3563 &sc->ext.supportedgroups_len, in ssl3_ctrl()
3579 OPENSSL_free(sc->ext.hostname); in ssl3_ctrl()
3580 sc->ext.hostname = NULL; in ssl3_ctrl()
3590 if ((sc->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) { in ssl3_ctrl()
3600 sc->ext.debug_arg = parg; in ssl3_ctrl()
3605 ret = sc->ext.status_type; in ssl3_ctrl()
3609 sc->ext.status_type = larg; in ssl3_ctrl()
3614 *(STACK_OF(X509_EXTENSION) **)parg = sc->ext.ocsp.exts; in ssl3_ctrl()
3619 sc->ext.ocsp.exts = parg; in ssl3_ctrl()
3624 *(STACK_OF(OCSP_RESPID) **)parg = sc->ext.ocsp.ids; in ssl3_ctrl()
3629 sc->ext.ocsp.ids = parg; in ssl3_ctrl()
3634 *(unsigned char **)parg = sc->ext.ocsp.resp; in ssl3_ctrl()
3635 if (sc->ext.ocsp.resp_len == 0 in ssl3_ctrl()
3636 || sc->ext.ocsp.resp_len > LONG_MAX) in ssl3_ctrl()
3638 return (long)sc->ext.ocsp.resp_len; in ssl3_ctrl()
3641 OPENSSL_free(sc->ext.ocsp.resp); in ssl3_ctrl()
3642 sc->ext.ocsp.resp = parg; in ssl3_ctrl()
3643 sc->ext.ocsp.resp_len = larg; in ssl3_ctrl()
3649 return ssl_cert_set1_chain(sc, NULL, (STACK_OF(X509) *)parg); in ssl3_ctrl()
3651 return ssl_cert_set0_chain(sc, NULL, (STACK_OF(X509) *)parg); in ssl3_ctrl()
3655 return ssl_cert_add1_chain_cert(sc, NULL, (X509 *)parg); in ssl3_ctrl()
3657 return ssl_cert_add0_chain_cert(sc, NULL, (X509 *)parg); in ssl3_ctrl()
3660 *(STACK_OF(X509) **)parg = sc->cert->key->chain; in ssl3_ctrl()
3665 return ssl_cert_select_current(sc->cert, (X509 *)parg); in ssl3_ctrl()
3670 if (!sc->server) in ssl3_ctrl()
3672 cipher = sc->s3.tmp.new_cipher; in ssl3_ctrl()
3681 if (sc->s3.tmp.cert == NULL) in ssl3_ctrl()
3683 sc->cert->key = sc->s3.tmp.cert; in ssl3_ctrl()
3686 return ssl_cert_set_current(sc->cert, larg); in ssl3_ctrl()
3693 if (!sc->session) in ssl3_ctrl()
3695 clist = sc->ext.peer_supportedgroups; in ssl3_ctrl()
3696 clistlen = sc->ext.peer_supportedgroups_len; in ssl3_ctrl()
3715 return tls1_set_groups(&sc->ext.supportedgroups, in ssl3_ctrl()
3716 &sc->ext.supportedgroups_len, parg, larg); in ssl3_ctrl()
3719 return tls1_set_groups_list(s->ctx, &sc->ext.supportedgroups, in ssl3_ctrl()
3720 &sc->ext.supportedgroups_len, parg); in ssl3_ctrl()
3724 uint16_t id = tls1_shared_group(sc, larg); in ssl3_ctrl()
3734 if (SSL_CONNECTION_IS_TLS13(sc) && sc->s3.did_kex) in ssl3_ctrl()
3735 id = sc->s3.group_id; in ssl3_ctrl()
3737 id = sc->session->kex_group; in ssl3_ctrl()
3742 return tls1_set_sigalgs(sc->cert, parg, larg, 0); in ssl3_ctrl()
3745 return tls1_set_sigalgs_list(s->ctx, sc->cert, parg, 0); in ssl3_ctrl()
3748 return tls1_set_sigalgs(sc->cert, parg, larg, 1); in ssl3_ctrl()
3751 return tls1_set_sigalgs_list(s->ctx, sc->cert, parg, 1); in ssl3_ctrl()
3756 if (sc->server || !sc->s3.tmp.cert_req) in ssl3_ctrl()
3759 *pctype = sc->s3.tmp.ctype; in ssl3_ctrl()
3760 return sc->s3.tmp.ctype_len; in ssl3_ctrl()
3764 if (!sc->server) in ssl3_ctrl()
3766 return ssl3_set_req_cert_type(sc->cert, parg, larg); in ssl3_ctrl()
3769 return ssl_build_cert_chain(sc, NULL, larg); in ssl3_ctrl()
3772 return ssl_cert_set_cert_store(sc->cert, parg, 0, larg); in ssl3_ctrl()
3775 return ssl_cert_set_cert_store(sc->cert, parg, 1, larg); in ssl3_ctrl()
3778 return ssl_cert_get_cert_store(sc->cert, parg, 0); in ssl3_ctrl()
3781 return ssl_cert_get_cert_store(sc->cert, parg, 1); in ssl3_ctrl()
3784 if (sc->s3.tmp.peer_sigalg == NULL) in ssl3_ctrl()
3786 *(int *)parg = sc->s3.tmp.peer_sigalg->hash; in ssl3_ctrl()
3790 if (sc->s3.tmp.sigalg == NULL) in ssl3_ctrl()
3792 *(int *)parg = sc->s3.tmp.sigalg->hash; in ssl3_ctrl()
3796 if (sc->session == NULL || sc->s3.peer_tmp == NULL) { in ssl3_ctrl()
3799 EVP_PKEY_up_ref(sc->s3.peer_tmp); in ssl3_ctrl()
3800 *(EVP_PKEY **)parg = sc->s3.peer_tmp; in ssl3_ctrl()
3805 if (sc->session == NULL || sc->s3.tmp.pkey == NULL) { in ssl3_ctrl()
3808 EVP_PKEY_up_ref(sc->s3.tmp.pkey); in ssl3_ctrl()
3809 *(EVP_PKEY **)parg = sc->s3.tmp.pkey; in ssl3_ctrl()
3817 if (sc->ext.peer_ecpointformats == NULL) in ssl3_ctrl()
3819 *pformat = sc->ext.peer_ecpointformats; in ssl3_ctrl()
3820 return (int)sc->ext.peer_ecpointformats_len; in ssl3_ctrl()
3826 *(uint16_t **)parg = (uint16_t *)sc->ext.peer_supportedgroups; in ssl3_ctrl()
3828 return (int)sc->ext.peer_supportedgroups_len; in ssl3_ctrl()
3832 sc->msg_callback_arg = parg; in ssl3_ctrl()
3844 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl3_callback_ctrl() local
3846 if (sc == NULL) in ssl3_callback_ctrl()
3852 sc->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp; in ssl3_callback_ctrl()
3857 sc->ext.debug_cb = (void (*)(SSL *, int, int, in ssl3_callback_ctrl()
3863 sc->not_resumable_session_cb = (int (*)(SSL *, int))fp; in ssl3_callback_ctrl()
3868 sc->msg_callback = (ossl_msg_cb)fp; in ssl3_callback_ctrl()
4504 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in ssl3_shutdown() local
4506 if (sc == NULL) in ssl3_shutdown()
4513 if (sc->quiet_shutdown || SSL_in_before(s)) { in ssl3_shutdown()
4514 sc->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); in ssl3_shutdown()
4518 if (!(sc->shutdown & SSL_SENT_SHUTDOWN)) { in ssl3_shutdown()
4519 sc->shutdown |= SSL_SENT_SHUTDOWN; in ssl3_shutdown()
4520 ssl3_send_alert(sc, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY); in ssl3_shutdown()
4525 if (sc->s3.alert_dispatch > 0) in ssl3_shutdown()
4527 } else if (sc->s3.alert_dispatch > 0) { in ssl3_shutdown()
4538 } else if (!(sc->shutdown & SSL_RECEIVED_SHUTDOWN)) { in ssl3_shutdown()
4544 if (!(sc->shutdown & SSL_RECEIVED_SHUTDOWN)) { in ssl3_shutdown()
4549 if ((sc->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) in ssl3_shutdown()
4550 && sc->s3.alert_dispatch == SSL_ALERT_DISPATCH_NONE) in ssl3_shutdown()
4558 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in ssl3_write() local
4560 if (sc == NULL) in ssl3_write()
4564 if (sc->s3.renegotiate) in ssl3_write()
4575 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in ssl3_read_internal() local
4577 if (sc == NULL) in ssl3_read_internal()
4581 if (sc->s3.renegotiate) in ssl3_read_internal()
4583 sc->s3.in_read_app_data = 1; in ssl3_read_internal()
4587 if ((ret == -1) && (sc->s3.in_read_app_data == 2)) { in ssl3_read_internal()
4595 ossl_statem_set_in_handshake(sc, 1); in ssl3_read_internal()
4599 ossl_statem_set_in_handshake(sc, 0); in ssl3_read_internal()
4601 sc->s3.in_read_app_data = 0; in ssl3_read_internal()
4618 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in ssl3_renegotiate() local
4620 if (sc == NULL) in ssl3_renegotiate()
4623 if (sc->handshake_func == NULL) in ssl3_renegotiate()
4626 sc->s3.renegotiate = 1; in ssl3_renegotiate()
4641 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in ssl3_renegotiate_check() local
4643 if (sc == NULL) in ssl3_renegotiate_check()
4646 if (sc->s3.renegotiate) { in ssl3_renegotiate_check()
4647 if (!RECORD_LAYER_read_pending(&sc->rlayer) in ssl3_renegotiate_check()
4648 && !RECORD_LAYER_write_pending(&sc->rlayer) in ssl3_renegotiate_check()
4655 ossl_statem_set_renegotiate(sc); in ssl3_renegotiate_check()
4656 sc->s3.renegotiate = 0; in ssl3_renegotiate_check()
4657 sc->s3.num_renegotiations++; in ssl3_renegotiate_check()
4658 sc->s3.total_renegotiations++; in ssl3_renegotiate_check()
5094 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get0_group_name() local
5097 if (sc == NULL) in SSL_get0_group_name()
5100 if (SSL_CONNECTION_IS_TLS13(sc) && sc->s3.did_kex) in SSL_get0_group_name()
5101 id = sc->s3.group_id; in SSL_get0_group_name()
5103 id = sc->session->kex_group; in SSL_get0_group_name()