reject zero length point format list or supported curves extensions
[openssl.git] / ssl / tls1.h
index 49575e7..c59a02f 100644 (file)
@@ -197,20 +197,42 @@ extern "C" {
 #define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
 #define TLS1_AD_UNKNOWN_PSK_IDENTITY   115     /* fatal */
 
-/* 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 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
@@ -245,6 +267,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
@@ -253,20 +278,52 @@ 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 */
 
-/* Heartbeat extension */
-#define TLSEXT_TYPE_heartbeat 15
+#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
+/* This is not IANA assigned. See
+ * https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#authorization-data-rules */
+#define TLSEXT_AUTHZDATAFORMAT_audit_proof 182
+
+#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)
@@ -330,6 +387,13 @@ 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)
 
+/* Used by clients to process audit proofs. */
+#define SSL_CTX_set_tlsext_authz_server_audit_proof_cb(ctx, cb) \
+SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_AUTHZ_SERVER_AUDIT_PROOF_CB,(void (*)(void))cb)
+
+#define SSL_CTX_set_tlsext_authz_server_audit_proof_cb_arg(ctx, arg) \
+SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TLSEXT_AUTHZ_SERVER_AUDIT_PROOF_CB_ARG, 0, arg);
+
 #ifndef OPENSSL_NO_HEARTBEATS
 #define SSL_TLSEXT_HB_ENABLED                          0x01
 #define SSL_TLSEXT_HB_DONT_SEND_REQUESTS       0x02