mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
cc1920749e
Your redbean can now interoperate with clients that require TLS crypto. This is accomplished using a protocol polyglot that lets us distinguish between HTTP and HTTPS regardless of the port number. Certificates will be generated automatically, if none are supplied by the user. Footprint increases by only a few hundred kb so redbean in MODY=tiny is now 1.0mb - Add lseek() polyfills for ZIP executable - Automatically polyfill /tmp/FOO paths on NT - Fix readdir() / ftw() / nftw() bugs on Windows - Introduce -B flag for slower SSL that's stronger - Remove mbedtls features Cosmopolitan doesn't need - Have base64 decoder support the uri-safe alternative - Remove Truncated HMAC because it's forbidden by the IETF - Add all the mbedtls test suites and make them go 3x faster - Support opendir() / readdir() / closedir() on ZIP executable - Use Everest for ECDHE-ECDSA because it's so good it's so good - Add tinier implementation of sha1 since it's not worth the rom - Add chi-square monte-carlo mean correlation tests for getrandom() - Source entropy on Windows from the proper interface everyone uses We're continuing to outperform NGINX and other servers on raw message throughput. Using SSL means that instead of 1,000,000 qps you can get around 300,000 qps. However redbean isn't as fast as NGINX yet at SSL handshakes, since redbean can do 2,627 per second and NGINX does 4.3k Right now, the SSL UX story works best if you give your redbean a key signing key since that can be easily generated by openssl using a one liner then redbean will do all the things that are impossibly hard to do like signing ecdsa and rsa certificates that'll work in chrome. We should integrate the let's encrypt acme protocol in the future. Live Demo: https://redbean.justine.lol/ Root Cert: https://redbean.justine.lol/redbean1.crt
53 lines
2.4 KiB
C
53 lines
2.4 KiB
C
#ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_CCM_H_
|
|
#define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_CCM_H_
|
|
#include "third_party/mbedtls/cipher.h"
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
|
|
#define MBEDTLS_ERR_CCM_BAD_INPUT \
|
|
-0x000D /**< Bad input parameters to the function. */
|
|
#define MBEDTLS_ERR_CCM_AUTH_FAILED \
|
|
-0x000F /**< Authenticated decryption failed. */
|
|
|
|
/* MBEDTLS_ERR_CCM_HW_ACCEL_FAILED is deprecated and should not be used. */
|
|
#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED \
|
|
-0x0011 /**< CCM hardware accelerator failed. */
|
|
|
|
/**
|
|
* \brief The CCM context-type definition. The CCM context is passed
|
|
* to the APIs called.
|
|
*/
|
|
typedef struct mbedtls_ccm_context {
|
|
mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */
|
|
} mbedtls_ccm_context;
|
|
|
|
void mbedtls_ccm_init(mbedtls_ccm_context *);
|
|
int mbedtls_ccm_setkey(mbedtls_ccm_context *, mbedtls_cipher_id_t,
|
|
const unsigned char *, unsigned int);
|
|
void mbedtls_ccm_free(mbedtls_ccm_context *);
|
|
int mbedtls_ccm_encrypt_and_tag(mbedtls_ccm_context *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, unsigned char *,
|
|
unsigned char *, size_t);
|
|
int mbedtls_ccm_star_encrypt_and_tag(mbedtls_ccm_context *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, unsigned char *,
|
|
unsigned char *, size_t);
|
|
int mbedtls_ccm_auth_decrypt(mbedtls_ccm_context *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, unsigned char *,
|
|
const unsigned char *, size_t);
|
|
int mbedtls_ccm_star_auth_decrypt(mbedtls_ccm_context *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, size_t,
|
|
const unsigned char *, unsigned char *,
|
|
const unsigned char *, size_t);
|
|
|
|
int mbedtls_ccm_self_test(int);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_THIRD_PARTY_MBEDTLS_CCM_H_ */
|