Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance #90

Merged
merged 6 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions ci/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,25 @@ jobs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: picky

- job: msrv
# Minimum supported Rust version check for published crates.
# If this break, bump crate version minor number.
# See https://github.com/Devolutions/picky-rs/issues/89

pool:
vmImage: ubuntu-18.04
steps:
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain 1.43
rustup toolchain install 1.49
displayName: "Install rust 1.43 and 1.49"
- script: cargo +1.43 check -p picky-asn1
displayName: cargo check picky-asn1
- script: cargo +1.43 check -p picky-asn1-der
displayName: cargo check picky-asn1-der
- script: cargo +1.43 check -p picky-asn1-x509
displayName: cargo check picky-asn1-x509
- script: cargo +1.49 check -p picky
displayName: cargo check picky

3 changes: 3 additions & 0 deletions picky-asn1-der/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
[![docs.rs](https://docs.rs/picky-asn1-der/badge.svg)](https://docs.rs/picky-asn1-der)
![Crates.io](https://img.shields.io/crates/l/picky-asn1-der)

Compatible with rustc 1.43.
Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478).

# picky-asn1-der

Portions of project [serde_asn1_der](https://github.com/KizzyCode/serde_asn1_der) are held by
Expand Down
4 changes: 4 additions & 0 deletions picky-asn1-x509/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
[![docs.rs](https://docs.rs/picky-asn1-x509/badge.svg)](https://docs.rs/picky-asn1-x509)
![Crates.io](https://img.shields.io/crates/l/picky-asn1-x509)

Compatible with rustc 1.43.
Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478).

# picky-asn1-x509

Provide implementation for types defined in [X.509 RFC](https://tools.ietf.org/html/rfc5280) and related RFC ([PKCS#8](https://tools.ietf.org/html/rfc5208), [PKCS#10](https://tools.ietf.org/html/rfc2986)).
Expand All @@ -11,3 +14,4 @@ This is a low-level library providing only raw types for serialization and deser
These types are implementing `serde`'s `Serialize` and `Deserialize` and are to be used with [picky-asn1-der](https://crates.io/crates/picky-asn1-der).
If you're looking for a higher level API, you may be interested by the [picky crate](https://crates.io/crates/picky) which uses
this library internally and provides a nicer API.

3 changes: 1 addition & 2 deletions picky-asn1-x509/src/oids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
/// I mean, I'm literally creating infinity out of emptiness.
/// If you don't care about your mental sanity, you can read the
/// [nomicon on unchecked uninitialized memory](https://doc.rust-lang.org/nomicon/unchecked-uninit.html).
#[allow(invalid_value)]
unsafe fn unreachable() -> ! {
core::mem::MaybeUninit::uninit().assume_init()
std::hint::unreachable_unchecked()
}

macro_rules! define_oid {
Expand Down
6 changes: 6 additions & 0 deletions picky-asn1/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.3.3] 2021-07-02

### Fixed

- Support for rustc 1.43 (accidently bumped in 0.3.2). See [#89](https://github.com/Devolutions/picky-rs/issues/89).

## [0.3.2] 2021-05-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion picky-asn1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "picky-asn1"
version = "0.3.2"
version = "0.3.3"
edition = "2018"
authors = [
"Benoît CORTIER <[email protected]>",
Expand Down
3 changes: 3 additions & 0 deletions picky-asn1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
[![docs.rs](https://docs.rs/picky-asn1/badge.svg)](https://docs.rs/picky-asn1)
![Crates.io](https://img.shields.io/crates/l/picky-asn1)

Compatible with rustc 1.43.
Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478).

# picky-asn1

Defines wrappers for ASN.1 types:
Expand Down
2 changes: 1 addition & 1 deletion picky-asn1/src/restricted_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl CharSet for BMPCharSet {
.into_iter()
.map(|elem| u16::from_be_bytes([elem[1], elem[0]]));

char::decode_utf16(u16_it).all(|c| matches!(c, Ok(_)))
core::char::decode_utf16(u16_it).all(|c| matches!(c, Ok(_)))
}
}

Expand Down
3 changes: 3 additions & 0 deletions picky/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
[![docs.rs](https://docs.rs/picky/badge.svg)](https://docs.rs/picky)
![Crates.io](https://img.shields.io/crates/l/picky)

Compatible with rustc 1.49.
Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478).

# picky

Portable X.509, PKI, JOSE and HTTP signature implementation.
Expand Down
25 changes: 23 additions & 2 deletions setup-git-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,32 @@ if test -f "$PRE_COMMIT_HOOK"; then
fi

echo "#!/bin/sh
git stash -q --keep-index

ret=0

cargo +stable fmt --all -- --check 2> /dev/null

if ! [ \$? -eq 0 ] ; then
ret=1
printf \"\n\$(tput setaf 3)Bad formatting, please run 'cargo +stable fmt' and stage modifications\n\n\"
exit 1
fi" > "$PRE_COMMIT_HOOK"
fi

cargo clippy -- -D warnings

if ! [ \$? -eq 0 ] ; then
ret=1
printf \"\n\$(tput setaf 3)Fix clippy lints and stage modifications\n\n\"
fi

if ! [ \$ret -eq 0 ] ; then
printf \"\$(tput setaf 1)Git pre-commit hook failed.\$(tput sgr0)\n\"
printf \"Alternatively, \\\`--no-verify\\\` or \\\`-n\\\` option may be used to bypass the pre-commit hook.\n\"
fi

git stash pop -q

exit \$ret" > "$PRE_COMMIT_HOOK"
chmod +x "$PRE_COMMIT_HOOK"
echo "$(tput setaf 2)$PRE_COMMIT_HOOK created"