chromium/third_party/boringssl/src/ssl/ssl_versions.cc

/* Copyright (c) 2017, Google Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

#include <openssl/ssl.h>

#include <assert.h>

#include <algorithm>

#include <openssl/bytestring.h>
#include <openssl/err.h>
#include <openssl/span.h>

#include "internal.h"
#include "../crypto/internal.h"


BSSL_NAMESPACE_BEGIN

bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version) {}

// The follow arrays are the supported versions for TLS and DTLS, in order of
// decreasing preference.

static const uint16_t kTLSVersions[] =;

static const uint16_t kDTLSVersions[] =;

static Span<const uint16_t> get_method_versions(
    const SSL_PROTOCOL_METHOD *method) {}

bool ssl_method_supports_version(const SSL_PROTOCOL_METHOD *method,
                                 uint16_t version) {}

// The following functions map between API versions and wire versions. The
// public API works on wire versions.

static const char* kUnknownVersion =;

struct VersionInfo {};

static const VersionInfo kVersionNames[] =;

static const char *ssl_version_to_string(uint16_t version) {}

static uint16_t wire_version_to_api(uint16_t version) {}

// api_version_to_wire maps |version| to some representative wire version.
static bool api_version_to_wire(uint16_t *out, uint16_t version) {}

static bool set_version_bound(const SSL_PROTOCOL_METHOD *method, uint16_t *out,
                              uint16_t version) {}

static bool set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out,
                            uint16_t version) {}

static bool set_max_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out,
                            uint16_t version) {}

const struct {} kProtocolVersions[] =;

bool ssl_get_version_range(const SSL_HANDSHAKE *hs, uint16_t *out_min_version,
                           uint16_t *out_max_version) {}

static uint16_t ssl_version(const SSL *ssl) {}

uint16_t ssl_protocol_version(const SSL *ssl) {}

bool ssl_supports_version(const SSL_HANDSHAKE *hs, uint16_t version) {}

bool ssl_add_supported_versions(const SSL_HANDSHAKE *hs, CBB *cbb,
                                uint16_t extra_min_version) {}

bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert,
                           uint16_t *out_version, const CBS *peer_versions) {}

BSSL_NAMESPACE_END

usingnamespacebssl;

int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) {}

int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) {}

uint16_t SSL_CTX_get_min_proto_version(const SSL_CTX *ctx) {}

uint16_t SSL_CTX_get_max_proto_version(const SSL_CTX *ctx) {}

int SSL_set_min_proto_version(SSL *ssl, uint16_t version) {}

int SSL_set_max_proto_version(SSL *ssl, uint16_t version) {}

uint16_t SSL_get_min_proto_version(const SSL *ssl) {}

uint16_t SSL_get_max_proto_version(const SSL *ssl) {}

int SSL_version(const SSL *ssl) {}

const char *SSL_get_version(const SSL *ssl) {}

size_t SSL_get_all_version_names(const char **out, size_t max_out) {}

const char *SSL_SESSION_get_version(const SSL_SESSION *session) {}

uint16_t SSL_SESSION_get_protocol_version(const SSL_SESSION *session) {}

int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version) {}

int SSL_CTX_set_record_protocol_version(SSL_CTX *ctx, int version) {}