Classes | Macros | Typedefs | Functions | Variables
ssl_cipher.cc File Reference
#include <openssl/ssl.h>
#include <assert.h>
#include <string.h>
#include <openssl/err.h>
#include <openssl/md5.h>
#include <openssl/mem.h>
#include <openssl/sha.h>
#include <openssl/stack.h>
#include "internal.h"
#include "../crypto/internal.h"
Include dependency graph for ssl_cipher.cc:

Go to the source code of this file.

Classes

struct  cipher_alias_st
 
struct  cipher_order_st
 

Macros

#define CIPHER_ADD   1
 
#define CIPHER_DEL   3
 
#define CIPHER_KILL   2
 
#define CIPHER_ORD   4
 
#define CIPHER_SPECIAL   5
 

Typedefs

typedef struct cipher_alias_st CIPHER_ALIAS
 
typedef struct cipher_order_st CIPHER_ORDER
 

Functions

Span< const SSL_CIPHERAllCiphers ()
 
template<typename T , size_t I>
static constexpr int check_order (const T(&arr)[I], size_t N)
 
template<typename T , size_t N>
static constexpr size_t countof (T const (&)[N])
 
static bool is_cipher_list_separator (char c, bool is_strict)
 
static void ll_append_head (CIPHER_ORDER **head, CIPHER_ORDER *curr, CIPHER_ORDER **tail)
 
static void ll_append_tail (CIPHER_ORDER **head, CIPHER_ORDER *curr, CIPHER_ORDER **tail)
 
static bool rule_equals (const char *rule, const char *buf, size_t buf_len)
 
static void ssl_cipher_apply_rule (uint32_t cipher_id, uint32_t alg_mkey, uint32_t alg_auth, uint32_t alg_enc, uint32_t alg_mac, uint16_t min_version, int rule, int strength_bits, bool in_group, CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p)
 
uint32_t ssl_cipher_auth_mask_for_key (const EVP_PKEY *key)
 
static bool ssl_cipher_collect_ciphers (Array< CIPHER_ORDER > *out_co_list, CIPHER_ORDER **out_head, CIPHER_ORDER **out_tail)
 
const char * SSL_CIPHER_description (const SSL_CIPHER *cipher, char *buf, int len)
 
int SSL_CIPHER_get_auth_nid (const SSL_CIPHER *cipher)
 
int SSL_CIPHER_get_bits (const SSL_CIPHER *cipher, int *out_alg_bits)
 
int SSL_CIPHER_get_cipher_nid (const SSL_CIPHER *cipher)
 
int SSL_CIPHER_get_digest_nid (const SSL_CIPHER *cipher)
 
bool ssl_cipher_get_evp_aead (const EVP_AEAD **out_aead, size_t *out_mac_secret_len, size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, uint16_t version, bool is_dtls)
 
uint32_t SSL_CIPHER_get_id (const SSL_CIPHER *cipher)
 
const char * SSL_CIPHER_get_kx_name (const SSL_CIPHER *cipher)
 
int SSL_CIPHER_get_kx_nid (const SSL_CIPHER *cipher)
 
uint16_t SSL_CIPHER_get_max_version (const SSL_CIPHER *cipher)
 
uint16_t SSL_CIPHER_get_min_version (const SSL_CIPHER *cipher)
 
const char * SSL_CIPHER_get_name (const SSL_CIPHER *cipher)
 
int SSL_CIPHER_get_prf_nid (const SSL_CIPHER *cipher)
 
uint16_t SSL_CIPHER_get_protocol_id (const SSL_CIPHER *cipher)
 
size_t ssl_cipher_get_record_split_len (const SSL_CIPHER *cipher)
 
char * SSL_CIPHER_get_rfc_name (const SSL_CIPHER *cipher)
 
uint16_t SSL_CIPHER_get_value (const SSL_CIPHER *cipher)
 
const char * SSL_CIPHER_get_version (const SSL_CIPHER *cipher)
 
static int ssl_cipher_id_cmp (const void *in_a, const void *in_b)
 
