commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
65038a4166e0ecdadafeb567f9fa994f1ecb36b9 | Tony Arcieri | 2021-10-14T17:27:33 | der: add `SequenceOf` type (#95)
Adds a type for `SequenceOf`, backed by the internal `ArrayVec` type.
This allows for array-backed storage of an ASN.1 SEQUENCE OF, where the array size acts as a maximum, rather than an exact length requirement.
Support for modeling `[T; N]` as a SEQUENCE OF is retained, and now... | diff --git a/der/src/arrayvec.rs b/der/src/arrayvec.rs
index ebe5acb7..c1d3b13f 100644
--- a/der/src/arrayvec.rs
+++ b/der/src/arrayvec.rs
@@ -3,9 +3,10 @@
// See: https://github.com/rust-lang/rfcs/pull/2990
use crate::{ErrorKind, Result};
+use core::convert::TryInto;
/// Array-backed append-only vector type.
-#... | 5 | 145 | 19 |
e4be4b66ec57eda44aa7d9ade3f6192d36c7a998 | Tony Arcieri | 2021-10-14T16:41:21 | der: remove `SetOf*` HRTBs (#94)
None of these are necessary as the relevant lifetimes are in-scope. They
also make the bounds overly general such that types unexpectedly won't
receive impls.
It seems like they were leftover from refactoring but never properly
removed. This commit removes them. | diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs
index ab90ae0a..bf4d18a1 100644
--- a/der/src/asn1/set_of.rs
+++ b/der/src/asn1/set_of.rs
@@ -93,7 +93,7 @@ where
impl<'a, T, const N: usize> DecodeValue<'a> for SetOfArray<T, N>
where
- T: Clone + for<'b> Decodable<'b> + Ord,
+ T: Clone + Decodable... | 1 | 6 | 6 |
694dcc648861ccb783f1e40b420922db6b36664b | Tony Arcieri | 2021-10-14T02:01:07 | der: extract ArrayVec type (#93)
Extracts a stack-allocated vector type for use storing `SET OF` and
`SEQUENCE OF`. | diff --git a/der/src/arrayvec.rs b/der/src/arrayvec.rs
new file mode 100644
index 00000000..ebe5acb7
--- /dev/null
+++ b/der/src/arrayvec.rs
@@ -0,0 +1,64 @@
+//! Array-backed append-only vector type.
+// TODO(tarcieri): use `core` impl of `ArrayVec`
+// See: https://github.com/rust-lang/rfcs/pull/2990
+
+use crate::{E... | 6 | 83 | 34 |
065828c8c7ff910c92835fde02f9b9377ba3a6e7 | Tony Arcieri | 2021-10-14T00:20:58 | der: improve `SEQUENCE OF` bounds (#92)
Removes a `Copy` bound from the `SEQUENCE OF` decoder bound on `[T; N]` | diff --git a/der/src/asn1/sequence.rs b/der/src/asn1/sequence.rs
index 2f2bee57..cc3da7b0 100644
--- a/der/src/asn1/sequence.rs
+++ b/der/src/asn1/sequence.rs
@@ -89,12 +89,12 @@ impl<'a> Tagged for Sequence<'a> {
impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]
where
- // TODO(tarcieri): remove `Copy` + `... | 1 | 3 | 3 |
15c6318eef18979628154ee316bb8ad3f277f18f | Tony Arcieri | 2021-10-13T15:27:06 | der: add `SEQUENCE OF` support for `[T; N]` (#90)
Uses const generic arrays to model ASN.1 `SEQUENCE OF`.
Unfortunately this currently requires `Copy` + `Default` bounds in order
to safely initialize the array.
There are two ways to work around these bounds:
1. Remove `forbid(unsafe_code)` and use `core::mem... | diff --git a/der/src/asn1/sequence.rs b/der/src/asn1/sequence.rs
index 3cfb197f..2f2bee57 100644
--- a/der/src/asn1/sequence.rs
+++ b/der/src/asn1/sequence.rs
@@ -4,8 +4,8 @@ pub(super) mod iter;
use self::iter::SequenceIter;
use crate::{
- asn1::Any, ByteSlice, Decodable, DecodeValue, Decoder, EncodeValue, Enco... | 2 | 53 | 2 |
bc5c61cc72b7c29f4131da4dab9c01ac94d6a3aa | Tony Arcieri | 2021-10-13T14:19:03 | der: simplify `SetOf*` bounds (#89)
Reduces the number of trait bounds used by the `SetOf` trait and
respective impls to just the ones that are actually necessary. | diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs
index 5999dc80..ecd59862 100644
--- a/der/src/asn1/set_of.rs
+++ b/der/src/asn1/set_of.rs
@@ -7,10 +7,7 @@ use crate::{
use core::{convert::TryFrom, marker::PhantomData};
#[cfg(feature = "alloc")]
-use {
- crate::Header,
- alloc::collections::{btree... | 1 | 23 | 37 |
c02620b3df6b8fb5d6481789528abf07e268a9ef | Daniel James | 2021-10-13T02:29:33 | fix typo in docs
- introduced in https://github.com/RustCrypto/formats/commit/566abc5ef466a6b85d37ec8a779500f906dff8ce#diff-1881a4036b1e4d7639041e44cda3f8bbbf2051ae14e274736c04417ccb3acf8bR21 | diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs
index caa2ddd7..5999dc80 100644
--- a/der/src/asn1/set_of.rs
+++ b/der/src/asn1/set_of.rs
@@ -18,8 +18,7 @@ use {
/// When encoded as DER, `SET OF` is lexicographically ordered. To implement
/// that requirement, types `T` which are elements of [`SetOf`] MU... | 1 | 1 | 2 |
415a42640f906488b31c836fb634f403aef24ce8 | Tony Arcieri | 2021-10-12T14:41:58 | const-oid: fix off-by-one error parsing large BER arcs (#84)
Arcs are currently modeled as `u32`. When encoded as base 128, they can
be up to 5 bytes, since the 4 preceeding bytes provide only 7-bits of
the final integer value. | diff --git a/const-oid/src/arcs.rs b/const-oid/src/arcs.rs
index 5041021f..7b894b60 100644
--- a/const-oid/src/arcs.rs
+++ b/const-oid/src/arcs.rs
@@ -1,16 +1,22 @@
//! Arcs are integer values which exist within an OID's hierarchy.
use crate::{Error, ObjectIdentifier, Result};
-use core::convert::TryFrom;
+use core... | 4 | 49 | 36 |
65fbe570413b1140e1d28cafdc9a64ff2483061e | Daniel James | 2021-10-09T20:58:13 | pkcs5: refactor `Error` and `Result` usage (#26)
- introduce `Error` enum with new error cases
- introduce specialized `Result` type for crate
- rewrite references to `der` crate `Error` and `Result` types
- some collateral refactoring as well | diff --git a/pkcs5/src/error.rs b/pkcs5/src/error.rs
new file mode 100644
index 00000000..60571b3b
--- /dev/null
+++ b/pkcs5/src/error.rs
@@ -0,0 +1,56 @@
+//! Error types
+
+use core::fmt;
+use der::asn1::ObjectIdentifier;
+
+/// Result type
+pub type Result<T> = core::result::Result<T, Error>;
+
+/// Error type
+#[de... | 6 | 209 | 145 |
74742f5691a6ec10a04e0bc8e7f774f754137ca4 | Carl Wallace | 2021-10-09T19:38:36 | x509: add encoder/decoder for Validity structure (#81) | diff --git a/Cargo.lock b/Cargo.lock
index 96b1ba04..ef4ecb48 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -947,6 +947,7 @@ name = "x509"
version = "0.0.1"
dependencies = [
"der",
+ "hex-literal",
"spki",
]
diff --git a/x509/Cargo.toml b/x509/Cargo.toml
index 05f36cca..ee5c5854 100644
--- a/x509/Cargo.toml
+++ ... | 6 | 165 | 3 |
5c58533557e52f45db9ec4335248ce1b5e094801 | Tony Arcieri | 2021-10-07T18:22:46 | der: use `EncodeValue` for ASN.1 types (#80)
Types which impl this trait are more flexible (can be used in `IMPLICIT`
fields) and this also eliminates some of the complexity of encoding
these types via a blanket impl of `Encodable`. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 05c76ff0..7b519b03 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -1,8 +1,8 @@
//! ASN.1 `ANY` type.
use crate::{
- asn1::*, ByteSlice, Choice, Decodable, DecodeValue, Decoder, Encodable, Encoder, Error,
- ErrorKind, Header, Length, R... | 15 | 124 | 124 |
95dc0ba7e5c4e576f208c344166e54d936f76305 | Tony Arcieri | 2021-10-07T02:48:33 | der: use `DecodeValue` for `decode_implicit` bounds (#78)
Support for decoding the value of IMPLICIT context specific fields using
the `DecodeValue` trait. | diff --git a/der/src/asn1/context_specific.rs b/der/src/asn1/context_specific.rs
index 3de94fc1..05fe174a 100644
--- a/der/src/asn1/context_specific.rs
+++ b/der/src/asn1/context_specific.rs
@@ -1,8 +1,8 @@
//! Context-specific field.
use crate::{
- asn1::Any, Choice, Decodable, Decoder, Encodable, Encoder, Erro... | 2 | 13 | 13 |
ab42e47f43634c658a094260876a519aa1171434 | Tony Arcieri | 2021-10-07T02:35:21 | der: refactor `ContextSpecific` decoder (#77)
Extracts a `decode_with` function that uses a callback function to
implement decoding. | diff --git a/der/src/asn1/context_specific.rs b/der/src/asn1/context_specific.rs
index 4a8acb12..3de94fc1 100644
--- a/der/src/asn1/context_specific.rs
+++ b/der/src/asn1/context_specific.rs
@@ -43,16 +43,15 @@ impl<T> ContextSpecific<T> {
where
T: Decodable<'a>,
{
- if let Some(any) = Self::d... | 1 | 22 | 18 |
3e750b205cf4b53d98c4120335a59a3a46e353b2 | Tony Arcieri | 2021-10-07T01:56:46 | der: impl Display for DateTime (#76) | diff --git a/der/src/datetime.rs b/der/src/datetime.rs
index d81933fc..64ff7837 100644
--- a/der/src/datetime.rs
+++ b/der/src/datetime.rs
@@ -6,7 +6,7 @@
// Released under the MIT OR Apache 2.0 licenses
use crate::{Encoder, ErrorKind, Result, Tag};
-use core::time::Duration;
+use core::{fmt, time::Duration};
//... | 1 | 19 | 1 |
0ee952c1e0b8fe801ef2e2805dafb8b1297ef045 | Tony Arcieri | 2021-10-07T01:34:13 | der: expose `DateTime` through public API (#75)
Debatably we should switch to something like `chrono`, but since we have
a rich built-in date-and-time type we might as well expose it. | diff --git a/der/src/asn1/generalized_time.rs b/der/src/asn1/generalized_time.rs
index 103534cb..d79c5d57 100644
--- a/der/src/asn1/generalized_time.rs
+++ b/der/src/asn1/generalized_time.rs
@@ -79,7 +79,7 @@ impl DecodeValue<'_> for GeneralizedTime {
DateTime::new(year, month, day, hour, minute, sec... | 5 | 81 | 80 |
448d5fb186c1819b0b63bec233094bd551a344d0 | Tony Arcieri | 2021-10-07T00:45:56 | der: factor context specific methods into relevant module (#74)
Factors the methods for decoding context specific types into the
`context_specific` module. | diff --git a/der/src/asn1/context_specific.rs b/der/src/asn1/context_specific.rs
index 75bc293d..4a8acb12 100644
--- a/der/src/asn1/context_specific.rs
+++ b/der/src/asn1/context_specific.rs
@@ -2,7 +2,7 @@
use crate::{
asn1::Any, Choice, Decodable, Decoder, Encodable, Encoder, Error, Header, Length, Result, Ta... | 2 | 155 | 40 |
b5e05b717d4542fa4aad61aeb51085604cde1b94 | Tony Arcieri | 2021-09-28T22:59:01 | Bump `der`-dependent crates to prerelease versions (#62)
RustCrypto/formats#61 contained breaking changes to the public API.
As such, this commit bumps `der` and all of the crates which depend on
it to prerelease versions to reflect that | diff --git a/Cargo.lock b/Cargo.lock
index 36a1055c..d4d3ea19 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -103,7 +103,7 @@ dependencies = [
[[package]]
name = "der"
-version = "0.4.3"
+version = "0.5.0-pre"
dependencies = [
"const-oid",
"crypto-bigint",
@@ -197,7 +197,7 @@ dependencies = [
[[package]]
name... | 8 | 23 | 23 |
923727c6629d0dc6dde4bca5e99c7f0df9ec5158 | Tony Arcieri | 2021-09-28T22:39:20 | der: add support for IMPLICIT mode CONTEXT-SPECIFIC (#61)
Adds preliminary support for `IMPLICIT`, splitting
`Decoder::context_specific` into separate `_explicit` and `_implicit`
versions.
Two functions are necessary for now because they have different trait
bounds, and furthermore, support for `IMPLICIT` fields... | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 6e78699e..eb8165b9 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -160,6 +160,12 @@ impl<'a> Encodable for Any<'a> {
}
}
+impl<'a> From<Any<'a>> for ByteSlice<'a> {
+ fn from(any: Any<'a>) -> ByteSlice<'a> {
+ any.value
+ }... | 13 | 395 | 88 |
4855ff0c5c0f7116ce062767799cc9a02ebaec49 | Tony Arcieri | 2021-09-27T21:23:01 | der: make `ContextSpecific` generic around an inner type (#60)
This makes it possible to use the inner type's `Encode` impl regardless
of what it is, which likewise eliminates the need to have special case
hacks around `BIT STRING` to strip the leading zero. | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index 512b5ee3..a0c8804a 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -3,6 +3,7 @@
mod any;
mod bit_string;
mod boolean;
+mod choice;
mod context_specific;
mod generalized_time;
mod ia5_string;
@@ -21,6 +22,7 @@ mod utf8_string;
pub use self::{
any::An... | 23 | 112 | 205 |
e7b5f5c21b04d974c02141dbc7419658b69cfa31 | Tony Arcieri | 2021-09-27T16:50:43 | der: generalize leading octet support for `Any` (#59)
This is a prerequisite for supporting IMPLICIT BIT STRING values, which
can be prefixed by any e.g. CONTEXT SPECIFIC tag.
See also: #55 | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 33d9a2c1..154bf5cb 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -26,6 +26,16 @@ pub struct Any<'a> {
/// Encoded length of this [`Any`] value.
length: Length,
+ /// An optional "leading octet" of the inner value, stored separat... | 6 | 98 | 79 |
77564c368c60486dbbdfb6e8ab6b1ec9f79aba62 | Tony Arcieri | 2021-09-19T17:16:40 | sec1: rustdoc improvements (#49) | diff --git a/sec1/src/lib.rs b/sec1/src/lib.rs
index f556b8c3..bf788a83 100644
--- a/sec1/src/lib.rs
+++ b/sec1/src/lib.rs
@@ -1,11 +1,13 @@
//! Pure Rust implementation of [SEC1: Elliptic Curve Cryptography] encoding
-//! formats including ASN.1 DER-serialized private keys as well as the
-//! `Elliptic-Curve-Point-to... | 2 | 10 | 5 |
1dad2e941d0c0a47f7f2cfa1a5dbce403eca1497 | Tony Arcieri | 2021-09-19T17:10:01 | sec1: use manual impl of `(Partial)Ord` on EncodedPoint (#48)
The derived versions aren't working because they are attempting to
compare values on the generic typenum, which doesn't impl the proper
traits to allow the derive to work. | diff --git a/sec1/src/point.rs b/sec1/src/point.rs
index a449c9df..f5d565df 100644
--- a/sec1/src/point.rs
+++ b/sec1/src/point.rs
@@ -6,6 +6,7 @@
use crate::{Error, Result};
use core::{
+ cmp::Ordering,
fmt::{self, Debug},
ops::Add,
};
@@ -60,7 +61,7 @@ impl_modulus_size!(U28, U32, U48, U66);
/// Th... | 2 | 24 | 3 |
1b8968a3f4075052969350150f8c8b35728c3a69 | Tony Arcieri | 2021-09-19T16:50:30 | sec1: use manual impl of `(Partial)Eq` on EncodedPoint (#47)
The derived versions aren't working because they are attempting to
compare values on the generic typenum, which doesn't impl the proper
traits to allow the derive to work. | diff --git a/sec1/src/point.rs b/sec1/src/point.rs
index 37403692..a449c9df 100644
--- a/sec1/src/point.rs
+++ b/sec1/src/point.rs
@@ -60,7 +60,7 @@ impl_modulus_size!(U28, U32, U48, U66);
/// This type is an enum over the compressed and uncompressed encodings,
/// useful for cases where either encoding can be suppor... | 1 | 12 | 1 |
236a13124d63dc8d2e8074d94b9491b02987fdc8 | Tony Arcieri | 2021-09-17T00:12:37 | pem-rfc7468: refactor decoder (#41)
- Moves decoding of encapsulated text to an inherent method of
`Encapsulation`
- Changes the return type of this method to be the portion of the buffer
containing the decoded data | diff --git a/pem-rfc7468/src/decoder.rs b/pem-rfc7468/src/decoder.rs
index da67df3c..0ed25620 100644
--- a/pem-rfc7468/src/decoder.rs
+++ b/pem-rfc7468/src/decoder.rs
@@ -28,9 +28,8 @@ use core::{convert::TryFrom, str};
pub fn decode<'i, 'o>(pem: &'i [u8], buf: &'o mut [u8]) -> Result<(&'i str, &'o [u8])> {
let e... | 2 | 87 | 89 |
46a02c5e43a213e20e07af1e6bc19512c6a5fd97 | Tony Arcieri | 2021-09-16T20:59:40 | sec1: better leverage `TryFrom` (#39)
Replaces some trait methods with `TryFrom`, and adds a
`TryFrom<EcPrivateKey>` bound to `FromEcPrivateKey`. | diff --git a/sec1/src/error.rs b/sec1/src/error.rs
index 7d64576b..54e1aa4e 100644
--- a/sec1/src/error.rs
+++ b/sec1/src/error.rs
@@ -5,10 +5,6 @@ use core::fmt;
#[cfg(feature = "pem")]
use crate::pem;
-/// Message to display when an `expect`-ed DER encoding error occurs
-#[cfg(feature = "alloc")]
-pub(crate) cons... | 3 | 23 | 32 |
8c551d478478d957924b5c611e3cba1595c1451d | Tony Arcieri | 2021-09-15T14:12:00 | der: add `Tag::unexpected_error` (#33)
Adds a helper method for constructing `der::Error::UnexpectedTag` from a
tag value and an optional expected tag value. | diff --git a/der/src/asn1/context_specific.rs b/der/src/asn1/context_specific.rs
index f998cd3c..76dcad4d 100644
--- a/der/src/asn1/context_specific.rs
+++ b/der/src/asn1/context_specific.rs
@@ -1,8 +1,7 @@
//! Context-specific field.
use crate::{
- asn1::Any, Choice, Decodable, Encodable, Encoder, Error, ErrorK... | 2 | 13 | 12 |
ac144838680ae6990ee2cdd6bf76bd71ca750a86 | Tony Arcieri | 2021-09-15T00:04:00 | pkcs5: remove DES encryption support (#25)
Removes support for encrypting keys using 56-bit DES, which is trivially
broken due to its small key size.
This functionality is already gated under the off-by-default
`des-insecure` feature, however there is little reason why anyone should
be encrypting DES keys today,... | diff --git a/pkcs5/src/pbes2/encryption.rs b/pkcs5/src/pbes2/encryption.rs
index 71d2f1ac..17a99fd1 100644
--- a/pkcs5/src/pbes2/encryption.rs
+++ b/pkcs5/src/pbes2/encryption.rs
@@ -51,18 +51,14 @@ pub fn encrypt_in_place<'b>(
.map_err(|_| CryptoError)?;
cipher.encrypt(buffer, pos).map_er... | 1 | 2 | 6 |
ee0e403c87cc00266f6e669d6dcda3696b494b3b | Tony Arcieri | 2021-09-14T23:34:23 | der: increase `Length::MAX` to 256 MiB (#24)
There are legitimate cryptographic use cases that need to support
ASN.1 DER-encoded documents larger than the previous maximum of 1 MiB.
Two notable applications are where messages can be quite large are:
- Certificate Revocation Lists (CRLs)
- Cryptographic Message... | diff --git a/der/src/length.rs b/der/src/length.rs
index 8b01cd84..7212385c 100644
--- a/der/src/length.rs
+++ b/der/src/length.rs
@@ -7,12 +7,12 @@ use core::{
ops::Add,
};
-/// Maximum length as a `u32` (1 MiB).
-const MAX_U32: u32 = 0xf_ffff;
+/// Maximum length as a `u32` (256 MiB).
+const MAX_U32: u32 = 0x... | 1 | 8 | 6 |
b1c3c0f0881cc25cb9328dd3e95aaddd7e1c0117 | Daniel James | 2021-09-14T20:09:52 | Add pem_rfc7468::decode_label (#22)
Decode the encapsulation boundaries of a PEM document, returning the label.
The motivation is to capture the document label in the case of an error
(by repeating the decoding only to extract the label) | diff --git a/pem-rfc7468/src/decoder.rs b/pem-rfc7468/src/decoder.rs
index 138a622b..518e176a 100644
--- a/pem-rfc7468/src/decoder.rs
+++ b/pem-rfc7468/src/decoder.rs
@@ -44,6 +44,12 @@ fn decode_encapsulated_text<'i, 'o>(
}
Ok(())
}
+/// Decode the encapsulation boundaries of a PEM document according to RFC... | 3 | 11 | 1 |
c406b5aed729ff6d313df40004b94d7d67139b88 | Tony Arcieri | 2021-09-14T20:08:51 | pem-rfc7468: rename `Error::HeaderDisallowed` (#21)
It was previously `Error::HeaderDetected`, however that doesn't really
indicate why it's an error.
The new error message notes that headers are explicitly disallowed in
the RFC7468 interpretation of PEM. | diff --git a/pem-rfc7468/src/decoder.rs b/pem-rfc7468/src/decoder.rs
index d0bf5d64..138a622b 100644
--- a/pem-rfc7468/src/decoder.rs
+++ b/pem-rfc7468/src/decoder.rs
@@ -34,7 +34,7 @@ fn decode_encapsulated_text<'i, 'o>(
// and we error, then attribute the error to an unsupported header
... | 3 | 8 | 8 |
a9fb07546cccfae14cbe231a5be6b0b76d1d142c | Jacob Lifshay | 2023-01-16T06:34:10 | change fields of ScopedKey to be private to prevent UB from safe code
Fixes: #23 | diff --git a/src/lib.rs b/src/lib.rs
index 789ee1c..4727500 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -52,14 +52,12 @@ use std::{cell::Cell, marker, thread::LocalKey};
macro_rules! scoped_thread_local {
($(#[$attrs:meta])* $vis:vis static $name:ident: $ty:ty) => (
$(#[$attrs])*
- $vis static $na... | 1 | 18 | 12 |
5b15ad5e3c47a4c583a59a739fe458f6150ff530 | Jacob Lifshay | 2023-01-16T06:49:22 | format code | diff --git a/src/lib.rs b/src/lib.rs
index d4567c2..789ee1c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -45,9 +45,7 @@
#![deny(missing_docs, warnings)]
-use std::cell::Cell;
-use std::marker;
-use std::thread::LocalKey;
+use std::{cell::Cell, marker, thread::LocalKey};
/// The macro. See the module level docume... | 1 | 20 | 17 |
c0ff7bf6d33e568353ed863d90f893e7e80a0ed1 | Alex Crichton | 2022-10-31T15:01:46 | Bump to 1.0.1 | diff --git a/Cargo.toml b/Cargo.toml
index f0caa4a..6ef9917 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "scoped-tls"
-version = "1.0.0"
+version = "1.0.1"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
5671427253556905f3e35edb3d566ebc2b2c0183 | Noa | 2022-10-27T00:05:48 | Use a *const () instead of a usize for the inner value | diff --git a/Cargo.toml b/Cargo.toml
index 5b75295..8be46a1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,4 +12,5 @@ Library implementation of the standard library's old `scoped_thread_local!`
macro for providing scoped access to thread local storage (TLS) so any type can
be stored into TLS.
"""
+rust-version = "1... | 2 | 10 | 9 |
8167e4a9d4bcf85f720d3414b87ae56f04f62a71 | Pen Tree | 2020-06-29T13:27:21 | update doc | diff --git a/src/lib.rs b/src/lib.rs
index 6fbcf11..2ace553 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -86,8 +86,8 @@ impl<T> ScopedKey<T> {
/// Inserts a value into this scoped thread local storage slot for a
/// duration of a closure.
///
- /// While `cb` is running, the value `t` will be returned ... | 1 | 2 | 2 |
f526d68b4f3b7cdd04a89559256eba7e47ace439 | Igor Matuszewski | 2019-02-25T23:01:32 | Bump version to 1.0.0 in Cargo.toml | diff --git a/Cargo.toml b/Cargo.toml
index e29574e..5b75295 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "scoped-tls"
-version = "0.1.2"
+version = "1.0.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
64bd7b84a1765fb72a32caed3c17c970bdc6ad57 | Igor Matuszewski | 2019-02-24T21:02:44 | Bump minimum Rust version to 1.30 to use stable macro :vis matcher | diff --git a/Cargo.toml b/Cargo.toml
index 947071d..e29574e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,5 +13,3 @@ macro for providing scoped access to thread local storage (TLS) so any type can
be stored into TLS.
"""
-[features]
-nightly = []
diff --git a/src/lib.rs b/src/lib.rs
index ca4a2ed..6fbcf11 100644
... | 2 | 0 | 24 |
477dfc12b1f36824a9d355f2684c5491ce89517d | Andy Russell | 2019-01-23T22:04:46 | allow specifying attributes | diff --git a/src/lib.rs b/src/lib.rs
index 419ab65..ca4a2ed 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -51,10 +51,12 @@ use std::cell::Cell;
use std::marker;
use std::thread::LocalKey;
+/// The macro. See the module level documentation for the description and examples.
#[macro_export]
#[cfg(not(feature = "nightl... | 1 | 22 | 2 |
0bcd065910c9f690b8ea0f46bc1560f71c4423e1 | Alex Crichton | 2018-05-03T13:52:27 | Bump to 0.1.2 | diff --git a/Cargo.toml b/Cargo.toml
index 0076fcb..947071d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "scoped-tls"
-version = "0.1.1"
+version = "0.1.2"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
3a9e2708eceb5bd91c999ff921f623ea1e80e43b | Alex Crichton | 2018-05-03T13:48:24 | Update Cargo.toml doc url | diff --git a/Cargo.toml b/Cargo.toml
index 127f87b..0076fcb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/alexcrichton/scoped-tls"
homepage = "https://github.com/alexcrichton/scoped-tls"
-documentation = "http://alexcrichton.... | 1 | 1 | 1 |
af62b56872fcd75befb17f130da86638923dcf59 | Alex Crichton | 2018-03-03T21:27:58 | Bump to 0.1.1 | diff --git a/Cargo.toml b/Cargo.toml
index c9c9b1a..127f87b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "scoped-tls"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
@@ -14,4 +14,4 @@ be stored in... | 1 | 2 | 2 |
324e723273d0304abd421032fc96044d72c4d34a | John Kåre Alsaker | 2017-11-21T10:23:30 | Support visibility specifiers on nightly | diff --git a/Cargo.toml b/Cargo.toml
index bb241ff..c9c9b1a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,3 +12,6 @@ Library implementation of the standard library's old `scoped_thread_local!`
macro for providing scoped access to thread local storage (TLS) so any type can
be stored into TLS.
"""
+
+[features]
+nig... | 2 | 23 | 0 |
eebf6e470f6c4a14295fcaf43c619ae4a0e5690a | Folkert de Vries | 2025-10-16T14:16:29 | release version 0.6.1 | diff --git a/Cargo.toml b/Cargo.toml
index da0ccc8..93bc531 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "bzip2"
-version = "0.6.0"
+version = "0.6.1"
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["bzip", "encoding"] | 1 | 1 | 1 |
1ed41c45255ac550592ed4df1c59a37f18be6089 | Jiahao XU | 2025-09-27T14:53:14 | Add `MaybeUninit<u8>` (de)compress API
Having a safe API for `MaybeUninit<u8>` would be necessary for async-compression to wrap and reduce the performance penalty of initializing the buffer for all `tokio::io::*` traits implementation | diff --git a/src/mem.rs b/src/mem.rs
index e3615c5..3de8cf7 100644
--- a/src/mem.rs
+++ b/src/mem.rs
@@ -4,7 +4,6 @@ use std::error;
use std::fmt;
use std::marker;
use std::mem;
-use std::slice;
use core::ffi::{c_int, c_uint};
@@ -133,17 +132,11 @@ impl Compress {
}
}
- /// Compress a block o... | 1 | 55 | 28 |
a1652196e8451c8e32022d5a4fa4debb51c279ee | zhoujiaweii | 2025-08-29T10:00:35 | chore: remove redundant word in comment
Signed-off-by: zhoujiaweii <zjwustc@outlook.com> | diff --git a/src/lib.rs b/src/lib.rs
index 70d44ce..c5479ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,7 +34,7 @@
//! Some tools such as pbzip2 or data from sources such as Wikipedia
//! are encoded as so called bzip2 "multistreams," meaning they
//! contain back to back chunks of bzip'd data. `BzDecoder` does ... | 1 | 1 | 1 |
422ae6da4a4a52774e8d44c918cc2140363d23ec | Snoweuph | 2025-08-21T11:21:45 | fix(bzip2-sys): license expression to be a valid spdx expression
see: https://github.com/trifectatechfoundation/bzip2-rs/issues/144 | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index 7239fb1..c967d3d 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.13+1.0.8"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
links = "bzip2"
build = "build.rs"
-license = "MIT/Apache-2.0"
+license = "MIT OR A... | 1 | 1 | 1 |
21db6979453d284196df0c6f968c56900db80f00 | adamnemecek | 2025-06-18T03:49:20 | ran `cargo clippy --fix -- -A clippy::all -W clippy::use_self` | diff --git a/src/bufread.rs b/src/bufread.rs
index 37b1b44..65ef511 100644
--- a/src/bufread.rs
+++ b/src/bufread.rs
@@ -29,8 +29,8 @@ pub struct BzDecoder<R> {
impl<R: BufRead> BzEncoder<R> {
/// Creates a new encoder which will read uncompressed data from the given
/// stream and emit the compressed stream... | 5 | 40 | 40 |
f5f9d090d8a43b789ab9484ec1f78a46be076e62 | Folkert de Vries | 2025-02-28T13:52:40 | Release 0.5.2 | diff --git a/Cargo.toml b/Cargo.toml
index cdf817f..3990207 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "bzip2"
-version = "0.5.1"
+version = "0.5.2"
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["bzip", "encoding"]
@@ -19,7 +19,7 @@ publish = true
... | 2 | 3 | 3 |
6a5073aa61c285aa53e3860c9f75a4c6dbb35d0f | Folkert de Vries | 2025-02-28T11:27:52 | make `bz_internal_error` an `extern fn`
We're treating this as a soundness fix.
Technically this is breaking MSRV, but we believe this will not be observed by any of our users. | diff --git a/bzip2-sys/lib.rs b/bzip2-sys/lib.rs
index 4a73a8b..339cae8 100644
--- a/bzip2-sys/lib.rs
+++ b/bzip2-sys/lib.rs
@@ -69,6 +69,6 @@ abi_compat! {
}
#[no_mangle]
-pub fn bz_internal_error(errcode: c_int) {
+pub extern "C" fn bz_internal_error(errcode: c_int) {
panic!("bz internal error: {}", errcode)... | 1 | 1 | 1 |
17171c211c904afe3cea7f2842336828b0a6509e | Folkert de Vries | 2025-02-27T21:13:18 | remove libc dependency of `bzip2-sys` | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index f84eb65..f289b84 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -19,7 +19,6 @@ name = "bzip2_sys"
path = "lib.rs"
[dependencies]
-libc = "0.2"
[build-dependencies]
pkg-config = "0.3.9"
diff --git a/bzip2-sys/lib.rs b/bzip2-sys/lib.r... | 2 | 2 | 4 |
a546a0e20cc5ff1fa1957beb170e3a871e089769 | Bas Zalmstra | 2025-02-21T11:22:43 | fix: libc wasm types | diff --git a/bzip2-sys/lib.rs b/bzip2-sys/lib.rs
index 54d0805..b6f3660 100644
--- a/bzip2-sys/lib.rs
+++ b/bzip2-sys/lib.rs
@@ -2,7 +2,7 @@
extern crate libc;
-use libc::{c_char, c_int, c_uint, c_void};
+use std::ffi::{c_char, c_int, c_uint, c_void};
pub const BZ_RUN: c_int = 0;
pub const BZ_FLUSH: c_int = 1; | 1 | 1 | 1 |
181841977317cbe9ff6e1702cd0798aad9b93960 | Folkert de Vries | 2024-12-16T16:17:05 | deprecate `Compression::new` | diff --git a/src/lib.rs b/src/lib.rs
index 7ed58a5..af7d31f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -77,32 +77,50 @@ pub mod write;
/// When compressing data, the compression level can be specified by a value in
/// this enum.
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub str... | 1 | 53 | 8 |
6bd7c68763b9b847f0c879b5f5a7c15d46388219 | Jiahao XU | 2025-02-11T10:57:02 | Disable bzip2-sys build script if rust backend is enabled (#125)
* Disable bzip2-sys build script if rust backend is enabled
Currently if one is to enable rust backend without disabling
default features, the bzip2-sys build script would build the
bzip2 again, making it meaningless to enable the feature.
In man... | diff --git a/Cargo.toml b/Cargo.toml
index f09f8ab..bcf4622 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,10 +22,10 @@ publish = true
bzip2-sys = { version = "0.1.11", path = "bzip2-sys", optional = true }
[dependencies.libbz2-rs-sys]
-version = "0.1.1"
+version = "0.1.3"
# Don't enable the stdio feature for bet... | 3 | 9 | 3 |
09a87db73c0517a9715ab3fd96fbe4961d545aee | Folkert de Vries | 2024-12-18T20:17:39 | add `panicked` flag to `BzDecoder` | diff --git a/src/write.rs b/src/write.rs
index 74a5ae4..0f550b4 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -22,6 +22,7 @@ pub struct BzDecoder<W: Write> {
obj: Option<W>,
buf: Vec<u8>,
done: bool,
+ panicked: bool,
}
impl<W: Write> BzEncoder<W> {
@@ -167,6 +168,7 @@ impl<W: Write> BzDecoder<W... | 1 | 8 | 3 |
b4a143bce16bd74f5b1bf550c552107eaeac0be1 | Folkert de Vries | 2024-12-18T20:15:33 | add `panicked` flag to `BzEncoder` | diff --git a/src/write.rs b/src/write.rs
index f258fe1..74a5ae4 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -12,6 +12,7 @@ pub struct BzEncoder<W: Write> {
obj: Option<W>,
buf: Vec<u8>,
done: bool,
+ panicked: bool,
}
/// A compression stream which will have compressed data written to it and
@... | 1 | 9 | 4 |
81e2bb5935905a46ae2d2a19d47a642658e44680 | Folkert de Vries | 2024-12-18T20:09:24 | link PR in the test
als use a bit less memory; it's not really needed to prove the point | diff --git a/src/write.rs b/src/write.rs
index c0fcc3d..f258fe1 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -394,8 +394,11 @@ mod tests {
#[test]
fn terminate_on_drop() {
- // Test that dropping the BzEncoder will result in a valid, decompressable datastream
- let s = "12345".repeat(100000... | 1 | 6 | 3 |
c4952044c8cb3afa4e67c652bd6642611023eeb2 | Jonas Bushart | 2024-12-17T21:56:20 | Add test that ensures the Drop implementation for BzEncoder will not regress
Without the `impl<W: Write> Drop for BzEncoder<W>` the test fails with
the error message:
called `Result::unwrap()` on an `Err` value: Custom { kind: UnexpectedEof, error: "Input EOF reached before logical stream end" } | diff --git a/src/write.rs b/src/write.rs
index 83fc598..c0fcc3d 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -391,4 +391,29 @@ mod tests {
.into_inner()
}
}
+
+ #[test]
+ fn terminate_on_drop() {
+ // Test that dropping the BzEncoder will result in a valid, decompressable ... | 1 | 25 | 0 |
3f3bb54746ff1afee6a6039018dc9c6c2d832b7b | Jonas Bushart | 2024-12-15T00:38:03 | Add finisher drop implementation to BzEncoder
This ensures that finish will always be attempted to be called, for
example when operating as a `Box<dyn Writer>`. | diff --git a/src/write.rs b/src/write.rs
index 168d6fc..83fc598 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -287,6 +287,14 @@ impl<W: Write> Drop for BzDecoder<W> {
}
}
+impl<W: Write> Drop for BzEncoder<W> {
+ fn drop(&mut self) {
+ if self.obj.is_some() {
+ let _ = self.try_finish();
... | 1 | 8 | 0 |
3f84eafd4f1d9d60f1a2f94f623a96a02eac5f43 | Folkert de Vries | 2024-12-27T17:41:34 | use `core::ffi::{c_int, c_uint}` in favor of `libc`
libc does not expose those types for some targets (notable wasm32-unknown-unknown) | diff --git a/Cargo.toml b/Cargo.toml
index cf64b96..6c2d34d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,6 @@ publish = true
[workspace]
[dependencies]
-libc = "0.2"
bzip2-sys = { version = "0.1.11", path = "bzip2-sys", optional = true }
[dependencies.libbz2-rs-sys]
diff --git a/src/lib.rs b/src/lib.rs... | 3 | 1 | 3 |
15258feb0cdc1114d6fc6b936254c4f4e1d5730c | Folkert de Vries | 2024-12-16T13:35:43 | update libbz2-rs-sys version that we use | diff --git a/Cargo.toml b/Cargo.toml
index 76f7575..cf64b96 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,7 @@ libc = "0.2"
bzip2-sys = { version = "0.1.11", path = "bzip2-sys", optional = true }
[dependencies.libbz2-rs-sys]
-version = "0.1.0"
+version = "0.1.1"
# Don't enable the stdio feature for better ... | 1 | 1 | 1 |
427c7094b48e3939efcc697f997f33370e0e84c1 | Folkert de Vries | 2024-12-16T11:25:01 | fix typo
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> | diff --git a/src/write.rs b/src/write.rs
index 4bb7167..168d6fc 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -310,7 +310,7 @@ mod tests {
#[test]
fn roundtrip_empty() {
- // this encoded and then decodes an empty input file
+ // this encodes and then decodes an empty input file
let... | 1 | 1 | 1 |
fa38606968c7f6ba87a6ef5981b9e81c05166428 | Folkert de Vries | 2024-12-16T10:34:46 | integrate the information from PR #97 | diff --git a/src/write.rs b/src/write.rs
index ba60367..4bb7167 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -309,7 +309,8 @@ mod tests {
}
#[test]
- fn write_empty() {
+ fn roundtrip_empty() {
+ // this encoded and then decodes an empty input file
let d = BzDecoder::new(Vec::new())... | 1 | 19 | 2 |
66b6f7e8eb76ffcd19e75d6c4deee66b4fd56de4 | Folkert de Vries | 2024-12-16T10:11:46 | `BZDecoder::try_finish`: `total_in` will not change when given no additional input | diff --git a/src/write.rs b/src/write.rs
index 28cec96..ba60367 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -204,11 +204,11 @@ impl<W: Write> BzDecoder<W> {
/// [`write`]: Self::write
pub fn try_finish(&mut self) -> io::Result<()> {
while !self.done {
- let read_before = self.total_in(... | 1 | 5 | 5 |
130c5898692643f8c82e3c60159e661823208fc7 | Folkert de Vries | 2024-12-16T09:38:20 | `BZDecoder::drop`: add test for it not causing an infinite loop | diff --git a/src/write.rs b/src/write.rs
index c3a1e20..28cec96 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -204,14 +204,12 @@ impl<W: Write> BzDecoder<W> {
/// [`write`]: Self::write
pub fn try_finish(&mut self) -> io::Result<()> {
while !self.done {
- let before = self.total_in();
- ... | 1 | 13 | 7 |
0523b929a81ea092981f602af9c3d40d0e307a0c | Andrew Gunnerson | 2024-05-18T20:28:16 | write::BzDecoder: Fix infinite loop on drop when no data is read or written
If writes to the BzDecoder end before it has been fed the entire stream
and the output buffer has already been flushed to the wrapped writer,
then the Drop implementation will loop forever. On drop, try_finish() is
called, which repeatedly tri... | diff --git a/src/write.rs b/src/write.rs
index 24d5e24..c3a1e20 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -204,7 +204,15 @@ impl<W: Write> BzDecoder<W> {
/// [`write`]: Self::write
pub fn try_finish(&mut self) -> io::Result<()> {
while !self.done {
- let _ = self.write(&[])?;
+ ... | 1 | 9 | 1 |
5a425ed7f1e37df4bb69688acc7c98d8f50c76c3 | Folkert de Vries | 2024-12-11T15:19:15 | `struct BzDecoder`: document exit on error logic | diff --git a/src/write.rs b/src/write.rs
index 5151957..24d5e24 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -254,15 +254,11 @@ impl<W: Write> Write for BzDecoder<W> {
let res = self.data.decompress_vec(data, &mut self.buf);
let written = (self.total_in() - before) as usize;
- ... | 1 | 6 | 10 |
dece0383469198e71a4a610baf71b9db2db05d1f | Jonathan Giddy | 2023-06-10T06:23:03 | Fix infinite loop after invalid data
Closes #98 | diff --git a/src/write.rs b/src/write.rs
index 5d80000..5151957 100644
--- a/src/write.rs
+++ b/src/write.rs
@@ -254,11 +254,17 @@ impl<W: Write> Write for BzDecoder<W> {
let res = self.data.decompress_vec(data, &mut self.buf);
let written = (self.total_in() - before) as usize;
- ... | 1 | 18 | 4 |
c83aef6b508031e748d861bd07fb9399a83deb43 | bjorn3 | 2024-12-11T12:13:51 | Don't enable the stdio feature for the rust implementation of bzip2
This improves portability and for the C version we are already using
BZ_NO_STDIO anyway. | diff --git a/Cargo.toml b/Cargo.toml
index a4c7523..0ae4af7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,13 @@ rust-version = "1.65.0" # MSRV
[dependencies]
libc = "0.2"
bzip2-sys = { version = "0.1.11", path = "bzip2-sys", optional = true }
-libbz2-rs-sys = { version = "0.1.0", optional = true }
+
+[depend... | 1 | 7 | 1 |
28aadcc66ec8e3bc015111001df155c6c4df39b8 | Folkert de Vries | 2024-12-09T13:09:36 | add links in the documentation comments
fixes some typos too | diff --git a/src/bufread.rs b/src/bufread.rs
index 04be4a4..37b1b44 100644
--- a/src/bufread.rs
+++ b/src/bufread.rs
@@ -7,7 +7,7 @@ use crate::{Action, Compress, Compression, Decompress, Status};
/// A bz2 encoder, or compressor.
///
-/// This structure implements a `BufRead` interface and will read uncompressed
+... | 4 | 44 | 25 |
f7fe17c5bc9328f3dcb0647a7faf0cbe546c10e3 | Folkert de Vries | 2024-12-09T09:59:19 | set the edition to 2021
and some import changes that are required for that edition | diff --git a/Cargo.toml b/Cargo.toml
index fe99239..e9a318d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,4 +1,5 @@
[package]
+edition = "2021"
name = "bzip2"
version = "0.4.4"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
diff --git a/src/bufread.rs b/src/bufread.rs
index 14d8a4e..d5635e9 100644
--- a/src/b... | 5 | 14 | 12 |
b397f2a6e29a35cdfe98965ff4e372dcc732fdb7 | Folkert de Vries | 2024-12-05T16:05:59 | support `libbz2-rs-sys` (#110) | diff --git a/Cargo.toml b/Cargo.toml
index 328c4fa..fe99239 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,8 @@ categories = ["compression", "api-bindings"]
[dependencies]
libc = "0.2"
-bzip2-sys = { version = "0.1.11", path = "bzip2-sys" }
+bzip2-sys = { version = "0.1.11", path = "bzip2-sys", optional = tr... | 2 | 10 | 2 |
9d4ad6802420ea129e7574edadd01e4d31ee5175 | Folkert de Vries | 2024-12-03T17:18:12 | bump `partial-io` to a recent version (#108) | diff --git a/Cargo.toml b/Cargo.toml
index 9ed446c..cece8c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,9 +24,8 @@ futures = { version = "0.1", optional = true }
[dev-dependencies]
rand = "0.8"
-partial-io = { version = "0.3", features = ["quickcheck"] }
+partial-io = { version = "0.5.4", features = ["quickchec... | 3 | 7 | 6 |
3032f3790742bffda521e54d14429f459e078eba | Alex Crichton | 2023-01-05T17:16:03 | Bump to 0.4.4 | diff --git a/Cargo.toml b/Cargo.toml
index 546cb05..9ed446c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2"
-version = "0.4.3"
+version = "0.4.4"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
90c9c182cd5a5ebc75810aebd89b347a7bdf590b | Jack Ren | 2023-01-05T17:14:56 | Patched an infinite loop bug in src/mem.rs, impl Decompress::decompress() (#86)
* Solved infinite loop problem when output.length() is 0x1_0000_0000 exactly
* Fixed incomplete and too complicated patch | diff --git a/src/mem.rs b/src/mem.rs
index ec5b9b9..ff7d9a5 100644
--- a/src/mem.rs
+++ b/src/mem.rs
@@ -150,9 +150,9 @@ impl Compress {
return Ok(Status::RunOk);
}
self.inner.raw.next_in = input.as_ptr() as *mut _;
- self.inner.raw.avail_in = input.len() as c_uint;
+ self.i... | 1 | 4 | 4 |
016e18155ef7c05983ea244cae1344c5b68defd8 | Alex Crichton | 2021-06-09T20:34:18 | Bump versions | diff --git a/Cargo.toml b/Cargo.toml
index 38f81bf..546cb05 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2"
-version = "0.4.2"
+version = "0.4.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
@@ -18,7 +18,7 @@ categories = ["co... | 2 | 3 | 3 |
2158f5aadde3b0f961f001a71815243c5df2c534 | Jay | 2021-06-07T21:41:27 | *: introduce static features (#78)
static features will require building static library from source.
Signed-off-by: Jay Lee <BusyJayLee@gmail.com> | diff --git a/Cargo.toml b/Cargo.toml
index 21f0c3f..38f81bf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,3 +31,5 @@ tokio-core = "0.1"
[features]
tokio = ["tokio-io", "futures"]
+# Enable this feature if you want to have a statically linked bzip2
+static = ["bzip2-sys/static"]
diff --git a/bzip2-sys/Cargo.toml b... | 3 | 8 | 1 |
3ddead1584c9e9055b0f04850bf93cff4d7a60f2 | Alex Crichton | 2021-02-19T20:06:14 | Bump to 0.4.2 | diff --git a/Cargo.toml b/Cargo.toml
index f713c81..21f0c3f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2"
-version = "0.4.1"
+version = "0.4.2"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
0574528101096d9b9be0c83d2f86e686316205b3 | Alex Crichton | 2021-02-01T19:07:29 | Bump bzip2-sys to 0.1.10 | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index d7f7a50..f82edc0 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2-sys"
-version = "0.1.9+1.0.8"
+version = "0.1.10+1.0.8"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
links = "bzip2"
build = "b... | 1 | 1 | 1 |
707f85c9f197bb8129bf235d480c06eebaa194d1 | Ingvar Stepanyan | 2021-02-01T15:03:13 | Fix compilation on Wasm (#73)
* Fix compilation on Wasm
Fix compilation on WebAssembly, as well as any other non-Windows/Unix/Redox targets.
Previously, the functions would be undefined on those targets and the crate would fail to compile with errors like:
```
error[E0425]: cannot find function, tuple struct o... | diff --git a/bzip2-sys/lib.rs b/bzip2-sys/lib.rs
index 68493ef..54d0805 100644
--- a/bzip2-sys/lib.rs
+++ b/bzip2-sys/lib.rs
@@ -48,7 +48,7 @@ macro_rules! abi_compat {
extern "system" {
$(pub fn $name($($arg: $t),*) -> $ret;)*
}
- #[cfg(any(unix, target_os = "redox"))]
+ #[... | 1 | 1 | 1 |
239944b23f73be8d0f17989204ee78cee63e6cb7 | Andrew Lamb | 2020-07-15T14:07:35 | Add more documentation about multistreams (#62) | diff --git a/src/bufread.rs b/src/bufread.rs
index cee22d5..874c9bd 100644
--- a/src/bufread.rs
+++ b/src/bufread.rs
@@ -245,9 +245,10 @@ impl<R: AsyncWrite> AsyncWrite for BzDecoder<R> {
}
}
-/// A bzip2 streaming decoder that decodes all members of a multistream
+/// A bzip2 streaming decoder that decodes all... | 2 | 16 | 2 |
973a793661d7f9c22832ff50c6c7a95438fc657e | Andrew Lamb | 2020-07-15T14:06:57 | Fix warnings related to implementation Error::description (#65) | diff --git a/src/mem.rs b/src/mem.rs
index 8b2fc31..ec5b9b9 100644
--- a/src/mem.rs
+++ b/src/mem.rs
@@ -284,20 +284,17 @@ impl<D: Direction> Stream<D> {
}
}
-impl error::Error for Error {
- fn description(&self) -> &str {
- match self {
+impl error::Error for Error {}
+
+impl fmt::Display for Error {... | 1 | 7 | 10 |
f4cc8c584fbb33e7d4b7f6a4cf093c76adec4c39 | Andrew Lamb | 2020-07-15T14:06:30 | Remove use of try! macro (#64) | diff --git a/src/bufread.rs b/src/bufread.rs
index e6aa4b0..cee22d5 100644
--- a/src/bufread.rs
+++ b/src/bufread.rs
@@ -90,7 +90,7 @@ impl<R: BufRead> Read for BzEncoder<R> {
loop {
let (read, consumed, eof, ret);
{
- let input = try!(self.obj.fill_buf());
+ ... | 2 | 12 | 12 |
e7d8576dd7e1a9957f03c2c77912070b32433bef | Alex Crichton | 2020-07-06T14:01:18 | Bump to 0.4.1 | diff --git a/Cargo.toml b/Cargo.toml
index 5c6889e..d14d6b2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2"
-version = "0.4.0"
+version = "0.4.1"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
ea8fc591ff34ef9398731aa05e1201975b35fa54 | Alex Crichton | 2020-05-27T14:05:24 | Bump bzip2-sys to 0.1.9 | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index f7f2a5d..d7f7a50 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2-sys"
-version = "0.1.8+1.0.8"
+version = "0.1.9+1.0.8"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
links = "bzip2"
build = "bu... | 1 | 1 | 1 |
2fb501e48279a8eaff09c9ccb99ce428300597ca | Michel Alexandre Salim | 2020-05-27T14:05:07 | [bzip2-sys] use the system bzip2 if found via pkg-config (#58)
* [bzip2-sys] use the system bzip2 if found via pkg-config
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
* Run `rustfmt` on the modified file
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name> | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index 544126c..f7f2a5d 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -22,4 +22,5 @@ path = "lib.rs"
libc = "0.2"
[build-dependencies]
+pkg-config = "0.3.9"
cc = "1.0"
diff --git a/bzip2-sys/build.rs b/bzip2-sys/build.rs
index 0968574..adea7... | 2 | 12 | 1 |
461d66916a5e6848e455c6d4fb9a5f70f4617efd | Alex Crichton | 2020-02-24T16:04:04 | Bump bzip2-sys to 1.0.8 | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index 0a909f7..544126c 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2-sys"
-version = "0.1.7"
+version = "0.1.8+1.0.8"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
links = "bzip2"
build = "build.rs... | 1 | 1 | 1 |
93c465c7a6991668ca8062f454431f65545f4d96 | Nemo157 | 2019-10-16T14:10:15 | Update minimum version of bzip2-sys to 0.1.4 (#50)
This is the first version of bzip2-sys that successfully compiles with `minimal-versions` | diff --git a/Cargo.toml b/Cargo.toml
index 871d98e..5c6889e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ categories = ["compression", "api-bindings"]
[dependencies]
libc = "0.2"
-bzip2-sys = { version = "0.1", path = "bzip2-sys" }
+bzip2-sys = { version = "0.1.4", path = "bzip2-sys" }
tokio-io = { ve... | 1 | 1 | 1 |
91d576f75a3cb8acd8b741312c97c9fbd7c3df6a | oleid | 2019-10-07T22:47:44 | Add conversion to std io error and better description (#49)
* Add better error description
* Add conversion to std::io::Error | diff --git a/src/mem.rs b/src/mem.rs
index 547762e..8b2fc31 100644
--- a/src/mem.rs
+++ b/src/mem.rs
@@ -286,7 +286,12 @@ impl<D: Direction> Stream<D> {
impl error::Error for Error {
fn description(&self) -> &str {
- "bz2 data error"
+ match self {
+ Error::Sequence => "bzip2: sequence ... | 1 | 12 | 1 |
02096d6f16e6b78cde379ce2305e08d2933e23b7 | Alex Crichton | 2019-08-26T13:54:59 | Update main quickcheck to 0.9 | diff --git a/Cargo.toml b/Cargo.toml
index 2dff214..871d98e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,8 @@ futures = { version = "0.1", optional = true }
[dev-dependencies]
rand = "0.7"
partial-io = { version = "0.3", features = ["quickcheck"] }
-quickcheck = "0.6"
+quickcheck = "0.9"
+quickcheck6 = { ve... | 3 | 4 | 3 |
aa113a461136a3fb8d6e653e75cb75b86a3b3299 | Andrey Cizov | 2019-07-15T15:59:25 | rustfmt not passing | diff --git a/src/bufread.rs b/src/bufread.rs
index a163d5a..e6aa4b0 100644
--- a/src/bufread.rs
+++ b/src/bufread.rs
@@ -216,7 +216,7 @@ impl<R: BufRead> Read for BzDecoder<R> {
self.done = true;
}
- return Ok(read)
+ return Ok(read);
}
... | 1 | 1 | 1 |
8bb99f1ad6a3922564973ecd456614fa65860373 | Andrey Cizov | 2019-07-11T18:56:06 | added multistream support | diff --git a/src/bufread.rs b/src/bufread.rs
index 770cd6b..edfd477 100644
--- a/src/bufread.rs
+++ b/src/bufread.rs
@@ -28,6 +28,7 @@ pub struct BzDecoder<R> {
obj: R,
data: Decompress,
done: bool,
+ multi: bool,
}
impl<R: BufRead> BzEncoder<R> {
@@ -147,8 +148,14 @@ impl<R: BufRead> BzDecoder<R>... | 2 | 158 | 6 |
7743c8402fcf05b02ead51045ec80a00a9bec8df | Alex Crichton | 2019-07-02T15:27:00 | Update rand 0.7 usage | diff --git a/tests/tokio.rs b/tests/tokio.rs
index d9807eb..e398349 100644
--- a/tests/tokio.rs
+++ b/tests/tokio.rs
@@ -75,7 +75,8 @@ fn tcp_stream_echo_pattern() {
#[test]
fn echo_random() {
- let v = thread_rng().gen_iter::<u8>().take(1024 * 1024).collect::<Vec<_>>();
+ let mut v = vec![0; 1024 * 1024];
+ ... | 1 | 2 | 1 |
f7213a16128c1be95e04209237a5ed79a4e72dff | David Wildasin | 2018-12-08T01:01:07 | Fix tokio tests | diff --git a/tests/tokio.rs b/tests/tokio.rs
index 41c3442..d9807eb 100644
--- a/tests/tokio.rs
+++ b/tests/tokio.rs
@@ -45,7 +45,7 @@ fn tcp_stream_echo_pattern() {
assert_eq!(b.read(&mut buf).unwrap(), 0);
});
- let mut a = write::BzEncoder::new(a, Compression::Default);
+ let mu... | 1 | 4 | 4 |
34265a5534d973ad3b35b973b444585e9c61ef5b | Alex Crichton | 2018-11-27T18:16:18 | Bump bzip2-sys to 0.1.7 | diff --git a/bzip2-sys/Cargo.toml b/bzip2-sys/Cargo.toml
index fe06e36..0a909f7 100644
--- a/bzip2-sys/Cargo.toml
+++ b/bzip2-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bzip2-sys"
-version = "0.1.6"
+version = "0.1.7"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
links = "bzip2"
build = "build.rs" | 1 | 1 | 1 |
c76698ea88f0044892042105c9e7389509b43977 | Alex Crichton | 2018-11-27T18:15:00 | Install `libbz2.a` in `lib` folders
Closes #36 | diff --git a/bzip2-sys/build.rs b/bzip2-sys/build.rs
index b7e68fc..5f7255d 100644
--- a/bzip2-sys/build.rs
+++ b/bzip2-sys/build.rs
@@ -12,6 +12,8 @@ fn main() {
cfg.define("BZ_EXPORT", None);
}
+ let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+
cfg.include("bzip2-1.0.6")
.de... | 1 | 4 | 1 |
0ae38c2ccfea01625ae256e4fd483a15eb7ad62c | Alex Crichton | 2018-07-05T21:04:31 | Update some dev-deps | diff --git a/Cargo.toml b/Cargo.toml
index f5fd1f3..ce0c478 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,4 @@
[package]
-
name = "bzip2"
version = "0.3.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
@@ -24,9 +23,9 @@ tokio-io = { version = "0.1", optional = true }
futures = { version = "0.1", option... | 2 | 6 | 6 |
f1c8ec1e4f4c7197e7f89d55e4ba036abb4bfa65 | Alex Crichton | 2018-06-29T20:19:07 | Remove deny(warnings) | diff --git a/src/lib.rs b/src/lib.rs
index 590d467..107615c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -47,7 +47,7 @@
//! time to perform I/O. If I/O streams are flushed before drop, however, then
//! these operations will be a noop.
-#![deny(missing_docs, warnings)]
+#![deny(missing_docs)]
#![doc(html_root_url =... | 1 | 1 | 1 |
3dfb105254fe87f0e6baa5d3535a6dd86c63bc2b | Alex Crichton | 2018-05-03T13:50:22 | Bump to 0.3.3 | diff --git a/Cargo.toml b/Cargo.toml
index 0c6e099..f5fd1f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "bzip2"
-version = "0.3.2"
+version = "0.3.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md" | 1 | 1 | 1 |
59df6f11189674c3afd79448fb17faa3047fffe7 | Alex Crichton | 2018-05-03T13:46:44 | Update Cargo.toml doc url | diff --git a/Cargo.toml b/Cargo.toml
index 82e59e8..0c6e099 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,7 @@ readme = "README.md"
keywords = ["bzip", "encoding"]
repository = "https://github.com/alexcrichton/bzip2-rs"
homepage = "https://github.com/alexcrichton/bzip2-rs"
-documentation = "http://alexcrichton... | 1 | 1 | 1 |
9a23033746013f1391670cafc4de7dabdb4b490e | Daniel Hodges | 2018-04-11T03:14:30 | Update docblock in Decompress struct | diff --git a/src/mem.rs b/src/mem.rs
index 9a27c8c..22d2595 100644
--- a/src/mem.rs
+++ b/src/mem.rs
@@ -19,7 +19,7 @@ pub struct Compress {
/// Representation of an in-memory decompression stream.
///
-/// An instance of `Decompress` can be used to inflate a straem of bz2-encoded
+/// An instance of `Decompress` c... | 1 | 1 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.