Skip to content

Commit

Permalink
Do not vendor Brotli libraries
Browse files Browse the repository at this point in the history
This crate is very outdated. The Brotli version it vendors is old and
affected by CVE-2020-8927. Build against the system-provided libbrotli
instead, that way it can be updated independently, without having to
update the Rust bindings.
  • Loading branch information
ruuda committed Oct 16, 2022
1 parent 5e7335c commit ec1c87e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 61 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "brotli-sys/brotli"]
path = brotli-sys/brotli
url = https://github.com/google/brotli
15 changes: 0 additions & 15 deletions brotli-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
name = "brotli-sys"
version = "0.3.2"
authors = ["Alex Crichton <[email protected]>"]
build = "build.rs"
links = "brotli"
license = "MIT/Apache-2.0"
repository = "https://github.com/alexcrichton/brotli2-rs"
homepage = "https://github.com/alexcrichton/brotli2-rs"
Expand All @@ -13,18 +11,5 @@ Raw bindings to libbrotli
"""
categories = ["external-ffi-bindings"]

include = [
"src/*",
"brotli/enc/*",
"brotli/dec/*",
"brotli/common/*",
"brotli/include/*",
"Cargo.toml",
"build.rs"
]

[dependencies]
libc = "0.2"

[build-dependencies]
cc = "1.0"
1 change: 0 additions & 1 deletion brotli-sys/brotli
Submodule brotli deleted from 46c1a8
42 changes: 0 additions & 42 deletions brotli-sys/build.rs

This file was deleted.

2 changes: 2 additions & 0 deletions brotli-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: BrotliDecoderErrorCode = -27
pub const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: BrotliDecoderErrorCode = -30;
pub const BROTLI_DECODER_ERROR_UNREACHABLE: BrotliDecoderErrorCode = -31;

#[link(name = "brotlidec")]
extern "C" {
pub fn BrotliDecoderCreateInstance(alloc_func: brotli_alloc_func,
free_func: brotli_free_func,
Expand Down Expand Up @@ -119,6 +120,7 @@ pub const BROTLI_DEFAULT_MODE: u32 = 0;

pub enum BrotliEncoderState {}

#[link(name = "brotlienc")]
extern "C" {
pub fn BrotliEncoderSetParameter(state: *mut BrotliEncoderState,
param: BrotliEncoderParameter,
Expand Down

0 comments on commit ec1c87e

Please sign in to comment.