static constexpr int ssl_cipher_id_cmp_inner (const SSL_CIPHER *a, const SSL_CIPHER *b)
 
int SSL_CIPHER_is_aead (const SSL_CIPHER *cipher)
 
int SSL_CIPHER_is_block_cipher (const SSL_CIPHER *cipher)
 
static bool ssl_cipher_process_rulestr (const char *rule_str, CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p, bool strict)
 
bool ssl_cipher_requires_server_key_exchange (const SSL_CIPHER *cipher)
 
const char * SSL_CIPHER_standard_name (const SSL_CIPHER *cipher)
 
static bool ssl_cipher_strength_sort (CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p)
 
bool ssl_cipher_uses_certificate_auth (const SSL_CIPHER *cipher)
 
int SSL_COMP_add_compression_method (int id, COMP_METHOD *cm)
 
void SSL_COMP_free_compression_methods (void)
 
const char * SSL_COMP_get0_name (const SSL_COMP *comp)
 
int SSL_COMP_get_id (const SSL_COMP *comp)
 
const char * SSL_COMP_get_name (const COMP_METHOD *comp)
 
bool ssl_create_cipher_list (UniquePtr< SSLCipherPreferenceList > *out_cipher_list, const char *rule_str, bool strict)
 
const SSL_CIPHERSSL_get_cipher_by_value (uint16_t value)
 
const EVP_MDssl_get_handshake_digest (uint16_t version, const SSL_CIPHER *cipher)
 
 STACK_OF (SSL_COMP) *SSL_COMP_get_compression_methods(void)
 

Variables

static const CIPHER_ALIAS kCipherAliases []
 
static const size_t kCipherAliasesLen = OPENSSL_ARRAY_SIZE(kCipherAliases)
 
static constexpr BSSL_NAMESPACE_BEGIN SSL_CIPHER kCiphers []
 

Macro Definition Documentation

◆ CIPHER_ADD

#define CIPHER_ADD   1

Definition at line 469 of file ssl_cipher.cc.

◆ CIPHER_DEL

#define CIPHER_DEL   3

Definition at line 471 of file ssl_cipher.cc.

◆ CIPHER_KILL

#define CIPHER_KILL   2

Definition at line 470 of file ssl_cipher.cc.

◆ CIPHER_ORD

#define CIPHER_ORD   4

Definition at line 472 of file ssl_cipher.cc.

◆ CIPHER_SPECIAL

#define CIPHER_SPECIAL   5

Definition at line 473 of file ssl_cipher.cc.

Typedef Documentation

◆ CIPHER_ALIAS

typedef struct cipher_alias_st CIPHER_ALIAS

◆ CIPHER_ORDER

typedef struct cipher_order_st CIPHER_ORDER

Function Documentation

◆ AllCiphers()

Span<const SSL_CIPHER> AllCiphers ( )

Definition at line 465 of file ssl_cipher.cc.

◆ check_order()

template<typename T , size_t I>
static constexpr int check_order ( const T(&)  arr[I],
size_t  N 
)
staticconstexpr

Definition at line 1348 of file ssl_cipher.cc.

◆ countof()

template<typename T , size_t N>
static constexpr size_t countof ( T   const(&)[N])
staticconstexpr

Definition at line 1343 of file ssl_cipher.cc.

◆ is_cipher_list_separator()

static bool is_cipher_list_separator ( char  c,
bool  is_strict 
)
static

Definition at line 652 of file ssl_cipher.cc.

◆ ll_append_head()

static void ll_append_head ( CIPHER_ORDER **  head,
CIPHER_ORDER curr,
CIPHER_ORDER **  tail 
)
static

Definition at line 686 of file ssl_cipher.cc.

◆ ll_append_tail()

static void ll_append_tail ( CIPHER_ORDER **  head,
CIPHER_ORDER curr,
CIPHER_ORDER **  tail 
)
static

Definition at line 666 of file ssl_cipher.cc.

◆ rule_equals()

static bool rule_equals ( const char *  rule,
const char *  buf,
size_t  buf_len 
)
static

Definition at line 661 of file ssl_cipher.cc.

