partial progress on porting to ring-0.17

This commit is contained in:
bunnie 2024-02-09 17:18:41 +08:00
parent eb26e53e3b
commit 5fb368ae05
11 changed files with 113 additions and 75 deletions

138
Cargo.lock generated
View file

@ -1118,7 +1118,7 @@ dependencies = [
"sha2 0.10.8", "sha2 0.10.8",
"subtle", "subtle",
"trng", "trng",
"untrusted", "untrusted 0.7.1",
"xous-api-names", "xous-api-names",
] ]
@ -1150,13 +1150,13 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]] [[package]]
name = "curve25519-dalek" name = "curve25519-dalek"
version = "4.1.1" version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"curve25519-dalek-derive", "curve25519-dalek-derive",
"digest 0.10.7", "digest 0.10.7",
"engine-25519",
"engine25519-as",
"fiat-crypto 0.2.6", "fiat-crypto 0.2.6",
"platforms", "platforms",
"rustc_version 0.4.0", "rustc_version 0.4.0",
@ -1167,6 +1167,8 @@ dependencies = [
[[package]] [[package]]
name = "curve25519-dalek-derive" name = "curve25519-dalek-derive"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2345,6 +2347,29 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "hoot"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df22a4d90f1b0e65fe3e0d6ee6a4608cc4d81f4b2eb3e670f44bb6bde711e452"
dependencies = [
"httparse",
"log",
]
[[package]]
name = "hootbin"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "354e60868e49ea1a39c44b9562ad207c4259dc6eabf9863bf3b0f058c55cfdb2"
dependencies = [
"fastrand",
"hoot",
"serde",
"serde_json",
"thiserror",
]
[[package]] [[package]]
name = "http" name = "http"
version = "0.2.11" version = "0.2.11"
@ -2408,9 +2433,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]] [[package]]
name = "idna" name = "idna"
version = "0.5.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
dependencies = [ dependencies = [
"unicode-bidi", "unicode-bidi",
"unicode-normalization", "unicode-normalization",
@ -4128,16 +4153,31 @@ dependencies = [
[[package]] [[package]]
name = "ring" name = "ring"
version = "0.16.20" version = "0.16.20"
source = "git+https://github.com/betrusted-io/ring-xous?rev=4296c2e7904898766cf7d8d589759a129794783b#4296c2e7904898766cf7d8d589759a129794783b" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
"log",
"once_cell", "once_cell",
"rkyv",
"spin 0.5.2", "spin 0.5.2",
"untrusted", "untrusted 0.7.1",
"web-sys",
"winapi", "winapi",
]
[[package]]
name = "ring"
version = "0.17.7"
dependencies = [
"cc",
"cfg-if",
"getrandom 0.2.12",
"libc",
"log",
"rkyv",
"spin 0.9.8",
"untrusted 0.9.0",
"windows-sys 0.52.0",
"xous 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)", "xous 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-names", "xous-api-names",
"xous-ipc 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)", "xous-ipc 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)",
@ -4265,34 +4305,33 @@ dependencies = [
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.21.7" version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41"
dependencies = [ dependencies = [
"log", "log",
"ring", "ring 0.17.7",
"rustls-webpki 0.101.4", "rustls-pki-types",
"sct", "rustls-webpki",
"subtle",
"zeroize",
] ]
[[package]] [[package]]
name = "rustls-webpki" name = "rustls-pki-types"
version = "0.100.3" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf"
dependencies = [
"ring",
"untrusted",
]
[[package]] [[package]]
name = "rustls-webpki" name = "rustls-webpki"
version = "0.101.4" version = "0.102.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b"
dependencies = [ dependencies = [
"ring", "ring 0.17.7",
"untrusted", "rustls-pki-types",
"untrusted 0.9.0",
] ]
[[package]] [[package]]
@ -4334,8 +4373,8 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
dependencies = [ dependencies = [
"ring", "ring 0.16.20",
"untrusted", "untrusted 0.7.1",
] ]
[[package]] [[package]]
@ -4589,7 +4628,7 @@ dependencies = [
"rand_chacha 0.3.1", "rand_chacha 0.3.1",
"rand_xorshift", "rand_xorshift",
"random-pick", "random-pick",
"ring", "ring 0.17.7",
"rkyv", "rkyv",
"root-keys", "root-keys",
"sha2 0.10.8", "sha2 0.10.8",
@ -5083,11 +5122,11 @@ dependencies = [
"pddb", "pddb",
"rkyv", "rkyv",
"rustls", "rustls",
"rustls-webpki 0.101.4", "rustls-webpki",
"sct", "sct",
"sha2 0.10.8", "sha2 0.10.8",
"ureq", "ureq",
"webpki-roots 0.24.0", "webpki-roots",
"x509-parser", "x509-parser",
"xous 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)", "xous 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log", "xous-api-log",
@ -5125,7 +5164,7 @@ dependencies = [
"log", "log",
"pem", "pem",
"pkcs8 0.8.0", "pkcs8 0.8.0",
"ring", "ring 0.17.7",
"sha2 0.10.8", "sha2 0.10.8",
"svd2utra 0.1.22", "svd2utra 0.1.22",
"xmas-elf", "xmas-elf",
@ -5338,28 +5377,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]] [[package]]
name = "ureq" name = "untrusted"
version = "2.7.1" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "ureq"
version = "2.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "399dd89e2af196ae4f83a47bb37a1455e664fe2fed97b3ae68a1c4a3f8216e76"
dependencies = [ dependencies = [
"base64 0.21.7", "base64 0.21.7",
"flate2", "flate2",
"hootbin",
"log", "log",
"once_cell", "once_cell",
"rustls", "rustls",
"rustls-webpki 0.100.3", "rustls-pki-types",
"rustls-webpki",
"serde", "serde",
"serde_json", "serde_json",
"url", "url",
"webpki-roots 0.23.1", "webpki-roots",
] ]
[[package]] [[package]]
name = "url" name = "url"
version = "2.5.0" version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"idna", "idna",
@ -5889,20 +5936,11 @@ dependencies = [
[[package]] [[package]]
name = "webpki-roots" name = "webpki-roots"
version = "0.23.1" version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188"
dependencies = [ dependencies = [
"rustls-webpki 0.100.3", "rustls-pki-types",
]
[[package]]
name = "webpki-roots"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888"
dependencies = [
"rustls-webpki 0.101.4",
] ]
[[package]] [[package]]

View file

@ -164,9 +164,9 @@ branch = "main"
path = "imports/getrandom" path = "imports/getrandom"
[patch.crates-io.ring] [patch.crates-io.ring]
# path = "../ring-xous" # for local dev only path = "../ring-xous" # for local dev only
git = "https://github.com/betrusted-io/ring-xous" #git = "https://github.com/betrusted-io/ring-xous"
rev = "4296c2e7904898766cf7d8d589759a129794783b" # use the commitref because we're still updating the branch #rev = "4296c2e7904898766cf7d8d589759a129794783b" # use the commitref because we're still updating the branch
#branch="0.16.20-cleanup" #branch="0.16.20-cleanup"
###################################################### ######################################################

View file

@ -25,5 +25,5 @@ rkyv = { version = "0.4.3", features = [
"const_generics", "const_generics",
], default-features = false } ], default-features = false }
ureq = { version = "2.5.0", features = ["json"] } ureq = { version = "2.9.4", features = ["json"] }
url = "2.4" url = "2.3.1"

View file

@ -38,8 +38,8 @@ rkyv = { version = "0.4.3", default-features = false, features = [
] } ] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tls = { path = "../../libs/tls" } tls = { path = "../../libs/tls" }
ureq = { version = "2.7.1", features = ["json"] } ureq = { version = "2.9.4", features = ["json"] }
url = "2.2.2" url = "2.3.1"
[features] [features]
default = [] default = []

View file

@ -37,8 +37,8 @@ rkyv = { version = "0.4.3", default-features = false, features = [
] } ] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tls = { path = "../../libs/tls" } tls = { path = "../../libs/tls" }
ureq = { version = "2.7.1", features = ["json"] } ureq = { version = "2.9.4", features = ["json"] }
url = "2.2.2" url = "2.3.1"
[features] [features]
default = [] default = []

View file

@ -31,7 +31,7 @@ pddb = { path = "../../services/pddb" }
# new dependencies for mtxcli # new dependencies for mtxcli
percent-encoding = "2.2" percent-encoding = "2.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
ureq = { version = "2.5", features = ["json"] } ureq = { version = "2.9.4", features = ["json"] }
[features] [features]
default = [] default = []

View file

@ -8,18 +8,18 @@ edition = "2021"
[dependencies] [dependencies]
argh = "0.1.8" argh = "0.1.8"
ctaphid = "0.1.1" ctaphid = "0.1.1"
cbor = {path = "../../libraries/cbor"} cbor = { path = "../../libraries/cbor" }
backup = {path = "../../libraries/backup"} backup = { path = "../../libraries/backup" }
hidapi = {version = "1.4.1", default_features = false} hidapi = { version = "1.4.1", default_features = false }
serde_json = "1.0.82" serde_json = "1.0.82"
serde = {version = "1.0.138", features = ["derive"]} serde = { version = "1.0.138", features = ["derive"] }
hex = "0.4.3" hex = "0.4.3"
clap = { version = "3.2.12", features = ["derive"] } clap = { version = "3.2.12", features = ["derive"] }
anyhow = "1.0.58" anyhow = "1.0.58"
log = "0.4.17" log = "0.4.17"
env_logger = "0.9.0" env_logger = "0.9.0"
serde_repr = "0.1.9" serde_repr = "0.1.9"
url = "2.2.2" url = "2.3.1"
base64 = "0.5.2" base64 = "0.5.2"
base32 = "0.4.0" base32 = "0.4.0"
protobuf = "3.1.0" protobuf = "3.1.0"

View file

@ -25,11 +25,11 @@ rkyv = "0.4.3"
sha2 = { version = "0.10.8" } sha2 = { version = "0.10.8" }
# note requirement for patch to xous-ring in workspace Cargo.toml # note requirement for patch to xous-ring in workspace Cargo.toml
rustls = { version = "=0.21.7", features = ["dangerous_configuration"] } rustls = { version = "=0.22.2" }
ureq = "=2.7.1" ureq = "2.9.4"
webpki = { package = "rustls-webpki", version = "=0.101.4" } webpki = { package = "rustls-webpki", version = "=0.102.1" }
sct = { version = "=0.7.0"} sct = { version = "=0.7.0" }
webpki-roots = { version = "=0.24.0", optional = true } webpki-roots = { version = "=0.26.0", optional = true }
x509-parser = "0.15.0" x509-parser = "0.15.0"
[features] [features]

View file

@ -80,10 +80,10 @@ tracing-subscriber = { version = "0.3.11", optional = true }
# for rustls testing # for rustls testing
tls = { path = "../../libs/tls", optional = true } tls = { path = "../../libs/tls", optional = true }
url = { version = "2.2.2", optional = true } url = { version = "2.3.1", optional = true }
# for testing ring math functions # for testing ring math functions
# note requirement for patch to xous-ring in workspace Cargo.toml # note requirement for patch to xous-ring in workspace Cargo.toml
ring = { version = "=0.16.20", optional = true } ring = { version = "=0.17.7", optional = true }
# for websocket testing # for websocket testing
tungstenite = { version = "0.20.0", optional = true } tungstenite = { version = "0.20.0", optional = true }
@ -97,7 +97,7 @@ random-pick = { version = "1.2.16", optional = true }
hex = { version = "0.4.3", default-features = false, features = [] } hex = { version = "0.4.3", default-features = false, features = [] }
#sha2 = {version = "0.9.5", default-features = false, features = []} #sha2 = {version = "0.9.5", default-features = false, features = []}
[dependencies.curve25519-dalek] [dependencies.curve25519-dalek]
version = "=4.1.1" # note this is patched to our fork in ./Cargo.toml version = "=4.1.1" # note this is patched to our fork in ./Cargo.toml
default-features = false default-features = false
[dependencies.x25519-dalek] [dependencies.x25519-dalek]

View file

@ -13,7 +13,7 @@ bitflags = "1.2.1"
clap = "2.33.3" clap = "2.33.3"
crc = "1.8.1" crc = "1.8.1"
csv = "1.1.5" csv = "1.1.5"
ring = "0.16.20" ring = "0.17.7"
env_logger = "0.7.1" env_logger = "0.7.1"
log = "0.4.14" log = "0.4.14"
pem = "0.8.3" pem = "0.8.3"

View file

@ -16,7 +16,7 @@ chrono = "0.4.33"
serde_json = "1.0.41" serde_json = "1.0.41"
serde = { version = "1.0.130", features = ["derive"] } serde = { version = "1.0.130", features = ["derive"] }
tempfile = "3.3.0" tempfile = "3.3.0"
ureq = { version = "2.5.0", features = ["json"] } ureq = { version = "2.9.0", features = ["json"] }
svd2utra = "0.1.22" svd2utra = "0.1.22"
lazy_static = "1.4.0" lazy_static = "1.4.0"
# toml_edit = "0.14.4" # would be used to verify Cargo.toml files, but it's too hard to do this right now. # toml_edit = "0.14.4" # would be used to verify Cargo.toml files, but it's too hard to do this right now.