Lines Matching refs:sc

37 static int init_server_cert_type(SSL_CONNECTION *sc, unsigned int context);
38 static int init_client_cert_type(SSL_CONNECTION *sc, unsigned int context);
69 static int tls_init_compress_certificate(SSL_CONNECTION *sc, unsigned int context);
70 static EXT_RETURN tls_construct_compress_certificate(SSL_CONNECTION *sc, WPACKET *pkt,
73 static int tls_parse_compress_certificate(SSL_CONNECTION *sc, PACKET *pkt,
1800 static int tls_init_compress_certificate(SSL_CONNECTION *sc, unsigned int context) in tls_init_compress_certificate() argument
1802 memset(sc->ext.compress_certificate_from_peer, 0, in tls_init_compress_certificate()
1803 sizeof(sc->ext.compress_certificate_from_peer)); in tls_init_compress_certificate()
1808 static EXT_RETURN tls_construct_compress_certificate(SSL_CONNECTION *sc, WPACKET *pkt, in tls_construct_compress_certificate() argument
1819 if (sc->server && sc->ext.server_cert_type != TLSEXT_cert_type_x509) { in tls_construct_compress_certificate()
1820 sc->cert_comp_prefs[0] = TLSEXT_comp_cert_none; in tls_construct_compress_certificate()
1825 if (!sc->server && sc->ext.client_cert_type_ctos) { in tls_construct_compress_certificate()
1826 sc->cert_comp_prefs[0] = TLSEXT_comp_cert_none; in tls_construct_compress_certificate()
1831 if ((sc->options & SSL_OP_NO_RX_CERTIFICATE_COMPRESSION) != 0) in tls_construct_compress_certificate()
1834 if (sc->cert_comp_prefs[0] == TLSEXT_comp_cert_none) in tls_construct_compress_certificate()
1842 for (i = 0; sc->cert_comp_prefs[i] != TLSEXT_comp_cert_none; i++) { in tls_construct_compress_certificate()
1843 if (!WPACKET_put_bytes_u16(pkt, sc->cert_comp_prefs[i])) in tls_construct_compress_certificate()
1849 sc->ext.compress_certificate_sent = 1; in tls_construct_compress_certificate()
1852 SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); in tls_construct_compress_certificate()
1860 static int tls_comp_in_pref(SSL_CONNECTION *sc, int alg) in tls_comp_in_pref() argument
1871 if (sc->cert_comp_prefs[0] == TLSEXT_comp_cert_none) in tls_comp_in_pref()
1875 if (sc->cert_comp_prefs[i] == alg) in tls_comp_in_pref()
1881 int tls_parse_compress_certificate(SSL_CONNECTION *sc, PACKET *pkt, unsigned int context, in tls_parse_compress_certificate() argument
1895 if (sc->server && sc->ext.server_cert_type != TLSEXT_cert_type_x509) in tls_parse_compress_certificate()
1897 if (!sc->server && sc->ext.client_cert_type != TLSEXT_cert_type_x509) in tls_parse_compress_certificate()
1901 if ((sc->options & SSL_OP_NO_TX_CERTIFICATE_COMPRESSION) != 0) in tls_parse_compress_certificate()
1906 SSLfatal(sc, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION); in tls_parse_compress_certificate()
1918 if (tls_comp_in_pref(sc, comp) && !already_set[comp]) { in tls_parse_compress_certificate()
1919 sc->ext.compress_certificate_from_peer[j++] = comp; in tls_parse_compress_certificate()
1927 static int init_server_cert_type(SSL_CONNECTION *sc, unsigned int context) in init_server_cert_type() argument
1930 if (sc->server) { in init_server_cert_type()
1931 sc->ext.server_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE; in init_server_cert_type()
1932 sc->ext.server_cert_type = TLSEXT_cert_type_x509; in init_server_cert_type()
1937 static int init_client_cert_type(SSL_CONNECTION *sc, unsigned int context) in init_client_cert_type() argument
1940 if (sc->server) { in init_client_cert_type()
1941 sc->ext.client_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE; in init_client_cert_type()
1942 sc->ext.client_cert_type = TLSEXT_cert_type_x509; in init_client_cert_type()