mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-27 15:52:28 +00:00
Add SSL to redbean
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
This commit is contained in:
parent
1beeb7a829
commit
cc1920749e
1032 changed files with 152673 additions and 69310 deletions
63
third_party/mbedtls/ssl_invasive.h
vendored
63
third_party/mbedtls/ssl_invasive.h
vendored
|
@ -1,38 +1,11 @@
|
|||
/* clang-format off */
|
||||
|
||||
/**
|
||||
* \file ssl_invasive.h
|
||||
*
|
||||
* \brief SSL module: interfaces for invasive testing only.
|
||||
*
|
||||
* The interfaces in this file are intended for testing purposes only.
|
||||
* They SHOULD NOT be made available in library integrations except when
|
||||
* building the library for testing.
|
||||
*/
|
||||
/*
|
||||
* Copyright The Mbed TLS Contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef MBEDTLS_SSL_INVASIVE_H
|
||||
#define MBEDTLS_SSL_INVASIVE_H
|
||||
|
||||
#ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_SSL_INVASIVE_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_SSL_INVASIVE_H_
|
||||
#include "third_party/mbedtls/common.h"
|
||||
#include "third_party/mbedtls/md.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
||||
|
||||
#if defined(MBEDTLS_TEST_HOOKS) && \
|
||||
defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
||||
/** \brief Compute the HMAC of variable-length data with constant flow.
|
||||
*
|
||||
* This function computes the HMAC of the concatenation of \p add_data and \p
|
||||
|
@ -67,12 +40,11 @@
|
|||
* \retval MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED
|
||||
* The hardware accelerator failed.
|
||||
*/
|
||||
int mbedtls_ssl_cf_hmac(
|
||||
mbedtls_md_context_t *ctx,
|
||||
const unsigned char *add_data, size_t add_data_len,
|
||||
const unsigned char *data, size_t data_len_secret,
|
||||
size_t min_data_len, size_t max_data_len,
|
||||
unsigned char *output );
|
||||
int mbedtls_ssl_cf_hmac(mbedtls_md_context_t *ctx,
|
||||
const unsigned char *add_data, size_t add_data_len,
|
||||
const unsigned char *data, size_t data_len_secret,
|
||||
size_t min_data_len, size_t max_data_len,
|
||||
unsigned char *output);
|
||||
|
||||
/** \brief Copy data from a secret position with constant flow.
|
||||
*
|
||||
|
@ -92,11 +64,12 @@ int mbedtls_ssl_cf_hmac(
|
|||
* \param offset_max The maximal value of \p offset_secret.
|
||||
* \param len The number of bytes to copy.
|
||||
*/
|
||||
void mbedtls_ssl_cf_memcpy_offset( unsigned char *dst,
|
||||
const unsigned char *src_base,
|
||||
size_t offset_secret,
|
||||
size_t offset_min, size_t offset_max,
|
||||
size_t len );
|
||||
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
||||
void mbedtls_ssl_cf_memcpy_offset(unsigned char *dst,
|
||||
const unsigned char *src_base,
|
||||
size_t offset_secret, size_t offset_min,
|
||||
size_t offset_max, size_t len);
|
||||
|
||||
#endif /* MBEDTLS_SSL_INVASIVE_H */
|
||||
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MBEDTLS_SSL_INVASIVE_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue