Skip to content

Commit 1409266

Browse files
stevenjsaibatizoku
andauthored
fix(general): Bump Versions (#49)
* fix(general): Bump Versions * fix(rust/hermes-ipfs): update to work with latest rust-ipfs version * fix(rust/cardano-chain-follower): bump c509-certificate version * fix(rust/cardano-chain-follower): remove unused clone * fix(rust/cardano-chain-follower): Update RBAC 509 API (#50) * fix(rust/cardano-chain-follower): make KeyLocalRef fields public * feat(rust/cardano-chain-follower): make extract_cip19_hash public * fix(rust/cardano-chain-follower): code format * fix(rust): Bump all rust crates, and fix chain-follower -> c509 usage * fix(rust): sync standard config --------- Co-authored-by: Joaquín Rosales <[email protected]>
1 parent da61ae4 commit 1409266

File tree

20 files changed

+117
-92
lines changed

20 files changed

+117
-92
lines changed

Earthfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.13 AS mdlint-ci
4-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.13 AS cspell-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.15 AS mdlint-ci
4+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.15 AS cspell-ci
55

66
FROM debian:stable-slim
77

docs/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.13 AS docs-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.15 AS docs-ci
44

55
IMPORT .. AS repo
66

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "overhead_benchmark"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition.workspace = true
55

66
[lints]
@@ -9,8 +9,8 @@ workspace = true
99
[dependencies]
1010
cardano-chain-follower = { path = "../.." }
1111

12-
anyhow = "1.0.82"
13-
clap = { version = "4.5.4", features = ["derive", "help", "usage", "std"], default-features = false }
14-
pallas-traverse = "0.30.1"
15-
pallas-hardano = "0.30.1"
16-
tokio = { version = "1.37.0", features = ["macros", "sync", "rt-multi-thread", "rt", "net"] }
12+
anyhow = "1.0.89"
13+
clap = { version = "4.5.19", features = ["derive", "help", "usage", "std"], default-features = false }
14+
pallas-traverse = "0.30.2"
15+
pallas-hardano = "0.30.2"
16+
tokio = { version = "1.40.0", features = ["macros", "sync", "rt-multi-thread", "rt", "net"] }

rust/Earthfile

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.13 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.15 AS rust-ci
44

55
COPY_SRC:
66
FUNCTION
@@ -15,15 +15,16 @@ COPY_SRC:
1515
hermes-ipfs \
1616
.
1717

18+
# builder : Set up our target toolchains, and copy our files.
19+
builder:
20+
DO rust-ci+SETUP
21+
1822
# sync-cfg: Synchronize local config with CI version.
1923
# Must be run by the developer manually.
2024
sync-cfg:
25+
FROM +builder
2126
DO rust-ci+SYNC_STD_CFG
2227

23-
# builder : Set up our target toolchains, and copy our files.
24-
builder:
25-
DO rust-ci+SETUP
26-
2728
builder-src:
2829
FROM +builder
2930

rust/c509-certificate/Cargo.toml

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ workspace = true
2121
minicbor = { version = "0.25.1", features = ["std"] }
2222
hex = "0.4.3"
2323
oid = "0.2.1"
24-
oid-registry = "0.7.0"
25-
asn1-rs = "0.6.0"
26-
anyhow = "1.0.86"
24+
oid-registry = "0.7.1"
25+
asn1-rs = "0.6.2"
26+
anyhow = "1.0.89"
2727
bimap = "0.6.3"
28-
once_cell = "1.19.0"
28+
once_cell = "1.20.2"
2929
strum = "0.26.3"
30-
strum_macros = "0.26.3"
31-
regex = "1.10.5"
30+
strum_macros = "0.26.4"
31+
regex = "1.11.0"
3232
ed25519-dalek = { version = "2.1.1", features = ["pem"] }
33-
thiserror = "1.0.56"
34-
serde = { version = "1.0.204", features = ["derive"] }
35-
wasm-bindgen = "0.2.92"
33+
thiserror = "1.0.64"
34+
serde = { version = "1.0.210", features = ["derive"] }
35+
wasm-bindgen = "0.2.93"
3636
serde-wasm-bindgen = "0.6.5"
3737

3838
[package.metadata.cargo-machete]
3939
ignored = ["strum"]
4040

4141
[dev-dependencies]
42-
clap = { version = "4.5.9", features = ["derive"] }
43-
serde_json = "1.0.120"
42+
clap = { version = "4.5.19", features = ["derive"] }
43+
serde_json = "1.0.128"
4444
rand = "0.8.5"
4545
chrono = "0.4.38"
4646

rust/c509-certificate/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.13 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.15 AS rust-ci
44

55
IMPORT .. AS rust-local
66
IMPORT ../.. AS repo

rust/c509-certificate/src/extensions/extension/data.rs

+25-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,22 @@ type ExtensionDataTuple = (i16, Oid<'static>, ExtensionValueType, &'static str);
2020
/// Create a type alias for `ExtensionValueType`
2121
type Evt = ExtensionValueType;
2222

23+
/// Enum of all C509 Extension Types
24+
pub enum C509ExtensionType {
25+
/// Subject Key Identifier
26+
SubjectKeyIdentifier = 1,
27+
/// Key Usage
28+
KeyUsage = 2,
29+
/// Subject Alternative Name
30+
SubjectAlternativeName = 3,
31+
}
32+
2333
/// `Extension` data table
34+
/// TODO, complete the ENUM above, and use it instead of raw integers here.
35+
/// Name might be able to come from the enum comments, which would reduce redundancy.
2436
#[rustfmt::skip]
2537
const EXTENSION_DATA: [ExtensionDataTuple; 25] = [
26-
// Int | OID | Type | Name
38+
// Int | OID | Type | Name
2739
( 1, oid!(2.5.29 .14), Evt::Bytes, "Subject Key Identifier"),
2840
( 2, oid!(2.5.29 .15), Evt::Int, "Key Usage"),
2941
( 3, oid!(2.5.29 .17), Evt::AlternativeName, "Subject Alternative Name"),
@@ -33,7 +45,7 @@ const EXTENSION_DATA: [ExtensionDataTuple; 25] = [
3345
( 7, oid!(2.5.29 .35), Evt::Unsupported, "Authority Key Identifier"),
3446
( 8, oid!(2.5.29 .37), Evt::Unsupported, "Extended Key Usage"),
3547
( 9, oid!(1.3.6 .1 .5 .5 .7 .1 .1), Evt::Unsupported, "Authority Information Access"),
36-
(10, oid!(1.3.6 .1 .4 .1 .11129 .2 .4 .2), Evt::Unsupported, "Signed Certificate Timestamp List"),
48+
(10, oid!(1.3.6 .1 .4 .1 .11129 .2 .4 .2), Evt::Unsupported, "Signed Certificate Timestamp List"),
3749
(24, oid!(2.5.29 .9), Evt::Unsupported, "Subject Directory Attributes"),
3850
(25, oid!(2.5.29 .18), Evt::AlternativeName, "Issuer Alternative Name"),
3951
(26, oid!(2.5.29 .30), Evt::Unsupported, "Name Constraints"),
@@ -51,6 +63,17 @@ const EXTENSION_DATA: [ExtensionDataTuple; 25] = [
5163
(38, oid!(1.3.6 .1 .5 .5 .7 .48 .1 .5), Evt::Unsupported, "OCSP No Check"),
5264
];
5365

66+
impl C509ExtensionType {
67+
/// Get the OID for an Extension Type
68+
#[must_use]
69+
#[allow(clippy::missing_panics_doc)] // Can't really panic unless there is a bug.
70+
pub fn oid(self) -> Oid<'static> {
71+
let ext: i16 = self as i16;
72+
#[allow(clippy::expect_used)] // Can't really panic.
73+
get_oid_from_int(ext).expect("Invalid Extension Type")
74+
}
75+
}
76+
5477
/// A struct of data that contains lookup tables for `Extension`.
5578
pub(crate) struct ExtensionData {
5679
/// A table of integer to OID, provide a bidirectional lookup.

rust/c509-certificate/src/extensions/extension/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! C509 Extension use to construct an Extensions message field for C509 Certificate.
22
3-
mod data;
3+
pub mod data;
44
use std::{fmt::Debug, str::FromStr};
55

66
use asn1_rs::Oid;
@@ -55,7 +55,7 @@ impl Extension {
5555

5656
/// Get the registered OID of the `Extension`.
5757
#[must_use]
58-
pub(crate) fn registered_oid(&self) -> &C509oidRegistered {
58+
pub fn registered_oid(&self) -> &C509oidRegistered {
5959
&self.registered_oid
6060
}
6161
}

rust/c509-certificate/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ use c509::C509;
4646
use cert_tbs::TbsCert;
4747
use minicbor::{Decode, Encode};
4848
use signing::{PrivateKey, PublicKey};
49+
50+
pub use crate::extensions::extension::data::C509ExtensionType;
51+
4952
pub mod algorithm_identifier;
5053
pub mod attributes;
5154
pub mod big_uint;

rust/cardano-chain-follower/Cargo.toml

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cardano-chain-follower"
3-
version = "0.0.2"
3+
version = "0.0.3"
44
edition.workspace = true
55
authors.workspace = true
66
homepage.workspace = true
@@ -16,14 +16,14 @@ pallas-hardano = { version = "0.30.1", git = "https://github.com/input-output-hk
1616
pallas-crypto = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
1717

1818
# cspell: words licence
19-
mithril-client = { version = "0.8.16", git = "https://github.com/input-output-hk/catalyst-mithril.git", branch = "fix/lgpl-licence", default-features = false, features = [
19+
mithril-client = { version = "0.8.18", default-features = false, features = [
2020
"full",
2121
"num-integer-backend",
2222
] }
2323

24-
c509-certificate = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.1" }
24+
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git" , tag = "v0.0.3" }
2525

26-
thiserror = "1.0.56"
26+
thiserror = "1.0.64"
2727
tokio = { version = "1.40.0", features = [
2828
"macros",
2929
"rt",
@@ -32,13 +32,13 @@ tokio = { version = "1.40.0", features = [
3232
] }
3333
tracing = "0.1.40"
3434
tracing-log = "0.2.0"
35-
dashmap = "6.0.1"
36-
url = "2.5.0"
37-
anyhow = "1.0.86"
35+
dashmap = "6.1.0"
36+
url = "2.5.2"
37+
anyhow = "1.0.89"
3838
chrono = "0.4.38"
39-
async-trait = "0.1.82"
39+
async-trait = "0.1.83"
4040
dirs = "5.0.1"
41-
futures = "0.3.30"
41+
futures = "0.3.31"
4242
humantime = "2.1.0"
4343
crossbeam-skiplist = "0.1.3"
4444
crossbeam-channel = "0.5.13"
@@ -47,26 +47,26 @@ strum = "0.26.3"
4747
ouroboros = "0.18.4"
4848
hex = "0.4.3"
4949
rayon = "1.10.0"
50-
serde = "1.0.209"
50+
serde = "1.0.210"
5151
serde_json = "1.0.128"
5252
mimalloc = { version = "0.1.43", optional = true }
5353
memx = "0.1.32"
5454
fmmap = { version = "0.3.3", features = ["sync", "tokio-async"] }
55-
minicbor = { version = "0.24.4", features = ["alloc", "derive", "half"] }
56-
brotli = "6.0.0"
55+
minicbor = { version = "0.25.1", features = ["alloc", "derive", "half"] }
56+
brotli = "7.0.0"
5757
zstd = "0.13.2"
5858
x509-cert = "0.2.5"
5959
ed25519-dalek = "2.1.1"
6060
blake2b_simd = "1.0.2"
6161
num-traits = "0.2.19"
6262
logcall = "0.1.9"
63-
tar = "0.4.41"
63+
tar = "0.4.42"
6464
ureq = { version = "2.10.1", features = ["native-certs"] }
6565
http = "1.1.0"
6666
hickory-resolver = { version = "0.24.1", features = ["dns-over-rustls"] }
6767
moka = { version = "0.12.8", features = ["sync"] }
6868
der-parser = "9.0.0"
69-
regex = "1.10.6"
69+
regex = "1.11.0"
7070
bech32 = "0.11.0"
7171

7272
[dev-dependencies]
@@ -75,7 +75,7 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
7575
test-log = { version = "0.2.16", default-features = false, features = [
7676
"trace",
7777
] }
78-
clap = "4.5.17"
78+
clap = "4.5.19"
7979

8080
# Note, these features are for support of features exposed by dependencies.
8181
[features]

rust/cardano-chain-follower/src/metadata/cip509/mod.rs

+11-14
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
// cspell: words pkix
66

77
pub mod rbac;
8+
pub mod utils;
89
pub mod x509_chunks;
910

1011
mod decode_helper;
11-
mod utils;
1212

1313
use std::sync::Arc;
1414

15-
use c509_certificate::general_names::general_name::GeneralNameValue;
15+
use c509_certificate::{general_names::general_name::GeneralNameValue, C509ExtensionType};
1616
use decode_helper::{decode_bytes, decode_helper, decode_map_len};
17-
use der_parser::{asn1_rs::oid, der::parse_der_sequence, Oid};
17+
use der_parser::der::parse_der_sequence;
1818
use minicbor::{
1919
decode::{self},
2020
Decode, Decoder,
@@ -51,9 +51,6 @@ pub const LABEL: u64 = 509;
5151
/// uniform resource identifier (URI) in the subject alternative name extension.
5252
pub(crate) const URI: u8 = 134;
5353

54-
/// Subject Alternative Name OID
55-
pub(crate) const SUBJECT_ALT_NAME_OID: Oid = oid!(2.5.29 .17);
56-
5754
/// CIP509 metadatum.
5855
#[derive(Debug, PartialEq, Clone, Default)]
5956
pub struct Cip509 {
@@ -642,17 +639,17 @@ impl Cip509 {
642639
);
643640
},
644641
C509Cert::C509Certificate(c509) => {
645-
for exts in c509.get_tbs_cert().get_extensions().get_inner() {
646-
if exts.get_registered_oid().get_c509_oid().get_oid()
647-
== SUBJECT_ALT_NAME_OID
642+
for exts in c509.tbs_cert().extensions().extensions() {
643+
if *exts.registered_oid().c509_oid().oid()
644+
== C509ExtensionType::SubjectAlternativeName.oid()
648645
{
649-
match exts.get_value() {
646+
match exts.value() {
650647
c509_certificate::extensions::extension::ExtensionValue::AlternativeName(alt_name) => {
651-
match alt_name.get_inner() {
648+
match alt_name.general_name() {
652649
c509_certificate::extensions::alt_name::GeneralNamesOrText::GeneralNames(gn) => {
653-
for name in gn.get_inner() {
654-
if name.get_gn_type() == &c509_certificate::general_names::general_name::GeneralNameTypeRegistry::UniformResourceIdentifier {
655-
match name.get_gn_value() {
650+
for name in gn.general_names() {
651+
if name.gn_type() == &c509_certificate::general_names::general_name::GeneralNameTypeRegistry::UniformResourceIdentifier {
652+
match name.gn_value() {
656653
GeneralNameValue::Text(s) => {
657654
if let Some(h) = extract_cip19_hash(s, Some("stake")) {
658655
pk_addrs.push(h);

rust/cardano-chain-follower/src/metadata/cip509/rbac/role_data.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ impl Decode<'_, ()> for KeyReference {
112112
#[derive(Debug, PartialEq, Clone)]
113113
pub struct KeyLocalRef {
114114
/// Local reference.
115-
local_ref: LocalRefInt,
115+
pub local_ref: LocalRefInt,
116116
/// Key offset.
117-
key_offset: u64,
117+
pub key_offset: u64,
118118
}
119119

120120
/// Enum of local reference with its associated unsigned integer value.
121121
#[derive(FromRepr, Debug, PartialEq, Clone)]
122122
#[repr(u8)]
123-
enum LocalRefInt {
123+
pub enum LocalRefInt {
124124
/// x509 certificates.
125125
X509Certs = Cip509RbacMetadataInt::X509Certs as u8, // 10
126126
/// c509 certificates.

rust/cardano-chain-follower/src/metadata/cip509/utils.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use crate::witness::TxWitness;
77
/// Example input: `web+cardano://addr/<cip-19 address string>`
88
/// <https://github.com/cardano-foundation/CIPs/tree/6bae5165dde5d803778efa5e93bd408f3317ca03/CPS-0016>
99
/// URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]
10-
pub(crate) fn extract_cip19_hash(uri: &str, prefix: Option<&str>) -> Option<Vec<u8>> {
10+
#[must_use]
11+
pub fn extract_cip19_hash(uri: &str, prefix: Option<&str>) -> Option<Vec<u8>> {
1112
// Regex pattern to match the expected URI format
1213
let r = Regex::new("^.+://addr/(.+)$").ok()?;
1314

rust/catalyst-voting/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "catalyst-voting"
3-
version = "0.1.0"
3+
version = "0.0.1"
44
edition.workspace = true
55
authors.workspace = true
66
homepage.workspace = true
@@ -11,9 +11,9 @@ license.workspace = true
1111
workspace = true
1212

1313
[dependencies]
14-
thiserror = "1.0.56"
14+
thiserror = "1.0.64"
1515
rand_core = "0.6.4"
16-
curve25519-dalek = { version = "4.0", features = ["digest"] }
16+
curve25519-dalek = { version = "4.1.3", features = ["digest"] }
1717
blake2b_simd = "1.0.2"
1818

1919
[dev-dependencies]

0 commit comments

Comments
 (0)