Difference between revisions of "OpenSSL 1.1.0 Changes"

From OpenSSLWiki
Jump to navigationJump to search
Line 48: Line 48:
 
* <tt>->session_id{,_length}</tt>
 
* <tt>->session_id{,_length}</tt>
  
This was fixed with [http://git.infradead.org/users/dwmw2/openconnect.git/commitdiff/5abb133f this commit] which makes it create the ASN.1 representation of the session and import it with <tt>d2i_SSL_SESSION()</tt>. It does depend on <tt>d2i_SSL_SESSION()</tt> being fixed by applying the patch at https://mta.openssl.org/pipermail/openssl-dev/2015-February/000707.html to make it cope with <tt>DTLS1_BAD_VER</tt>.
+
This was fixed with [http://git.infradead.org/users/dwmw2/openconnect.git/commitdiff/5abb133f this OpenConnect commit] which makes it create the ASN.1 representation of the session and import it with <tt>d2i_SSL_SESSION()</tt>. This is done conditionally in the above patch because it depends on the [http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=af674d4e20a82c2a98767b837072d7093c70b1cf fix in openssl HEAD] for <tt>d2i_SSL_SESSION()</tt> to make it cope with <tt>DTLS1_BAD_VER</tt> <i>([http://rt.openssl.org/Ticket/Display.html?id=3704 RT#3704])</i>.
 
 
An alternative would be to introduce a new function to create a <tt>SSL_SESSION</tt> with the required parameters, vaguely equivalent to [http://www.gnutls.org/manual/html_node/Core-TLS-API.html#index-gnutls_005fsession_005fset_005fpremaster gnutls_session_set_premaster()]
 
  
 
Other simpler things which broke:
 
Other simpler things which broke:
 
* <tt>SSL_CIPHER->id</tt>. Replaced with <tt>SSL_CIPHER_get_id()</tt>
 
* <tt>SSL_CIPHER->id</tt>. Replaced with <tt>SSL_CIPHER_get_id()</tt>
 
* <tt>SSL_CTX->extra_certs</tt>. Replaced with <tt>SSL_CTX_get_extra_chain_certs_only()</tt>
 
* <tt>SSL_CTX->extra_certs</tt>. Replaced with <tt>SSL_CTX_get_extra_chain_certs_only()</tt>

Revision as of 09:05, 3 March 2015

This is a parent page for discussion about API changes being done for OpenSSL version 1.1

The overall goal of this project is to make most data structures opaque to applications. This provides us with a number of benefits:

  • We can add fields without breaking binary compatibility
  • Applications are more robust and can be more assured about correctness
  • It helps us determine which (new) accessors and settors, for example, are needed

Please add sub-pages to discuss particular parts of the library as work progresses.

Major Changes so far

  • All structures in libssl public header files have been removed so that they are "opaque" to library users. You should use the provided accessor functions instead
  • The old DES API has been removed
  • bn, a sub library in libcrypto, has been made opaque
  • Access to deprecated functions/macros has been removed by default. To enable access you must do two things. 1) Build OpenSSL with deprecation support (pass "enable-deprecated" as an argument to config) 2) Applications must define "OPENSSL_USE_DEPRECATED" before including OpenSSL header files
  • HMAC_Init and HMAC_cleanup were previously stated in the docs and header files as being deprecated - but were not flagged in previous versions with OPENSSL_NO_DEPRECATED. This has been corrected in 1.1.0. Access to these functions/macros will be off by default in 1.1.0 as per the note above about deprecation.

Things that Broke in Qt

Here's what's broken in the dev branch of Qt when building openssl master as of 6 Feb 2015.

  • DH - we were directly accessing p and q to set the DH params to primes embedded in Qt. We can probably replace this with SSL_CTX_set_dh_auto(ctx, 1). Another option suggested by Steve Henson is to save the DHparams we're using at the moment then use d2i_DHparams to load them in. This is compatible with openssl versions that don't have the dh_auto option.
  • ctx->cert_store - we were directly accessing the cert_store field of SSL_CTX. We can probably replace this with X509_STORE *SSL_CTX_get_cert_store(SSL_CTX *ctx) [Fixed in dev]
  • session->tlsext_tick_lifetime_hint - we were directly accessing the lifetime hint of the session. [A new API to access this field has been added]
  • cipher->valid - we were directly accessing the valid field of SSL_CIPHER. No replacement found. [This turned out not to be needed and so will be removed].

Things that Broke in Curl

  • SSL_SESSION->ssl_version. Replaced with SSL_version(SSL *)

Things that Broke in wget

  • SSL->state. Replaced with SSL_state(SSL *)

Things that Broke in Apache Traffic Manager

  • Setting SSL->rbio without setting SSL->wbio. New function introduction in 1.1.0 to handle this: SSL_set_rbio()

Things that Broke in OpenConnect

In order to simulate "resume" of a DTLS session which never really existed but which was actually negotiated over the VPN control connection, this code in the OpenConnect VPN client needs to set the following fields in a new SSL_SESSION:

  • ->ssl_version
  • ->cipher{,_id}
  • ->master_key{,_length}
  • ->session_id{,_length}

This was fixed with this OpenConnect commit which makes it create the ASN.1 representation of the session and import it with d2i_SSL_SESSION(). This is done conditionally in the above patch because it depends on the fix in openssl HEAD for d2i_SSL_SESSION() to make it cope with DTLS1_BAD_VER (RT#3704).

Other simpler things which broke:

  • SSL_CIPHER->id. Replaced with SSL_CIPHER_get_id()
  • SSL_CTX->extra_certs. Replaced with SSL_CTX_get_extra_chain_certs_only()