◆ ssl_cipher_apply_rule()

static void ssl_cipher_apply_rule ( uint32_t  cipher_id,
uint32_t  alg_mkey,
uint32_t  alg_auth,
uint32_t  alg_enc,
uint32_t  alg_mac,
uint16_t  min_version,
int  rule,
int  strength_bits,
bool  in_group,
CIPHER_ORDER **  head_p,
CIPHER_ORDER **  tail_p 
)
static

Definition at line 809 of file ssl_cipher.cc.

◆ ssl_cipher_auth_mask_for_key()

uint32_t ssl_cipher_auth_mask_for_key ( const EVP_PKEY key)

Definition at line 1282 of file ssl_cipher.cc.

◆ ssl_cipher_collect_ciphers()

static bool ssl_cipher_collect_ciphers ( Array< CIPHER_ORDER > *  out_co_list,
CIPHER_ORDER **  out_head,
CIPHER_ORDER **  out_tail 
)
static

Definition at line 706 of file ssl_cipher.cc.

◆ SSL_CIPHER_description()

const char* SSL_CIPHER_description ( const SSL_CIPHER cipher,
char *  buf,
int  len 
)

Definition at line 1587 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_auth_nid()

int SSL_CIPHER_get_auth_nid ( const SSL_CIPHER cipher)

Definition at line 1433 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_bits()

int SSL_CIPHER_get_bits ( const SSL_CIPHER cipher,
int out_alg_bits 
)

Definition at line 1545 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_cipher_nid()

int SSL_CIPHER_get_cipher_nid ( const SSL_CIPHER cipher)

Definition at line 1386 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_digest_nid()

int SSL_CIPHER_get_digest_nid ( const SSL_CIPHER cipher)

Definition at line 1407 of file ssl_cipher.cc.

◆ ssl_cipher_get_evp_aead()

bool ssl_cipher_get_evp_aead ( const EVP_AEAD **  out_aead,
size_t *  out_mac_secret_len,
size_t *  out_fixed_iv_len,
const SSL_CIPHER cipher,
uint16_t  version,
bool  is_dtls 
)

Definition at line 559 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_id()

uint32_t SSL_CIPHER_get_id ( const SSL_CIPHER cipher)

Definition at line 1369 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_kx_name()

const char* SSL_CIPHER_get_kx_name ( const SSL_CIPHER cipher)

Definition at line 1501 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_kx_nid()

int SSL_CIPHER_get_kx_nid ( const SSL_CIPHER cipher)

Definition at line 1418 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_max_version()

uint16_t SSL_CIPHER_get_max_version ( const SSL_CIPHER cipher)

Definition at line 1480 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_min_version()

uint16_t SSL_CIPHER_get_min_version ( const SSL_CIPHER cipher)

Definition at line 1466 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_name()

const char* SSL_CIPHER_get_name ( const SSL_CIPHER cipher)

Definition at line 1489 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_prf_nid()

int SSL_CIPHER_get_prf_nid ( const SSL_CIPHER cipher)

Definition at line 1448 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_protocol_id()

uint16_t SSL_CIPHER_get_protocol_id ( const SSL_CIPHER cipher)

Definition at line 1371 of file ssl_cipher.cc.

◆ ssl_cipher_get_record_split_len()

size_t ssl_cipher_get_record_split_len ( const SSL_CIPHER cipher)

Definition at line 1305 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_rfc_name()

char* SSL_CIPHER_get_rfc_name ( const SSL_CIPHER cipher)

Definition at line 1537 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_value()

uint16_t SSL_CIPHER_get_value ( const SSL_CIPHER cipher)

Definition at line 1378 of file ssl_cipher.cc.

◆ SSL_CIPHER_get_version()

const char* SSL_CIPHER_get_version ( const SSL_CIPHER cipher)

Definition at line 1703 of file ssl_cipher.cc.

◆ ssl_cipher_id_cmp()

static int ssl_cipher_id_cmp ( const void *  in_a,
const void *  in_b 
)
static

Definition at line 1337 of file ssl_cipher.cc.

