X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Ftls1.h;h=dbc612ca47e3d4ee9f5456053f62b16b8929a179;hp=545383a5eedf52ea3beabacabe605f72b8de8f49;hb=519531e97ef1ca38d652e02181227ebb40f1a31c;hpb=e0af04056cafff7cbfd2f4426cd0b44700a374a4 diff --git a/ssl/tls1.h b/ssl/tls1.h index 545383a5ee..dbc612ca47 100644 --- a/ssl/tls1.h +++ b/ssl/tls1.h @@ -196,23 +196,46 @@ extern "C" { #define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 #define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 #define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ -#define TLS1_AD_UNKNOWN_SRP_USERNAME 120 /* fatal */ -#define TLS1_AD_MISSING_SRP_USERNAME 121 -/* ExtensionType values from RFC3546 / RFC4366 */ +/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */ #define TLSEXT_TYPE_server_name 0 #define TLSEXT_TYPE_max_fragment_length 1 #define TLSEXT_TYPE_client_certificate_url 2 #define TLSEXT_TYPE_trusted_ca_keys 3 #define TLSEXT_TYPE_truncated_hmac 4 #define TLSEXT_TYPE_status_request 5 +/* ExtensionType values from RFC4681 */ +#define TLSEXT_TYPE_user_mapping 6 + +/* ExtensionType values from RFC5878 */ +#define TLSEXT_TYPE_client_authz 7 +#define TLSEXT_TYPE_server_authz 8 + +/* ExtensionType values from RFC6091 */ +#define TLSEXT_TYPE_cert_type 9 + /* ExtensionType values from RFC4492 */ #define TLSEXT_TYPE_elliptic_curves 10 #define TLSEXT_TYPE_ec_point_formats 11 + /* ExtensionType value from RFC5054 */ #define TLSEXT_TYPE_srp 12 + +/* ExtensionType values from RFC5246 */ #define TLSEXT_TYPE_signature_algorithms 13 + +/* ExtensionType value from RFC5764 */ +#define TLSEXT_TYPE_use_srtp 14 + +/* ExtensionType value from RFC5620 */ +#define TLSEXT_TYPE_heartbeat 15 + +/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */ +#define TLSEXT_TYPE_application_layer_protocol_negotiation 16 + +/* ExtensionType value from RFC4507 */ #define TLSEXT_TYPE_session_ticket 35 + /* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */ #if 0 /* will have to be provided externally for now , * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183 @@ -247,6 +270,9 @@ extern "C" { #define TLSEXT_signature_dsa 2 #define TLSEXT_signature_ecdsa 3 +/* Total number of different signature algorithms */ +#define TLSEXT_signature_num 4 + #define TLSEXT_hash_none 0 #define TLSEXT_hash_md5 1 #define TLSEXT_hash_sha1 2 @@ -255,17 +281,55 @@ extern "C" { #define TLSEXT_hash_sha384 5 #define TLSEXT_hash_sha512 6 -/* ExtensionType value from RFC5764 */ -#define TLSEXT_TYPE_use_srtp 14 +/* Total number of different digest algorithms */ + +#define TLSEXT_hash_num 7 + +/* Flag set for unrecognised algorithms */ +#define TLSEXT_nid_unknown 0x1000000 + +/* ECC curves */ + +#define TLSEXT_curve_P_256 23 +#define TLSEXT_curve_P_384 24 #ifndef OPENSSL_NO_TLSEXT #define TLSEXT_MAXLEN_host_name 255 +/* From RFC 5878 */ +#define TLSEXT_SUPPLEMENTALDATATYPE_authz_data 16386 + +/* DTCP Authorization Type + * https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#authorization-data-rules + * http://tools.ietf.org/id/draft-dthakore-tls-authz-04.txt + */ +#define TLSEXT_AUTHZDATAFORMAT_dtcp 66 + +#define TLSEXT_MAXLEN_supplemental_data 1024*16 /* Let's limit to 16k */ + const char *SSL_get_servername(const SSL *s, const int type); int SSL_get_servername_type(const SSL *s); -int SSL_export_keying_material(SSL *s, unsigned char *out, int olen, - char *label, int llen, unsigned char *p, int plen, int use_context); +/* SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) + * + * It returns 1 on success and zero otherwise. + */ +int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, + const char *label, size_t llen, const unsigned char *p, size_t plen, + int use_context); + +int SSL_get_sigalgs(SSL *s, int idx, + int *psign, int *phash, int *psignandhash, + unsigned char *rsig, unsigned char *rhash); + +int SSL_get_shared_sigalgs(SSL *s, int idx, + int *psign, int *phash, int *psignandhash, + unsigned char *rsig, unsigned char *rhash); + +int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); #define SSL_set_tlsext_host_name(s,name) \ SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) @@ -329,6 +393,16 @@ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg) #define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) +#ifndef OPENSSL_NO_HEARTBEATS +#define SSL_TLSEXT_HB_ENABLED 0x01 +#define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02 +#define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04 + +#define SSL_get_tlsext_heartbeat_pending(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL) +#define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \ + SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL) +#endif #endif /* PSK ciphersuites from 4279 */ @@ -485,12 +559,12 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) #define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032 /* XXX - * Inconsistency alert: - * The OpenSSL names of ciphers with ephemeral DH here include the string - * "DHE", while elsewhere it has always been "EDH". - * (The alias for the list of all such ciphers also is "EDH".) - * The specifications speak of "EDH"; maybe we should allow both forms - * for everything. */ + * Backward compatibility alert: + * Older versions of OpenSSL gave some DHE ciphers names with "EDH" + * instead of "DHE". Going forward, we should be using DHE + * everywhere, though we may indefinitely maintain aliases for users + * or configurations that used "EDH" + */ #define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5" #define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5" #define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA"