Blame doc/functions/gnutls_priority_init2

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {int} {gnutls_priority_init2} (gnutls_priority_t * @var{priority_cache}, const char * @var{priorities}, const char ** @var{err_pos}, unsigned @var{flags})
Packit aea12f
@var{priority_cache}: is a @code{gnutls_prioritity_t}  type.
Packit aea12f
Packit aea12f
@var{priorities}: is a string describing priorities (may be @code{NULL} )
Packit aea12f
Packit aea12f
@var{err_pos}: In case of an error this will have the position in the string the error occurred
Packit aea12f
Packit aea12f
@var{flags}: zero or @code{GNUTLS_PRIORITY_INIT_DEF_APPEND} 
Packit aea12f
Packit aea12f
Sets priorities for the ciphers, key exchange methods, and macs.
Packit aea12f
The  @code{priority_cache} should be deinitialized
Packit aea12f
using @code{gnutls_priority_deinit()} .
Packit aea12f
Packit aea12f
The @code{priorities}  option allows you to specify a colon
Packit aea12f
separated list of the cipher priorities to enable.
Packit aea12f
Some keywords are defined to provide quick access
Packit aea12f
to common preferences.
Packit aea12f
Packit aea12f
When  @code{flags} is set to @code{GNUTLS_PRIORITY_INIT_DEF_APPEND}  then the  @code{priorities} specified will be appended to the default options.
Packit aea12f
Packit aea12f
Unless there is a special need, use the "NORMAL" keyword to
Packit aea12f
apply a reasonable security level, or "NORMAL:%COMPAT" for compatibility.
Packit aea12f
Packit aea12f
"PERFORMANCE" means all the "secure" ciphersuites are enabled,
Packit aea12f
limited to 128 bit ciphers and sorted by terms of speed
Packit aea12f
performance.
Packit aea12f
Packit aea12f
"LEGACY" the NORMAL settings for GnuTLS 3.2.x or earlier. There is
Packit aea12f
no verification profile set, and the allowed DH primes are considered
Packit aea12f
weak today.
Packit aea12f
Packit aea12f
"NORMAL" means all "secure" ciphersuites. The 256-bit ciphers are
Packit aea12f
included as a fallback only.  The ciphers are sorted by security
Packit aea12f
margin.
Packit aea12f
Packit aea12f
"PFS" means all "secure" ciphersuites that support perfect forward secrecy.
Packit aea12f
The 256-bit ciphers are included as a fallback only.
Packit aea12f
The ciphers are sorted by security margin.
Packit aea12f
Packit aea12f
"SECURE128" means all "secure" ciphersuites of security level 128-bit
Packit aea12f
or more.
Packit aea12f
Packit aea12f
"SECURE192" means all "secure" ciphersuites of security level 192-bit
Packit aea12f
or more.
Packit aea12f
Packit aea12f
"SUITEB128" means all the NSA SuiteB ciphersuites with security level
Packit aea12f
of 128.
Packit aea12f
Packit aea12f
"SUITEB192" means all the NSA SuiteB ciphersuites with security level
Packit aea12f
of 192.
Packit aea12f
Packit aea12f
"NONE" means nothing is enabled.  This disables everything, including protocols.
Packit aea12f
Packit aea12f
"@@KEYWORD1,KEYWORD2,..." The system administrator imposed settings.
Packit aea12f
The provided keyword(s) will be expanded from a configuration-time
Packit Service 991b93
provided file - default is: /etc/gnutls/config.
Packit aea12f
Any attributes that follow it, will be appended to the expanded
Packit aea12f
string. If multiple keywords are provided, separated by commas,
Packit aea12f
then the first keyword that exists in the configuration file
Packit aea12f
will be used. At least one of the keywords must exist, or this
Packit aea12f
function will return an error. Typical usage would be to specify
Packit aea12f
an application specified keyword first, followed by "SYSTEM" as
Packit aea12f
a default fallback. e.g., " @code{LIBVIRT} ,SYSTEM:!-VERS-SSL3.0" will
Packit aea12f
first try to find a config file entry matching "LIBVIRT", but if
Packit aea12f
that does not exist will use the entry for "SYSTEM". If "SYSTEM"
Packit aea12f
does not exist either, an error will be returned. In all cases,
Packit aea12f
the SSL3.0 protocol will be disabled. The system priority file
Packit aea12f
entries should be formatted as "KEYWORD=VALUE", e.g.,
Packit aea12f
"SYSTEM=NORMAL:+ARCFOUR-128".
Packit aea12f
Packit aea12f
Special keywords are "!", "-" and "+".
Packit aea12f
"!" or "-" appended with an algorithm will remove this algorithm.
Packit aea12f
"+" appended with an algorithm will add this algorithm.
Packit aea12f
Packit aea12f
Check the GnuTLS manual section "Priority strings" for detailed
Packit aea12f
information.
Packit aea12f
Packit aea12f
@strong{Examples:} 
Packit aea12f
"NONE:+VERS-TLS-ALL:+MAC-ALL:+RSA:+AES-128-CBC:+SIGN-ALL:+COMP-NULL"
Packit aea12f
Packit aea12f
"NORMAL:+ARCFOUR-128" means normal ciphers plus ARCFOUR-128.
Packit aea12f
Packit aea12f
"SECURE128:-VERS-SSL3.0" means that only secure ciphers are
Packit aea12f
and enabled, SSL3.0 is disabled.
Packit aea12f
Packit aea12f
"NONE:+VERS-TLS-ALL:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1",
Packit aea12f
Packit aea12f
"NONE:+VERS-TLS-ALL:+AES-128-CBC:+ECDHE-RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1:+CURVE-SECP256R1",
Packit aea12f
Packit aea12f
"SECURE256:+SECURE128",
Packit aea12f
Packit aea12f
Note that "NORMAL:%COMPAT" is the most compatible mode.
Packit aea12f
Packit aea12f
A @code{NULL}   @code{priorities} string indicates the default priorities to be
Packit aea12f
used (this is available since GnuTLS 3.3.0).
Packit aea12f
Packit aea12f
@strong{Returns:} On syntax error @code{GNUTLS_E_INVALID_REQUEST}  is returned,
Packit aea12f
@code{GNUTLS_E_SUCCESS}  on success, or an error code.
Packit aea12f
Packit aea12f
@strong{Since:} 3.6.3
Packit aea12f
@end deftypefun