Go to the documentation of this file.
95 #include "../crypto/internal.h"
208 if (
in == NULL ||
in->cipher == NULL) {
220 for_ticket ? 0 :
in->session_id_length) ||
258 if (
in->psk_identity) {
262 strlen(
in->psk_identity.get()))) {
268 if (
in->ticket_lifetime_hint > 0) {
276 if (!
in->ticket.empty() && !for_ticket) {
279 in->ticket.size())) {
285 if (
in->peer_sha256_valid) {
288 sizeof(
in->peer_sha256))) {
294 if (
in->original_handshake_hash_len > 0) {
297 in->original_handshake_hash_len)) {
303 if (
in->signed_cert_timestamp_list !=
nullptr) {
313 if (
in->ocsp_response !=
nullptr) {
323 if (
in->extended_master_secret) {
331 if (
in->group_id > 0 &&
340 if (
in->certs != NULL &&
341 !
in->peer_sha256_valid &&
357 if (
in->ticket_age_add_valid) {
366 if (!
in->is_server) {
374 if (
in->peer_signature_algorithm != 0 &&
381 if (
in->ticket_max_early_data != 0 &&
388 if (
in->timeout !=
in->auth_timeout &&
395 if (!
in->early_alpn.empty()) {
398 in->early_alpn.size())) {
412 if (!
in->quic_early_data_context.empty()) {
415 in->quic_early_data_context.size())) {
421 if (
in->has_application_settings) {
424 in->local_application_settings.data(),
425 in->local_application_settings.size()) ||
428 in->peer_application_settings.size())) {
479 UniquePtr<CRYPTO_BUFFER> *
out,
494 if (*
out ==
nullptr) {
517 long default_value) {
534 value > 0xffffffff) {
590 if (
ret->cipher == NULL) {
595 CBS session_id, secret;
604 ret->session_id_length =
CBS_len(&session_id);
624 (has_peer &&
CBS_len(&peer) == 0)) {
631 &session,
ret->sid_ctx, &
ret->sid_ctx_length,
sizeof(
ret->sid_ctx),
658 CBS_len(&peer_sha256) !=
sizeof(
ret->peer_sha256) ||
664 sizeof(
ret->peer_sha256));
665 ret->peer_sha256_valid = 1;
667 ret->peer_sha256_valid = 0;
671 &session,
ret->original_handshake_hash,
672 &
ret->original_handshake_hash_len,
675 &
ret->signed_cert_timestamp_list,
682 int extended_master_secret;
689 ret->extended_master_secret = !!extended_master_secret;
701 (has_cert_chain &&
CBS_len(&cert_chain) == 0)) {
705 if (has_cert_chain && !has_peer) {
709 if (has_peer || has_cert_chain) {
711 if (
ret->certs ==
nullptr) {
725 while (
CBS_len(&cert_chain) > 0) {
751 ret->ticket_age_add_valid = age_add_present != 0;
762 ret->is_server = is_server;
782 int has_local_alps, has_peer_alps;
785 !
ret->local_application_settings.CopyFrom(
settings) ||
788 !
ret->peer_application_settings.CopyFrom(
settings) ||
793 ret->is_quic = is_quic;
796 if (has_local_alps != has_peer_alps ||
797 (has_local_alps &&
ret->early_alpn.empty())) {
801 ret->has_application_settings = has_local_alps;
817 using namespace bssl;
821 if (
in->not_resumable) {
826 static const char kNotResumableSession[] =
"NOT RESUMABLE";
828 *out_len = strlen(kNotResumableSession);
830 if (*out_data == NULL) {
886 UniquePtr<SSL_SESSION>
ret =
895 return ret.release();
#define CBS_get_asn1_uint64
static const unsigned kSessionIDContextTag
static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, int for_ticket)
static uint16_t ssl_version(const SSL *ssl)
static bool SSL_SESSION_parse_octet_string(CBS *cbs, Array< uint8_t > *out, unsigned tag)
#define OPENSSL_PUT_ERROR(library, reason)
#define CRYPTO_BUFFER_new_from_CBS
#define CBB_add_asn1_octet_string
#define CBS_ASN1_OCTETSTRING
static const unsigned kSignedCertTimestampListTag
#define CBS_ASN1_CONTEXT_SPECIFIC
#define CRYPTO_BUFFER_len
static const unsigned kIsServerTag
UniquePtr< SSL_SESSION > SSL_SESSION_parse(CBS *cbs, const SSL_X509_METHOD *x509_method, CRYPTO_BUFFER_POOL *pool)
static const unsigned kTicketLifetimeHintTag
bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version)
#define CBS_peek_asn1_tag
int SSL_SESSION_to_bytes(const SSL_SESSION *in, uint8_t **out_data, size_t *out_len)
int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp)
#define sk_CRYPTO_BUFFER_new_null
#define CBS_get_any_asn1_element
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
static int SSL_SESSION_parse_long(CBS *cbs, long *out, unsigned tag, long default_value)
static void * tag(intptr_t t)
static const unsigned kQuicEarlyDataContextTag
static const unsigned kExtendedMasterSecretTag
static const unsigned kOriginalHandshakeHashTag
unsigned __int64 uint64_t
int SSL_SESSION_to_bytes_for_ticket(const SSL_SESSION *in, uint8_t **out_data, size_t *out_len)
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
#define BSSL_NAMESPACE_END
static int SSL_SESSION_parse_bounded_octet_string(CBS *cbs, uint8_t *out, uint8_t *out_len, uint8_t max_out, unsigned tag)
static const unsigned kIsQuicTag
static const unsigned kPSKIdentityTag
#define CBS_get_optional_asn1_bool
#define SSL_MAX_MASTER_KEY_LENGTH
static const unsigned kTicketMaxEarlyDataTag
#define CBB_add_asn1_bool
static const unsigned kVerifyResultTag
static const BSSL_NAMESPACE_BEGIN unsigned kVersion
bool(* session_cache_objects)(SSL_SESSION *session)
#define CBS_ASN1_CONSTRUCTED
static const unsigned kEarlyALPNTag
static int SSL_SESSION_parse_u16(CBS *cbs, uint16_t *out, unsigned tag, uint16_t default_value)
#define SSL3_MAX_SSL_SESSION_ID_LENGTH
#define CBS_get_optional_asn1_uint64
#define SSL_R_INVALID_SSL_SESSION
static int SSL_SESSION_parse_u32(CBS *cbs, uint32_t *out, unsigned tag, uint32_t default_value)
static const unsigned kLocalALPSTag
#define sk_CRYPTO_BUFFER_value
static int SSL_SESSION_parse_string(CBS *cbs, UniquePtr< char > *out, unsigned tag)
#define CBS_get_optional_asn1
static const unsigned kTicketAgeAddTag
SSL_SESSION * SSL_SESSION_from_bytes(const uint8_t *in, size_t in_len, const SSL_CTX *ctx)
static const unsigned kOCSPResponseTag
#define CBS_get_optional_asn1_octet_string
static const unsigned kGroupIDTag
UniquePtr< SSL_SESSION > ret
UniquePtr< SSL_SESSION > ssl_session_new(const SSL_X509_METHOD *x509_method)
std::enable_if<!internal::StackTraits< Stack >::kIsConst, bool >::type PushToStack(Stack *sk, UniquePtr< typename internal::StackTraits< Stack >::Type > elem)
static const unsigned kTicketTag
#define SSL_get_cipher_by_value
static const unsigned kPeerSHA256Tag
int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb)
InternalDescriptorPool * pool
#define SSL_R_UNSUPPORTED_CIPHER
static const unsigned kPeerALPSTag
static const unsigned kTimeoutTag
static const unsigned kAuthTimeoutTag
#define CBS_ASN1_SEQUENCE
static const unsigned kHostNameTag
static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, UniquePtr< CRYPTO_BUFFER > *out, unsigned tag, CRYPTO_BUFFER_POOL *pool)
#define sk_CRYPTO_BUFFER_num
static const unsigned kPeerTag
#define CBS_contains_zero_byte
static const unsigned kPeerSignatureAlgorithmTag
#define CRYPTO_BUFFER_data
#define ERR_R_MALLOC_FAILURE
static const unsigned kCertChainTag
static const unsigned kTimeTag
#define CBB_add_asn1_uint64
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:15