From b67cb09f8ddf258cf326f3e7b20be095fb53457c Mon Sep 17 00:00:00 2001 From: Todd Short Date: Mon, 9 Aug 2021 16:56:50 -0400 Subject: Add support for compressed certificates (RFC8879) * Compressed Certificate extension (server/client) * Server certificates (send/receive) * Client certificate (send/receive) Reviewed-by: Matt Caswell Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/18186) --- crypto/comp/c_brotli.c | 6 +++--- crypto/comp/c_zstd.c | 6 +++--- crypto/comp/comp_err.c | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'crypto/comp') diff --git a/crypto/comp/c_brotli.c b/crypto/comp/c_brotli.c index ace6f221b8..377ea2b8d0 100644 --- a/crypto/comp/c_brotli.c +++ b/crypto/comp/c_brotli.c @@ -419,10 +419,10 @@ static const BIO_METHOD bio_meth_brotli = { const BIO_METHOD *BIO_f_brotli(void) { #ifndef OPENSSL_NO_BROTLI - return &bio_meth_brotli; -#else - return NULL; + if (RUN_ONCE(&brotli_once, ossl_comp_brotli_init)) + return &bio_meth_brotli; #endif + return NULL; } #ifndef OPENSSL_NO_BROTLI diff --git a/crypto/comp/c_zstd.c b/crypto/comp/c_zstd.c index 99d326219e..15b826c589 100644 --- a/crypto/comp/c_zstd.c +++ b/crypto/comp/c_zstd.c @@ -481,10 +481,10 @@ static const BIO_METHOD bio_meth_zstd = { const BIO_METHOD *BIO_f_zstd(void) { #ifndef OPENSSL_NO_ZSTD - return &bio_meth_zstd; -#else - return NULL; + if (RUN_ONCE(&zstd_once, ossl_comp_zstd_init)) + return &bio_meth_zstd; #endif + return NULL; } #ifndef OPENSSL_NO_ZSTD diff --git a/crypto/comp/comp_err.c b/crypto/comp/comp_err.c index 10a9e66860..2345da693e 100644 --- a/crypto/comp/comp_err.c +++ b/crypto/comp/comp_err.c @@ -19,12 +19,8 @@ static const ERR_STRING_DATA COMP_str_reasons[] = { {ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_DECODE_ERROR), "brotli decode error"}, - {ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_DEFLATE_ERROR), - "brotli deflate error"}, {ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_ENCODE_ERROR), "brotli encode error"}, - {ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_INFLATE_ERROR), - "brotli inflate error"}, {ERR_PACK(ERR_LIB_COMP, 0, COMP_R_BROTLI_NOT_SUPPORTED), "brotli not supported"}, {ERR_PACK(ERR_LIB_COMP, 0, COMP_R_ZLIB_DEFLATE_ERROR), -- cgit v1.2.3