Skip to content

Commit 2811254

Browse files
authored
x509-tsp: enable CI (#1177)
This enables CI on x509-tsp. It also fixes tests that broke with #1130 Fixes #1176 Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
1 parent 0345720 commit 2811254

4 files changed

Lines changed: 54 additions & 11 deletions

File tree

.github/workflows/x509-tsp.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: x509-tsp
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/x509-tsp.yml"
7+
- "const-oid/**"
8+
- "cmpv2/**"
9+
- "cms/**"
10+
- "der/**"
11+
- "spki/**"
12+
- "x509-cert/**"
13+
- "x509-tsp/**"
14+
- "Cargo.*"
15+
push:
16+
branches: master
17+
18+
defaults:
19+
run:
20+
working-directory: x509-tsp
21+
22+
env:
23+
CARGO_INCREMENTAL: 0
24+
RUSTFLAGS: "-Dwarnings"
25+
26+
jobs:
27+
minimal-versions:
28+
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
29+
with:
30+
working-directory: ${{ github.workflow }}
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
rust:
37+
- 1.65.0 # MSRV
38+
- stable
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- uses: dtolnay/rust-toolchain@master
43+
with:
44+
toolchain: ${{ matrix.rust }}
45+
- uses: RustCrypto/actions/cargo-hack-install@master
46+
- run: cargo hack test --feature-powerset

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x509-tsp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ rust-version = "1.65"
1717
der = { version = "0.7.6", features = ["alloc", "derive", "oid", "pem"] }
1818
cms = { version = "0.2.1", features = ["alloc", "std"] }
1919
cmpv2 = { version = "0.2", features = ["alloc", "std"] }
20+
x509-cert = { version = "0.2.4", default-features = false }
2021

2122
[dev-dependencies]
2223
hex-literal = "0.4.1"

x509-tsp/src/lib.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
use cmpv2::status::PkiStatusInfo;
2-
use cms::{
3-
cert::x509::{
4-
ext::{pkix::name::GeneralName, Extensions},
5-
spki::AlgorithmIdentifier,
6-
},
7-
content_info::ContentInfo,
8-
};
2+
use cms::content_info::ContentInfo;
93
use der::{
104
asn1::{GeneralizedTime, Int, OctetString},
115
oid::ObjectIdentifier,
126
Any, Enumerated, Sequence,
137
};
8+
use x509_cert::{
9+
ext::{pkix::name::GeneralName, Extensions},
10+
spki::AlgorithmIdentifier,
11+
};
1412

1513
#[derive(Clone, Copy, Debug, Enumerated, Eq, PartialEq, PartialOrd, Ord)]
1614
#[asn1(type = "INTEGER")]
@@ -214,10 +212,7 @@ mod tests {
214212
GeneralName::DirectoryName(n) => n,
215213
_ => panic!(),
216214
};
217-
assert_eq!(
218-
dn.to_string(),
219-
"C=US,STATEORPROVINCENAME=Some-State,O=Test,CN=Test TSA"
220-
);
215+
assert_eq!(dn.to_string(), "CN=Test TSA,O=Test,ST=Some-State,C=US");
221216
assert_eq!(
222217
tst.message_imprint.hashed_message.as_bytes(),
223218
hex!("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad")

0 commit comments

Comments
 (0)