SSL_set0_security_ex_data (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
SSL_CTX_set_security_level, SSL_set_security_level, SSL_CTX_get_security_level, SSL_get_security_level, SSL_CTX_set_security_callback, SSL_set_security_callback, SSL_CTX_get_security_callback, SSL_get_security_callback, SSL_CTX_set0_security_ex_data, SSL_set0_security_ex_data, SSL_CTX_get0_security_ex_data, SSL_get0_security_ex_data - SSL/TLS security frameworkSYNOPSIS
#include <openssl/ssl.h> void SSL_CTX_set_security_level(SSL_CTX *ctx, int level); void SSL_set_security_level(SSL *s, int level); int SSL_CTX_get_security_level(const SSL_CTX *ctx); int SSL_get_security_level(const SSL *s); void SSL_CTX_set_security_callback(SSL_CTX *ctx, int (*cb)(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex)); void SSL_set_security_callback(SSL *s, int (*cb)(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex)); int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex); int (*SSL_get_security_callback(const SSL *s))(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex); void SSL_CTX_set0_security_ex_data(SSL_CTX *ctx, void *ex); void SSL_set0_security_ex_data(SSL *s, void *ex); void *SSL_CTX_get0_security_ex_data(const SSL_CTX *ctx); void *SSL_get0_security_ex_data(const SSL *s);
DESCRIPTION
The functions SSL_CTX_set_security_level() and SSL_set_security_level() set the security level to level. If not set the library default security level is used.The functions SSL_CTX_get_security_level() and SSL_get_security_level() retrieve the current security level.
SSL_CTX_set_security_callback(), SSL_set_security_callback(), SSL_CTX_get_security_callback() and SSL_get_security_callback() get or set the security callback associated with ctx or s. If not set a default security callback is used. The meaning of the parameters and the behaviour of the default callbacks is described below.
SSL_CTX_set0_security_ex_data(), SSL_set0_security_ex_data(), SSL_CTX_get0_security_ex_data() and SSL_get0_security_ex_data() set the extra data pointer passed to the ex parameter of the callback. This value is passed to the callback verbatim and can be set to any convenient application specific value.
DEFAULT CALLBACK BEHAVIOUR
If an application doesn't set its own security callback the default callback is used. It is intended to provide sane defaults. The meaning of each level is described below.- Level 0
- Everything is permitted. This retains compatibility with previous versions of OpenSSL.
- Level 1
-
The security level corresponds to a minimum of 80 bits of security. Any
parameters offering below 80 bits of security are excluded. As a result RSA, DSAandDHkeys shorter than 1024 bits andECCkeys shorter than 160 bits are prohibited. All export ciphersuites are prohibited since they all offer less than 80 bits of security.SSLversion 2 is prohibited. Any ciphersuite usingMD5for theMACis also prohibited.
- Level 2
-
Security level set to 112 bits of security. As a result RSA, DSAandDHkeys shorter than 2048 bits andECCkeys shorter than 224 bits are prohibited. In addition to the level 1 exclusions any ciphersuite usingRC4is also prohibited.SSLversion 3 is also not allowed. Compression is disabled.
- Level 3
-
Security level set to 128 bits of security. As a result RSA, DSAandDHkeys shorter than 3072 bits andECCkeys shorter than 256 bits are prohibited. In addition to the level 2 exclusions ciphersuites not offering forward secrecy are prohibited.TLSversions below 1.1 are not permitted. Session tickets are disabled.
- Level 4
-
Security level set to 192 bits of security. As a result RSA, DSAandDHkeys shorter than 7680 bits andECCkeys shorter than 384 bits are prohibited. Ciphersuites usingSHA1for theMACare prohibited.TLSversions below 1.2 are not permitted.
- Level 5
-
Security level set to 256 bits of security. As a result RSA, DSAandDHkeys shorter than 15360 bits andECCkeys shorter than 512 bits are prohibited.
APPLICATION DEFINED SECURITY CALLBACKS
Documentation to be provided.NOTES
The default security level can be configured when OpenSSL is compiled by setting -DOPENSSL_TLS_SECURITY_LEVEL=level. If not set then 1 is used.
The security framework disables or reject parameters inconsistent with the set security level. In the past this was difficult as applications had to set a number of distinct parameters (supported ciphers, supported curves supported signature algorithms) to achieve this end and some cases (
By setting an appropriate security level much of this complexity can be avoided.
The bits of security limits affect all relevant parameters including ciphersuite encryption algorithms, supported
See
Some security levels require large key sizes for non-ECC public key algorithms which can severely degrade performance. For example 256 bits of security requires the use of
Some restrictions can be gracefully handled: for example ciphersuites offering insufficient security are not sent by the client and will not be selected by the server. Other restrictions such as the peer certificate key size or the
Attempts to set certificates or parameters with insufficient security are also blocked. For example trying to set a certificate using a 512 bit
HISTORY
These functions were first added to OpenSSL 1.1.0COPYRIGHT
Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.Licensed under the OpenSSL license (the ``License''). You may not use this file except in compliance with the License. You can obtain a copy in the file