Skip to content

Commit 3b9556f

Browse files
committed
x509-tsp: reunite with the workspace
1 parent 436ee80 commit 3b9556f

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

.github/workflows/x509-tsp.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
rust:
32-
- 1.81.0 # MSRV
32+
- 1.85.0 # MSRV
3333
- stable
3434
target:
3535
- thumbv7em-none-eabi
@@ -54,7 +54,7 @@ jobs:
5454
strategy:
5555
matrix:
5656
rust:
57-
- 1.81.0 # MSRV
57+
- 1.85.0 # MSRV
5858
- stable
5959
steps:
6060
- uses: actions/checkout@v4

Cargo.lock

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ members = [
2222
"tai64",
2323
"tls_codec",
2424
"tls_codec/derive",
25-
#"x509-tsp",
25+
"x509-tsp",
2626
"x509-cert",
2727
"x509-cert/test-support",
2828
#"x509-ocsp"
2929
]
3030
exclude = [
3131
"base64ct",
32-
"x509-tsp",
3332
"x509-ocsp"
3433
]
3534

@@ -60,7 +59,7 @@ spki = { path = "./spki" }
6059
tai64 = { path = "./tai64" }
6160
tls_codec = { path = "./tls_codec" }
6261
tls_codec_derive = { path = "./tls_codec/derive" }
63-
#x509-tsp = { path = "./x509-tsp" }
62+
x509-tsp = { path = "./x509-tsp" }
6463
x509-cert = { path = "./x509-cert" }
6564
#x509-ocsp = { path = "./x509-ocsp" }
6665

x509-tsp/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "x509-tsp"
33
version = "0.2.0-pre"
4-
edition = "2021"
4+
edition = "2024"
55
description = """
66
Pure Rust implementation of the Timestamping Protocol as described in RFC 3161.
77
"""
@@ -12,7 +12,7 @@ repository = "https://github.com/RustCrypto/formats"
1212
categories = ["cryptography", "encoding", "no-std", "parser-implementations"]
1313
keywords = ["crypto", "tsp", "timestamp"]
1414
readme = "README.md"
15-
rust-version = "1.81"
15+
rust-version = "1.85"
1616

1717
[dependencies]
1818
der = { version = "0.8.0-rc.0", features = ["alloc", "derive", "oid", "pem"] }

x509-tsp/src/lib.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ extern crate alloc;
1111
use cmpv2::status::PkiStatusInfo;
1212
use cms::content_info::ContentInfo;
1313
use der::{
14+
Any, Enumerated, Sequence,
1415
asn1::{GeneralizedTime, Int, OctetString},
1516
oid::ObjectIdentifier,
16-
Any, Enumerated, Sequence,
1717
};
1818
use x509_cert::{
19-
ext::{pkix::name::GeneralName, Extensions},
19+
ext::{Extensions, pkix::name::GeneralName},
2020
spki::AlgorithmIdentifier,
2121
};
2222

@@ -189,7 +189,9 @@ mod tests {
189189
#[test]
190190
fn request_test() {
191191
// openssl ts --query --data abc.txt -out query.tsq
192-
let enc_req = hex!("30400201013031300D060960864801650304020105000420BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD0208314CFCE4E0651827");
192+
let enc_req = hex!(
193+
"30400201013031300D060960864801650304020105000420BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD0208314CFCE4E0651827"
194+
);
193195
let req = TimeStampReq::from_der(&enc_req).unwrap();
194196
assert_eq!(req.version, TspVersion::V1);
195197
assert_eq!(req.message_imprint.hash_algorithm.oid, ID_SHA_256);
@@ -202,7 +204,9 @@ mod tests {
202204
#[test]
203205
fn response_test() {
204206
// openssl ts -reply -queryfile query.tsq -signer ec384-tsa-key.crt -inkey ec384-tsa-key.pem -out response.tsr -config tsa.cnf
205-
let enc_resp = hex!("3082028430030201003082027B06092A864886F70D010702A082026C30820268020103310F300D060960864801650304020105003081C9060B2A864886F70D0109100104A081B90481B63081B302010106042A0304013031300D060960864801650304020105000420BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD020104180F32303233303630373131323632365A300A020101800201F48101640101FF0208314CFCE4E0651827A048A4463044310B30090603550406130255533113301106035504080C0A536F6D652D5374617465310D300B060355040A0C04546573743111300F06035504030C0854657374205453413182018430820180020101305C3044310B30090603550406130255533113301106035504080C0A536F6D652D5374617465310D300B060355040A0C04546573743111300F06035504030C08546573742054534102146A0DCC59137C11D1C2B092042B4BC51C0D634D24300D06096086480165030402010500A08198301A06092A864886F70D010903310D060B2A864886F70D0109100104301C06092A864886F70D010905310F170D3233303630373131323632365A302B060B2A864886F70D010910020C311C301A3018301604142F36B1B52456F5AC3A1CA09794AE3D0D64AD38C2302F06092A864886F70D01090431220420BAF4CCF82E9B5B3956EADCC87346B407684F26D82B68D0E7DE0D31EA79AF648C300A06082A8648CE3D0403020467306502305A6E1C175B20A93FAB25D14CC5F5A2836D726D6D4A964B66FFBFFCE46276A96475F1408728B3385DCA37C2BA46BE17E1023100C46B7F08D03409A8ECCFD7637765412C3C5EC050E0D39CF48F0F5015950342CB18D8434FF331BA4463C086297C37D07B");
207+
let enc_resp = hex!(
208+
"3082028430030201003082027B06092A864886F70D010702A082026C30820268020103310F300D060960864801650304020105003081C9060B2A864886F70D0109100104A081B90481B63081B302010106042A0304013031300D060960864801650304020105000420BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD020104180F32303233303630373131323632365A300A020101800201F48101640101FF0208314CFCE4E0651827A048A4463044310B30090603550406130255533113301106035504080C0A536F6D652D5374617465310D300B060355040A0C04546573743111300F06035504030C0854657374205453413182018430820180020101305C3044310B30090603550406130255533113301106035504080C0A536F6D652D5374617465310D300B060355040A0C04546573743111300F06035504030C08546573742054534102146A0DCC59137C11D1C2B092042B4BC51C0D634D24300D06096086480165030402010500A08198301A06092A864886F70D010903310D060B2A864886F70D0109100104301C06092A864886F70D010905310F170D3233303630373131323632365A302B060B2A864886F70D010910020C311C301A3018301604142F36B1B52456F5AC3A1CA09794AE3D0D64AD38C2302F06092A864886F70D01090431220420BAF4CCF82E9B5B3956EADCC87346B407684F26D82B68D0E7DE0D31EA79AF648C300A06082A8648CE3D0403020467306502305A6E1C175B20A93FAB25D14CC5F5A2836D726D6D4A964B66FFBFFCE46276A96475F1408728B3385DCA37C2BA46BE17E1023100C46B7F08D03409A8ECCFD7637765412C3C5EC050E0D39CF48F0F5015950342CB18D8434FF331BA4463C086297C37D07B"
209+
);
206210
let resp = TimeStampResp::from_der(&enc_resp).unwrap();
207211
let content = resp.time_stamp_token.unwrap().content;
208212
let sd = SignedData::from_der(&content.to_der().unwrap()).unwrap();

0 commit comments

Comments
 (0)