3 int tls_cipher_supported(struct TLSContext *context, unsigned short cipher) {
9 case TLS_AES_128_GCM_SHA256:
10 case TLS_AES_256_GCM_SHA384:
11 case TLS_CHACHA20_POLY1305_SHA256:
12 if (context->tlsver == TLS_VERSION13) {
16 case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
17 case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
18 if (context && ((context->certificates
19 && context->certificates_count
20 && context->ec_private_key)
21 || !context->is_server)) {
25 case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:
26 case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:
27 case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
28 case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:
29 case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:
30 if (context->tlsver == TLS_VERSION12) {
31 if (context && ((context->certificates
32 && context->certificates_count
33 && context->ec_private_key)
34 || !context->is_server)) {
39 case TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
40 case TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
41 case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
42 case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
43 case TLS_RSA_WITH_AES_128_CBC_SHA:
44 case TLS_RSA_WITH_AES_256_CBC_SHA:
46 case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
47 case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256:
48 case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256:
49 case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384:
50 case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
51 case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
52 case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:
53 case TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256:
54 case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:
55 case TLS_RSA_WITH_AES_128_GCM_SHA256:
56 case TLS_RSA_WITH_AES_128_CBC_SHA256:
57 case TLS_RSA_WITH_AES_256_CBC_SHA256:
58 case TLS_RSA_WITH_AES_256_GCM_SHA384:
59 if (context->tlsver == TLS_VERSION12) {