Skip to content

Commit f35c3e8

Browse files
committed
Don't default to a crypto backend
In most situations AWS-LC is the better backend, but it's not available on all platforms, for example WASM. Explicitly asking the user to pick a backend is also more future-proof.
1 parent 09e8d42 commit f35c3e8

File tree

2 files changed

+73
-70
lines changed

2 files changed

+73
-70
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,86 @@
11
name: ci
22
on:
3-
push:
4-
branches:
5-
- master
6-
pull_request:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
77

88
jobs:
9-
style:
10-
name: Format
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v3
14-
- name: Install Rust
15-
uses: dtolnay/rust-toolchain@stable
16-
with:
17-
components: rustfmt
18-
- name: Check format
19-
run: cargo fmt --check
9+
style:
10+
name: Format
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Install Rust
15+
uses: dtolnay/rust-toolchain@stable
16+
with:
17+
components: rustfmt
18+
- name: Check format
19+
run: cargo fmt --check
2020

21-
clippy:
22-
name: Clippy
23-
runs-on: ubuntu-latest
24-
steps:
25-
- uses: actions/checkout@v3
26-
- uses: dtolnay/rust-toolchain@stable
27-
with:
28-
components: clippy
29-
- run: cargo clippy --all-targets --all-features -- -D warnings
21+
clippy:
22+
name: Clippy
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
backend: [ aws_lc_rs, rust_crypto ]
27+
steps:
28+
- uses: actions/checkout@v3
29+
- uses: dtolnay/rust-toolchain@stable
30+
with:
31+
components: clippy
32+
- run: cargo clippy --all-targets --features ${{ matrix.backend }} -- -D warnings
3033

31-
tests:
32-
name: Tests
33-
runs-on: ${{ matrix.os }}
34-
strategy:
35-
matrix:
36-
build: [pinned, stable, nightly]
37-
include:
38-
- build: pinned
39-
os: ubuntu-20.04
40-
rust: 1.73.0
41-
- build: stable
42-
os: ubuntu-20.04
43-
rust: stable
44-
- build: nightly
45-
os: ubuntu-20.04
46-
rust: nightly
47-
steps:
48-
- uses: actions/checkout@v3
49-
- name: Install Rust
50-
uses: dtolnay/rust-toolchain@master
51-
with:
52-
toolchain: ${{ matrix.rust }}
34+
tests:
35+
name: Tests
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
matrix:
39+
build: [ pinned, stable, nightly ]
40+
backend: [ aws_lc_rs, rust_crypto ]
41+
include:
42+
- build: pinned
43+
os: ubuntu-20.04
44+
rust: 1.73.0
45+
- build: stable
46+
os: ubuntu-20.04
47+
rust: stable
48+
- build: nightly
49+
os: ubuntu-20.04
50+
rust: nightly
51+
steps:
52+
- uses: actions/checkout@v3
53+
- name: Install Rust
54+
uses: dtolnay/rust-toolchain@master
55+
with:
56+
toolchain: ${{ matrix.rust }}
5357

54-
- name: Build System Info
55-
run: rustc --version
58+
- name: Build System Info
59+
run: rustc --version
5660

57-
- name: Run tests default features
58-
run: cargo test
61+
- name: Run tests default features
62+
run: cargo test --features ${{ matrix.backend }}
5963

60-
- name: Run tests no features
61-
run: cargo test --no-default-features
64+
- name: Run tests no features
65+
run: cargo test --no-default-features --features ${{ matrix.backend }}
6266

63-
wasm:
64-
name: Run tests in wasm
65-
runs-on: ubuntu-latest
66-
steps:
67-
- uses: actions/checkout@v3
68-
- name: Install Rust
69-
uses: dtolnay/rust-toolchain@stable
70-
with:
71-
targets: wasm32-unknown-unknown
67+
wasm:
68+
name: Run tests in wasm
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v3
72+
- name: Install Rust
73+
uses: dtolnay/rust-toolchain@stable
74+
with:
75+
targets: wasm32-unknown-unknown
7276

73-
- uses: actions/setup-node@v4
77+
- uses: actions/setup-node@v4
7478

75-
- name: Install wasm-pack
76-
run: cargo install wasm-pack
79+
- name: Install wasm-pack
80+
run: cargo install wasm-pack
7781

78-
- name: Run tests default features
79-
run: wasm-pack test --node
80-
81-
- name: Run tests no features
82-
run: wasm-pack test --node --no-default-features
82+
- name: Run tests default features
83+
run: wasm-pack test --node --features rust_crypto
8384

85+
- name: Run tests no features
86+
run: wasm-pack test --node --no-default-features --features rust_crypto

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ time = { version = "0.3", features = ["wasm-bindgen"] }
6060
criterion = { version = "0.4", default-features = false }
6161

6262
[features]
63-
default = ["use_pem", "aws_lc_rs"]
63+
default = ["use_pem"]
6464
use_pem = ["pem", "simple_asn1"]
6565
rust_crypto = ["ed25519-dalek", "hmac", "p256", "p384", "rand", "rsa", "sha2"]
6666
aws_lc_rs = ["aws-lc-rs"]

0 commit comments

Comments
 (0)