◆ ssl_cipher_id_cmp_inner()

static constexpr int ssl_cipher_id_cmp_inner ( const SSL_CIPHER a,
const SSL_CIPHER b 
)
staticconstexpr

Definition at line 1330 of file ssl_cipher.cc.

◆ SSL_CIPHER_is_aead()

int SSL_CIPHER_is_aead ( const SSL_CIPHER cipher)

Definition at line 1382 of file ssl_cipher.cc.

◆ SSL_CIPHER_is_block_cipher()

int SSL_CIPHER_is_block_cipher ( const SSL_CIPHER cipher)

Definition at line 1461 of file ssl_cipher.cc.

◆ ssl_cipher_process_rulestr()

static bool ssl_cipher_process_rulestr ( const char *  rule_str,
CIPHER_ORDER **  head_p,
CIPHER_ORDER **  tail_p,
bool  strict 
)
static

Definition at line 971 of file ssl_cipher.cc.

◆ ssl_cipher_requires_server_key_exchange()

bool ssl_cipher_requires_server_key_exchange ( const SSL_CIPHER cipher)

Definition at line 1299 of file ssl_cipher.cc.

◆ SSL_CIPHER_standard_name()

const char* SSL_CIPHER_standard_name ( const SSL_CIPHER cipher)

Definition at line 1497 of file ssl_cipher.cc.

◆ ssl_cipher_strength_sort()

static bool ssl_cipher_strength_sort ( CIPHER_ORDER **  head_p,
CIPHER_ORDER **  tail_p 
)
static

Definition at line 930 of file ssl_cipher.cc.

◆ ssl_cipher_uses_certificate_auth()

bool ssl_cipher_uses_certificate_auth ( const SSL_CIPHER cipher)

Definition at line 1295 of file ssl_cipher.cc.

◆ SSL_COMP_add_compression_method()

int SSL_COMP_add_compression_method ( int  id,
COMP_METHOD cm 
)

Definition at line 1709 of file ssl_cipher.cc.

◆ SSL_COMP_free_compression_methods()

void SSL_COMP_free_compression_methods ( void  )

Definition at line 1717 of file ssl_cipher.cc.

◆ SSL_COMP_get0_name()

const char* SSL_COMP_get0_name ( const SSL_COMP comp)

Definition at line 1713 of file ssl_cipher.cc.

◆ SSL_COMP_get_id()

int SSL_COMP_get_id ( const SSL_COMP comp)

Definition at line 1715 of file ssl_cipher.cc.

◆ SSL_COMP_get_name()

const char* SSL_COMP_get_name ( const COMP_METHOD comp)

Definition at line 1711 of file ssl_cipher.cc.

◆ ssl_create_cipher_list()

bool ssl_create_cipher_list ( UniquePtr< SSLCipherPreferenceList > *  out_cipher_list,
const char *  rule_str,
bool  strict 
)

Definition at line 1152 of file ssl_cipher.cc.

◆ SSL_get_cipher_by_value()

const SSL_CIPHER* SSL_get_cipher_by_value ( uint16_t  value)

Definition at line 1360 of file ssl_cipher.cc.

◆ ssl_get_handshake_digest()

const EVP_MD* ssl_get_handshake_digest ( uint16_t  version,
const SSL_CIPHER cipher 
)

Definition at line 637 of file ssl_cipher.cc.

◆ STACK_OF()

STACK_OF ( SSL_COMP  )

Definition at line 1707 of file ssl_cipher.cc.

Variable Documentation

◆ kCipherAliases

const CIPHER_ALIAS kCipherAliases[]
static

Definition at line 500 of file ssl_cipher.cc.

◆ kCipherAliasesLen

const size_t kCipherAliasesLen = OPENSSL_ARRAY_SIZE(kCipherAliases)
static

Definition at line 557 of file ssl_cipher.cc.

◆ kCiphers

constexpr BSSL_NAMESPACE_BEGIN SSL_CIPHER kCiphers[]
staticconstexpr

Definition at line 158 of file ssl_cipher.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:31