Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Members of SSL structure

Tags:

c

ssl

openssl

In a OpenSSL's SSL/TLS client implementation, a structure SSL is defined. For example here is usually the first few lines (from the link).

SSL_CTX* ctx = NULL;
BIO *web = NULL, *out = NULL;
SSL *ssl = NULL;

init_openssl_library();

I have been unable to find its structure in the header files from the OpenSSL library. How can I learn the contents of SSL * ssl?

like image 386
Choi Avatar asked Sep 06 '16 21:09

Choi


People also ask

What is SSL CTX?

A context (CTX) structure is needed for each application that is running SSL. Each SSL session has an SSL structure, which points to a CTX structure. Both the CTX and SSL structures reside in heap storage.

What is SSL structure?

SSL_CIPHER (SSL Cipher) This structure holds the algorithm information for a particular cipher which are a core part of the SSL/TLS protocol. The available ciphers are configured on a SSL_CTX basis and the actual ones used are then part of the SSL_SESSION.


1 Answers

I have been unable to find its structure type in the header files from the openssl library.

It's unclear which version of openssl you are referring too and how did you look but a grep -r ' SSL;' /usr/include/openssl/ quickly turned up a match in openssl/ossl_typ.h for openssl 1.0.2:

   typedef struct ssl_st SSL;

A following grep for 'ssl_st' lead to its definition in openssl/ssl.h:

#ifndef OPENSSL_NO_SSL_INTERN

struct ssl_st
        {
        /* protocol version
         * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION)
         */
        int version;
        int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
...

Note that location and content of the structure might differ in other versions of openssl.

like image 188
Steffen Ullrich Avatar answered Oct 10 '22 14:10

Steffen Ullrich