Lines Matching refs:sc

39 static int init_server_cert_type(SSL_CONNECTION *sc, unsigned int context);
40 static int init_client_cert_type(SSL_CONNECTION *sc, unsigned int context);
71 static int tls_init_compress_certificate(SSL_CONNECTION *sc, unsigned int context);
72 static EXT_RETURN tls_construct_compress_certificate(SSL_CONNECTION *sc, WPACKET *pkt,
75 static int tls_parse_compress_certificate(SSL_CONNECTION *sc, PACKET *pkt,
1784 static int tls_init_compress_certificate(SSL_CONNECTION *sc, unsigned int context) in tls_init_compress_certificate() argument
1786 memset(sc->ext.compress_certificate_from_peer, 0, in tls_init_compress_certificate()
1787 sizeof(sc->ext.compress_certificate_from_peer)); in tls_init_compress_certificate()
1792 static EXT_RETURN tls_construct_compress_certificate(SSL_CONNECTION *sc, WPACKET *pkt, in tls_construct_compress_certificate() argument
1803 if (sc->server && sc->ext.server_cert_type != TLSEXT_cert_type_x509) { in tls_construct_compress_certificate()
1804 sc->cert_comp_prefs[0] = TLSEXT_comp_cert_none; in tls_construct_compress_certificate()
1809 if (!sc->server && sc->ext.client_cert_type_ctos) { in tls_construct_compress_certificate()
1810 sc->cert_comp_prefs[0] = TLSEXT_comp_cert_none; in tls_construct_compress_certificate()
1815 if ((sc->options & SSL_OP_NO_RX_CERTIFICATE_COMPRESSION) != 0) in tls_construct_compress_certificate()
1818 if (sc->cert_comp_prefs[0] == TLSEXT_comp_cert_none) in tls_construct_compress_certificate()
1826 for (i = 0; sc->cert_comp_prefs[i] != TLSEXT_comp_cert_none; i++) { in tls_construct_compress_certificate()
1827 if (!WPACKET_put_bytes_u16(pkt, sc->cert_comp_prefs[i])) in tls_construct_compress_certificate()
1833 sc->ext.compress_certificate_sent = 1; in tls_construct_compress_certificate()
1836 SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); in tls_construct_compress_certificate()
1844 static int tls_comp_in_pref(SSL_CONNECTION *sc, int alg) in tls_comp_in_pref() argument
1855 if (sc->cert_comp_prefs[0] == TLSEXT_comp_cert_none) in tls_comp_in_pref()
1859 if (sc->cert_comp_prefs[i] == alg) in tls_comp_in_pref()
1865 int tls_parse_compress_certificate(SSL_CONNECTION *sc, PACKET *pkt, unsigned int context, in tls_parse_compress_certificate() argument
1879 if (sc->server && sc->ext.server_cert_type != TLSEXT_cert_type_x509) in tls_parse_compress_certificate()
1881 if (!sc->server && sc->ext.client_cert_type != TLSEXT_cert_type_x509) in tls_parse_compress_certificate()
1885 if ((sc->options & SSL_OP_NO_TX_CERTIFICATE_COMPRESSION) != 0) in tls_parse_compress_certificate()
1890 SSLfatal(sc, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION); in tls_parse_compress_certificate()
1902 if (tls_comp_in_pref(sc, comp) && !already_set[comp]) { in tls_parse_compress_certificate()
1903 sc->ext.compress_certificate_from_peer[j++] = comp; in tls_parse_compress_certificate()
1908 SSLfatal(sc, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION); in tls_parse_compress_certificate()
1915 static int init_server_cert_type(SSL_CONNECTION *sc, unsigned int context) in init_server_cert_type() argument
1918 if (sc->server) { in init_server_cert_type()
1919 sc->ext.server_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE; in init_server_cert_type()
1920 sc->ext.server_cert_type = TLSEXT_cert_type_x509; in init_server_cert_type()
1925 static int init_client_cert_type(SSL_CONNECTION *sc, unsigned int context) in init_client_cert_type() argument
1928 if (sc->server) { in init_client_cert_type()
1929 sc->ext.client_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE; in init_client_cert_type()
1930 sc->ext.client_cert_type = TLSEXT_cert_type_x509; in init_client_cert_type()