mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Make it possible to compile redbean with chibicc
This cuts build latency down from 5 seconds to 500 milliseconds.
This commit is contained in:
parent
552525cbdd
commit
6ff46ca373
50 changed files with 898 additions and 824 deletions
150
third_party/mbedtls/ssl.h
vendored
150
third_party/mbedtls/ssl.h
vendored
|
@ -12,81 +12,81 @@
|
|||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
#define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */
|
||||
#define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */
|
||||
#define MBEDTLS_ERR_NET_BIND_FAILED -0x0046 /**< Binding of the socket failed. */
|
||||
#define MBEDTLS_ERR_NET_LISTEN_FAILED -0x0048 /**< Could not listen on the socket. */
|
||||
#define MBEDTLS_ERR_NET_ACCEPT_FAILED -0x004A /**< Could not accept the incoming connection. */
|
||||
#define MBEDTLS_ERR_NET_RECV_FAILED -0x004C /**< Reading information from the socket failed. */
|
||||
#define MBEDTLS_ERR_NET_SEND_FAILED -0x004E /**< Sending information through the socket failed. */
|
||||
#define MBEDTLS_ERR_NET_CONN_RESET -0x0050 /**< Connection was reset by peer. */
|
||||
#define MBEDTLS_ERR_NET_UNKNOWN_HOST -0x0052 /**< Failed to get an IP address for the given hostname. */
|
||||
#define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL -0x0043 /**< Buffer is too small to hold the data. */
|
||||
#define MBEDTLS_ERR_NET_INVALID_CONTEXT -0x0045 /**< The context is invalid, eg because it was free()ed. */
|
||||
#define MBEDTLS_ERR_NET_POLL_FAILED -0x0047 /**< Polling the net context failed. */
|
||||
#define MBEDTLS_ERR_NET_BAD_INPUT_DATA -0x0049 /**< Input invalid. */
|
||||
#define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /*< Failed to open a socket. */
|
||||
#define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /*< The connection to the given server / port failed. */
|
||||
#define MBEDTLS_ERR_NET_BIND_FAILED -0x0046 /*< Binding of the socket failed. */
|
||||
#define MBEDTLS_ERR_NET_LISTEN_FAILED -0x0048 /*< Could not listen on the socket. */
|
||||
#define MBEDTLS_ERR_NET_ACCEPT_FAILED -0x004A /*< Could not accept the incoming connection. */
|
||||
#define MBEDTLS_ERR_NET_RECV_FAILED -0x004C /*< Reading information from the socket failed. */
|
||||
#define MBEDTLS_ERR_NET_SEND_FAILED -0x004E /*< Sending information through the socket failed. */
|
||||
#define MBEDTLS_ERR_NET_CONN_RESET -0x0050 /*< Connection was reset by peer. */
|
||||
#define MBEDTLS_ERR_NET_UNKNOWN_HOST -0x0052 /*< Failed to get an IP address for the given hostname. */
|
||||
#define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL -0x0043 /*< Buffer is too small to hold the data. */
|
||||
#define MBEDTLS_ERR_NET_INVALID_CONTEXT -0x0045 /*< The context is invalid, eg because it was free()ed. */
|
||||
#define MBEDTLS_ERR_NET_POLL_FAILED -0x0047 /*< Polling the net context failed. */
|
||||
#define MBEDTLS_ERR_NET_BAD_INPUT_DATA -0x0049 /*< Input invalid. */
|
||||
|
||||
/*
|
||||
* SSL Error codes
|
||||
*/
|
||||
#define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE -0x7080 /**< The requested feature is not available. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_INPUT_DATA -0x7100 /**< Bad input parameters to function. */
|
||||
#define MBEDTLS_ERR_SSL_INVALID_MAC -0x7180 /**< Verification of the message MAC failed. */
|
||||
#define MBEDTLS_ERR_SSL_INVALID_RECORD -0x7200 /**< An invalid SSL record was received. */
|
||||
#define MBEDTLS_ERR_SSL_CONN_EOF -0x7280 /**< The connection indicated an EOF. */
|
||||
#define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER -0x7300 /**< An unknown cipher was received. */
|
||||
#define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN -0x7380 /**< The server has no ciphersuites in common with the client. */
|
||||
#define MBEDTLS_ERR_SSL_NO_RNG -0x7400 /**< No RNG was provided to the SSL module. */
|
||||
#define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE -0x7480 /**< No client certification received from the client, but required by the authentication mode. */
|
||||
#define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE -0x7500 /**< Our own certificate(s) is/are too large to send in an SSL message. */
|
||||
#define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED -0x7580 /**< The own certificate is not set, but needed by the server. */
|
||||
#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED -0x7600 /**< The own private key or pre-shared key is not set, but needed. */
|
||||
#define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED -0x7680 /**< No CA Chain is set, but required to operate. */
|
||||
#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE -0x7700 /**< An unexpected message was received from our peer. */
|
||||
#define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE -0x7780 /**< A fatal alert message was received from our peer. */
|
||||
#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED -0x7800 /**< Verification of our peer failed. */
|
||||
#define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY -0x7880 /**< The peer notified us that the connection is going to be closed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO -0x7900 /**< Processing of the ClientHello handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO -0x7980 /**< Processing of the ServerHello handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE -0x7A00 /**< Processing of the Certificate handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST -0x7A80 /**< Processing of the CertificateRequest handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE -0x7B00 /**< Processing of the ServerKeyExchange handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE -0x7B80 /**< Processing of the ServerHelloDone handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE -0x7C00 /**< Processing of the ClientKeyExchange handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP -0x7C80 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS -0x7D00 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY -0x7D80 /**< Processing of the CertificateVerify handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC -0x7E00 /**< Processing of the ChangeCipherSpec handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_FINISHED -0x7E80 /**< Processing of the Finished handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_ALLOC_FAILED -0x7F00 /**< Memory allocation failed */
|
||||
#define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED -0x7F80 /**< Hardware acceleration function returned with error */
|
||||
#define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH -0x6F80 /**< Hardware acceleration function skipped / left alone data */
|
||||
#define MBEDTLS_ERR_SSL_COMPRESSION_FAILED -0x6F00 /**< Processing of the compression / decompression failed */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION -0x6E80 /**< Handshake protocol not within min/max boundaries */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET -0x6E00 /**< Processing of the NewSessionTicket handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED -0x6D80 /**< Session ticket has expired. */
|
||||
#define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH -0x6D00 /**< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */
|
||||
#define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY -0x6C80 /**< Unknown identity received (eg, PSK identity) */
|
||||
#define MBEDTLS_ERR_SSL_INTERNAL_ERROR -0x6C00 /**< Internal error (eg, unexpected failure in lower-level module) */
|
||||
#define MBEDTLS_ERR_SSL_COUNTER_WRAPPING -0x6B80 /**< A counter would wrap (eg, too many messages exchanged). */
|
||||
#define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO -0x6B00 /**< Unexpected message at ServerHello in renegotiation. */
|
||||
#define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED -0x6A80 /**< DTLS client must retry for hello verification */
|
||||
#define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL -0x6A00 /**< A buffer is too small to receive or write a message */
|
||||
#define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE -0x6980 /**< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */
|
||||
#define MBEDTLS_ERR_SSL_WANT_READ -0x6900 /**< No data of requested type currently available on underlying transport. */
|
||||
#define MBEDTLS_ERR_SSL_WANT_WRITE -0x6880 /**< Connection requires a write call. */
|
||||
#define MBEDTLS_ERR_SSL_TIMEOUT -0x6800 /**< The operation timed out. */
|
||||
#define MBEDTLS_ERR_SSL_CLIENT_RECONNECT -0x6780 /**< The client initiated a reconnect from the same port. */
|
||||
#define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD -0x6700 /**< Record header looks valid but is not expected. */
|
||||
#define MBEDTLS_ERR_SSL_NON_FATAL -0x6680 /**< The alert message received indicates a non-fatal error. */
|
||||
#define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH -0x6600 /**< Couldn't set the hash for verifying CertificateVerify */
|
||||
#define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING -0x6580 /**< Internal-only message signaling that further message-processing should be done */
|
||||
#define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS -0x6500 /**< The asynchronous operation is not completed yet. */
|
||||
#define MBEDTLS_ERR_SSL_EARLY_MESSAGE -0x6480 /**< Internal-only message signaling that a message arrived early. */
|
||||
#define MBEDTLS_ERR_SSL_UNEXPECTED_CID -0x6000 /**< An encrypted DTLS-frame with an unexpected CID was received. */
|
||||
#define MBEDTLS_ERR_SSL_VERSION_MISMATCH -0x5F00 /**< An operation failed due to an unexpected version or configuration. */
|
||||
#define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS -0x7000 /**< A cryptographic operation is in progress. Try again later. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_CONFIG -0x5E80 /**< Invalid value in SSL config */
|
||||
#define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE -0x7080 /*< The requested feature is not available. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_INPUT_DATA -0x7100 /*< Bad input parameters to function. */
|
||||
#define MBEDTLS_ERR_SSL_INVALID_MAC -0x7180 /*< Verification of the message MAC failed. */
|
||||
#define MBEDTLS_ERR_SSL_INVALID_RECORD -0x7200 /*< An invalid SSL record was received. */
|
||||
#define MBEDTLS_ERR_SSL_CONN_EOF -0x7280 /*< The connection indicated an EOF. */
|
||||
#define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER -0x7300 /*< An unknown cipher was received. */
|
||||
#define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN -0x7380 /*< The server has no ciphersuites in common with the client. */
|
||||
#define MBEDTLS_ERR_SSL_NO_RNG -0x7400 /*< No RNG was provided to the SSL module. */
|
||||
#define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE -0x7480 /*< No client certification received from the client, but required by the authentication mode. */
|
||||
#define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE -0x7500 /*< Our own certificate(s) is/are too large to send in an SSL message. */
|
||||
#define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED -0x7580 /*< The own certificate is not set, but needed by the server. */
|
||||
#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED -0x7600 /*< The own private key or pre-shared key is not set, but needed. */
|
||||
#define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED -0x7680 /*< No CA Chain is set, but required to operate. */
|
||||
#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE -0x7700 /*< An unexpected message was received from our peer. */
|
||||
#define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE -0x7780 /*< A fatal alert message was received from our peer. */
|
||||
#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED -0x7800 /*< Verification of our peer failed. */
|
||||
#define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY -0x7880 /*< The peer notified us that the connection is going to be closed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO -0x7900 /*< Processing of the ClientHello handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO -0x7980 /*< Processing of the ServerHello handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE -0x7A00 /*< Processing of the Certificate handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST -0x7A80 /*< Processing of the CertificateRequest handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE -0x7B00 /*< Processing of the ServerKeyExchange handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE -0x7B80 /*< Processing of the ServerHelloDone handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE -0x7C00 /*< Processing of the ClientKeyExchange handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP -0x7C80 /*< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS -0x7D00 /*< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY -0x7D80 /*< Processing of the CertificateVerify handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC -0x7E00 /*< Processing of the ChangeCipherSpec handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_FINISHED -0x7E80 /*< Processing of the Finished handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_ALLOC_FAILED -0x7F00 /*< Memory allocation failed */
|
||||
#define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED -0x7F80 /*< Hardware acceleration function returned with error */
|
||||
#define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH -0x6F80 /*< Hardware acceleration function skipped / left alone data */
|
||||
#define MBEDTLS_ERR_SSL_COMPRESSION_FAILED -0x6F00 /*< Processing of the compression / decompression failed */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION -0x6E80 /*< Handshake protocol not within min/max boundaries */
|
||||
#define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET -0x6E00 /*< Processing of the NewSessionTicket handshake message failed. */
|
||||
#define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED -0x6D80 /*< Session ticket has expired. */
|
||||
#define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH -0x6D00 /*< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */
|
||||
#define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY -0x6C80 /*< Unknown identity received (eg, PSK identity) */
|
||||
#define MBEDTLS_ERR_SSL_INTERNAL_ERROR -0x6C00 /*< Internal error (eg, unexpected failure in lower-level module) */
|
||||
#define MBEDTLS_ERR_SSL_COUNTER_WRAPPING -0x6B80 /*< A counter would wrap (eg, too many messages exchanged). */
|
||||
#define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO -0x6B00 /*< Unexpected message at ServerHello in renegotiation. */
|
||||
#define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED -0x6A80 /*< DTLS client must retry for hello verification */
|
||||
#define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL -0x6A00 /*< A buffer is too small to receive or write a message */
|
||||
#define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE -0x6980 /*< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */
|
||||
#define MBEDTLS_ERR_SSL_WANT_READ -0x6900 /*< No data of requested type currently available on underlying transport. */
|
||||
#define MBEDTLS_ERR_SSL_WANT_WRITE -0x6880 /*< Connection requires a write call. */
|
||||
#define MBEDTLS_ERR_SSL_TIMEOUT -0x6800 /*< The operation timed out. */
|
||||
#define MBEDTLS_ERR_SSL_CLIENT_RECONNECT -0x6780 /*< The client initiated a reconnect from the same port. */
|
||||
#define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD -0x6700 /*< Record header looks valid but is not expected. */
|
||||
#define MBEDTLS_ERR_SSL_NON_FATAL -0x6680 /*< The alert message received indicates a non-fatal error. */
|
||||
#define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH -0x6600 /*< Couldn't set the hash for verifying CertificateVerify */
|
||||
#define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING -0x6580 /*< Internal-only message signaling that further message-processing should be done */
|
||||
#define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS -0x6500 /*< The asynchronous operation is not completed yet. */
|
||||
#define MBEDTLS_ERR_SSL_EARLY_MESSAGE -0x6480 /*< Internal-only message signaling that a message arrived early. */
|
||||
#define MBEDTLS_ERR_SSL_UNEXPECTED_CID -0x6000 /*< An encrypted DTLS-frame with an unexpected CID was received. */
|
||||
#define MBEDTLS_ERR_SSL_VERSION_MISMATCH -0x5F00 /*< An operation failed due to an unexpected version or configuration. */
|
||||
#define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS -0x7000 /*< A cryptographic operation is in progress. Try again later. */
|
||||
#define MBEDTLS_ERR_SSL_BAD_CONFIG -0x5E80 /*< Invalid value in SSL config */
|
||||
|
||||
/*
|
||||
* Various constants
|
||||
|
@ -196,7 +196,7 @@ COSMOPOLITAN_C_START_
|
|||
*/
|
||||
|
||||
#if !defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME)
|
||||
#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
|
||||
#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /*< Lifetime of session tickets (if enabled) */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -211,7 +211,7 @@ COSMOPOLITAN_C_START_
|
|||
* peers are using it too!
|
||||
*/
|
||||
#if !defined(MBEDTLS_SSL_MAX_CONTENT_LEN)
|
||||
#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
|
||||
#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /*< Size of the input / output buffer */
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_SSL_IN_CONTENT_LEN)
|
||||
|
@ -261,8 +261,8 @@ COSMOPOLITAN_C_START_
|
|||
/*
|
||||
* Signaling ciphersuite values (SCSV)
|
||||
*/
|
||||
#define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO 0xFF /**< renegotiation info ext */
|
||||
#define MBEDTLS_SSL_FALLBACK_SCSV_VALUE 0x5600 /**< RFC 7507 section 2 */
|
||||
#define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO 0xFF /*< renegotiation info ext */
|
||||
#define MBEDTLS_SSL_FALLBACK_SCSV_VALUE 0x5600 /*< RFC 7507 section 2 */
|
||||
|
||||
/*
|
||||
* Supported Signature and Hash algorithms (For TLS 1.2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue