From ccc8c4dede7a58936f70c8465fc1efbeda55d049 Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Thu, 9 Dec 2021 10:16:15 +0100 Subject: [PATCH 1/9] Update to tokio 1.14.0 --- Cargo.lock | 198 +++++++++++++++++++-------------------------- mbedtls/Cargo.toml | 2 +- 2 files changed, 86 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46308c784..3aa64e5cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,65 +6,50 @@ version = 3 name = "aho-corasick" version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" dependencies = [ - "memchr", + "memchr 0.1.11", ] [[package]] name = "ansi_term" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "003f95e0fb6cf3d1fee8c62b2ec35135509477989fab15c358e0efa3972bdef6" dependencies = [ - "hermit-abi", + "cexpr", + "clang-sys", + "docopt", + "env_logger", "libc", - "winapi", + "log 0.3.9", + "rustc-serialize", + "syntex_syntax", ] [[package]] name = "autocfg" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" [[package]] name = "bindgen" version = "0.58.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8523b410d7187a43085e7e064416ea32ded16bd0a4e6fc025e21616d01258f" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "clap", - "env_logger", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "which", -] +checksum = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" [[package]] name = "bit-vec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" +checksum = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" [[package]] name = "bitflags" @@ -122,7 +107,7 @@ checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" name = "cexpr" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +checksum = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" dependencies = [ "nom", ] @@ -149,64 +134,58 @@ dependencies = [ "num-integer", "num-traits", "time", - "winapi", + "winapi 0.3.9", ] [[package]] name = "clang-sys" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" +checksum = "19911f7964ce61a02d382adee8400f919d0fedd53c5441e3d6a9858ba73e249e" dependencies = [ + "bitflags 0.7.0", "glob", "libc", - "libloading", ] [[package]] name = "clap" version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", + "cc", ] [[package]] name = "cmake" version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "bb3b45b225c233ea8b95309256e842264692c68eeb543e06755de9072dd1178a" dependencies = [ - "cc", + "rustc_version", ] [[package]] name = "core_io" version = "0.1.20210325" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97f8932064288cc79feb4d343a399d353a6f6f001e586ece47fe518a9e8507df" +checksum = "4a7ef30445607f6fc8720f0a0a2c7442284b629cf0d049286860fae23e71c4d9" dependencies = [ - "rustc_version", + "lazy_static 0.2.11", + "regex", + "rustc-serialize", + "strsim", ] [[package]] name = "env_logger" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +checksum = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" dependencies = [ - "atty", - "humantime", - "log", + "log 0.3.9", "regex", - "termcolor", ] [[package]] @@ -228,16 +207,7 @@ dependencies = [ name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" [[package]] name = "hex" @@ -249,19 +219,23 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" [[package]] name = "lazycell" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" @@ -273,22 +247,21 @@ checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" name = "libloading" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ - "cfg-if 1.0.0", - "winapi", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", + "log 0.4.11", ] [[package]] @@ -311,7 +284,7 @@ name = "mbedtls" version = "0.7.1" dependencies = [ "bit-vec", - "bitflags", + "bitflags 1.2.1", "block-modes", "byteorder", "cc", @@ -337,35 +310,43 @@ dependencies = [ [[package]] name = "mbedtls-sys-auto" -version = "2.28.0" +version = "2.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2231108271d9a10052178d940926baf24b57a2eb1703732faae387592dd6ac3" +checksum = "cf1210639c52c5dedbea06669e4d111ecfb9f26a0e09074dbe13a73bf1a6505e" dependencies = [ "bindgen", - "cc", "cfg-if 1.0.0", "cmake", - "lazy_static", + "lazy_static 1.4.0", "libc", "libz-sys", - "quote", - "syn", +] + +[[package]] +name = "memchr" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" +dependencies = [ + "libc", ] [[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" +dependencies = [ + "libc", +] [[package]] name = "nom" version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +checksum = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" dependencies = [ - "memchr", - "version_check", + "memchr 1.0.2", ] [[package]] @@ -404,12 +385,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pin-project-lite" version = "0.2.6" @@ -450,7 +425,7 @@ dependencies = [ "libc", "rand_core 0.3.1", "rdrand", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -491,18 +466,20 @@ dependencies = [ name = "regex" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" dependencies = [ "aho-corasick", - "memchr", + "memchr 0.1.11", "regex-syntax", + "thread_local", + "utf8-ranges", ] [[package]] name = "regex-syntax" version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" [[package]] name = "rs-libc" @@ -517,7 +494,7 @@ dependencies = [ name = "rustc-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" [[package]] name = "rustc_version" @@ -587,7 +564,7 @@ checksum = "ceac490aa12c567115b40b7b7fceca03a6c9d53d5defea066123debc83c5dc1f" name = "strsim" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" [[package]] name = "syn" @@ -604,18 +581,19 @@ dependencies = [ name = "termcolor" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" dependencies = [ - "winapi-util", + "kernel32-sys", + "libc", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" dependencies = [ - "unicode-width", + "thread-id", ] [[package]] @@ -626,14 +604,14 @@ checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", "wasi", - "winapi", + "winapi 0.3.9", ] [[package]] name = "tokio" -version = "0.3.7" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46409491c9375a693ce7032101970a54f8a2010efb77e13f70788f0d84489e39" +checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" dependencies = [ "autocfg", "pin-project-lite", @@ -649,7 +627,7 @@ checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" name = "unicode-width" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "unicode-xid" @@ -661,7 +639,7 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" name = "vcpkg" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" [[package]] name = "vec_map" @@ -673,7 +651,7 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "wasi" @@ -685,10 +663,7 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" name = "which" version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" @@ -704,16 +679,13 @@ dependencies = [ name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] name = "winapi-util" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" diff --git a/mbedtls/Cargo.toml b/mbedtls/Cargo.toml index a8ee861b7..8b86c3c5d 100644 --- a/mbedtls/Cargo.toml +++ b/mbedtls/Cargo.toml @@ -30,7 +30,7 @@ num-bigint = { version = "0.2", optional = true } bit-vec = { version = "0.5", optional = true } block-modes = { version = "0.3", optional = true } rc2 = { version = "0.3", optional = true } -tokio = { version = "0.3", optional = true } +tokio = { version = "1.14", optional = true } proc-macro2 = "=1.0.24" quote = "=1.0.9" From df54c10a636e2868624753e1929850ccf0ebff57 Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Wed, 22 Dec 2021 09:25:38 +0100 Subject: [PATCH 2/9] Update to tokio 1.15.0 --- Cargo.lock | 5 ++--- mbedtls/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3aa64e5cf..e1aec6aa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -609,11 +609,10 @@ dependencies = [ [[package]] name = "tokio" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" +checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" dependencies = [ - "autocfg", "pin-project-lite", ] diff --git a/mbedtls/Cargo.toml b/mbedtls/Cargo.toml index 8b86c3c5d..80deecfb5 100644 --- a/mbedtls/Cargo.toml +++ b/mbedtls/Cargo.toml @@ -30,7 +30,7 @@ num-bigint = { version = "0.2", optional = true } bit-vec = { version = "0.5", optional = true } block-modes = { version = "0.3", optional = true } rc2 = { version = "0.3", optional = true } -tokio = { version = "1.14", optional = true } +tokio = { version = "1.15", optional = true } proc-macro2 = "=1.0.24" quote = "=1.0.9" From 925398fa3f7dbc8ca94965917d375377b45a60f3 Mon Sep 17 00:00:00 2001 From: "bors[bot]" <26634292+bors[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 12:41:41 +0000 Subject: [PATCH 3/9] Merge #187 187: Enable ARIA cipher r=jethrogb a=zugzwang Co-authored-by: Francisco Vial-Prado --- mbedtls/src/cipher/raw/mod.rs | 2 ++ mbedtls/src/self_test.rs | 2 +- mbedtls/src/ssl/ciphersuites.rs | 38 +++++++++++++++++++++++++++++ mbedtls/tests/mbedtls_self_tests.rs | 11 +++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/mbedtls/src/cipher/raw/mod.rs b/mbedtls/src/cipher/raw/mod.rs index c39563018..c6d883814 100644 --- a/mbedtls/src/cipher/raw/mod.rs +++ b/mbedtls/src/cipher/raw/mod.rs @@ -23,6 +23,7 @@ define!( Camellia = CIPHER_ID_CAMELLIA, Blowfish = CIPHER_ID_BLOWFISH, Arc4 = CIPHER_ID_ARC4, + Aria = CIPHER_ID_ARIA, } ); @@ -37,6 +38,7 @@ impl From for CipherId { CIPHER_ID_CAMELLIA => CipherId::Camellia, CIPHER_ID_BLOWFISH => CipherId::Blowfish, CIPHER_ID_ARC4 => CipherId::Arc4, + CIPHER_ID_ARIA => CipherId::Aria, // This should be replaced with TryFrom once it is stable. _ => panic!("Invalid cipher_id_t"), } diff --git a/mbedtls/src/self_test.rs b/mbedtls/src/self_test.rs index 3a97b2244..2f3b214fa 100644 --- a/mbedtls/src/self_test.rs +++ b/mbedtls/src/self_test.rs @@ -59,7 +59,7 @@ pub unsafe fn disable() { } pub use mbedtls_sys::{ - aes_self_test as aes, arc4_self_test as arc4, base64_self_test as base64, + aes_self_test as aes, arc4_self_test as arc4, aria_self_test as aria, base64_self_test as base64, camellia_self_test as camellia, ccm_self_test as ccm, ctr_drbg_self_test as ctr_drbg, des_self_test as des, dhm_self_test as dhm, ecjpake_self_test as ecjpake, ecp_self_test as ecp, entropy_self_test as entropy, gcm_self_test as gcm, hmac_drbg_self_test as hmac_drbg, diff --git a/mbedtls/src/ssl/ciphersuites.rs b/mbedtls/src/ssl/ciphersuites.rs index 20cbeaac8..8bd193a33 100644 --- a/mbedtls/src/ssl/ciphersuites.rs +++ b/mbedtls/src/ssl/ciphersuites.rs @@ -120,6 +120,44 @@ define!( EcdhePskWithNullSha = TLS_ECDHE_PSK_WITH_NULL_SHA, EcdhePskWithNullSha256 = TLS_ECDHE_PSK_WITH_NULL_SHA256, EcdhePskWithNullSha384 = TLS_ECDHE_PSK_WITH_NULL_SHA384, + RsaWithAria128CbcSha256 = TLS_RSA_WITH_ARIA_128_CBC_SHA256, + RsaWithAria256CbcSha384 = TLS_RSA_WITH_ARIA_256_CBC_SHA384, + DheRsaWithAria128CbcSha256 = TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256, + DheRsaWithAria256CbcSha384 = TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384, + EcdheEcdsaWithAria128CbcSha256 = TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256, + EcdheEcdsaWithAria256CbcSha384 = TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384, + EcdhEcdsaWithAria128CbcSha256 = TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256, + EcdhEcdsaWithAria256CbcSha384 = TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384, + EcdheRsaWithAria128CbcSha256 = TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256, + EcdheRsaWithAria256CbcSha384 = TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384, + EcdhRsaWithAria128CbcSha256 = TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256, + EcdhRsaWithAria256CbcSha384 = TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384, + RsaWithAria128GcmSha256 = TLS_RSA_WITH_ARIA_128_GCM_SHA256, + RsaWithAria256GcmSha384 = TLS_RSA_WITH_ARIA_256_GCM_SHA384, + DheRsaWithAria128GcmSha256 = TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256, + DheRsaWithAria256GcmSha384 = TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384, + EcdheEcdsaWithAria128GcmSha256 = TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256, + EcdheEcdsaWithAria256GcmSha384 = TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384, + EcdhEcdsaWithAria128GcmSha256 = TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256, + EcdhEcdsaWithAria256GcmSha384 = TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384, + EcdheRsaWithAria128GcmSha256 = TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256, + EcdheRsaWithAria256GcmSha384 = TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384, + EcdhRsaWithAria128GcmSha256 = TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256, + EcdhRsaWithAria256GcmSha384 = TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384, + PskWithAria128CbcSha256 = TLS_PSK_WITH_ARIA_128_CBC_SHA256, + PskWithAria256CbcSha384 = TLS_PSK_WITH_ARIA_256_CBC_SHA384, + DhePskWithAria128CbcSha256 = TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256, + DhePskWithAria256CbcSha384 = TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384, + RsaPskWithAria128CbcSha256 = TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256, + RsaPskWithAria256CbcSha384 = TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384, + PskWithAria128GcmSha256 = TLS_PSK_WITH_ARIA_128_GCM_SHA256, + PskWithAria256GcmSha384 = TLS_PSK_WITH_ARIA_256_GCM_SHA384, + DhePskWithAria128GcmSha256 = TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256, + DhePskWithAria256GcmSha384 = TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384, + RsaPskWithAria128GcmSha256 = TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256, + RsaPskWithAria256GcmSha384 = TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384, + EcdhePskWithAria128CbcSha256 = TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256, + EcdhePskWithAria256CbcSha384 = TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384, EcdheEcdsaWithCamellia128CbcSha256 = TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, EcdheEcdsaWithCamellia256CbcSha384 = TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, EcdhEcdsaWithCamellia128CbcSha256 = TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, diff --git a/mbedtls/tests/mbedtls_self_tests.rs b/mbedtls/tests/mbedtls_self_tests.rs index 0b74eb572..9c77fe873 100644 --- a/mbedtls/tests/mbedtls_self_tests.rs +++ b/mbedtls/tests/mbedtls_self_tests.rs @@ -25,6 +25,16 @@ fn enable_self_test() { static START: Once = Once::new(); + let log_f; + + cfg_if::cfg_if! { + if #[cfg(feature = "std")] { + log_f = None; + } else { + log_f = Some(log as _); + } + } + START.call_once(|| { // safe because synchronized unsafe { mbedtls::self_test::enable(rand, log) }; @@ -52,6 +62,7 @@ macro_rules! tests { tests! { fn aes, fn arc4, + fn aria, fn base64, fn camellia, fn ccm, From de2561b20189f6e341e95d70946d740a645b31e3 Mon Sep 17 00:00:00 2001 From: "bors[bot]" <26634292+bors[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:49:40 +0000 Subject: [PATCH 4/9] Merge #191 191: Add serde support for the ARIA cipher r=AdrianCX a=zugzwang This PR adds serde support for the Aria cipher. This is needed to use the `update` API. This is a follow-up of #187. Co-authored-by: Francisco Vial-Prado --- mbedtls/src/cipher/raw/serde.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mbedtls/src/cipher/raw/serde.rs b/mbedtls/src/cipher/raw/serde.rs index 7cb018996..6bb621301 100644 --- a/mbedtls/src/cipher/raw/serde.rs +++ b/mbedtls/src/cipher/raw/serde.rs @@ -44,6 +44,7 @@ pub struct SavedRawCipher { #[derive(Serialize, Deserialize)] enum AlgorithmContext { Aes(Bytes), + Aria(Bytes), Des(Bytes), Des3(Bytes), Gcm { @@ -94,6 +95,12 @@ unsafe fn serialize_raw_cipher(mut cipher_context: cipher_context_t) aes_context.rk = ::core::ptr::null_mut(); AlgorithmContext::Aes(Bytes(aes_context)) } + (CIPHER_ID_ARIA, MODE_CBC) + | (CIPHER_ID_ARIA, MODE_CTR) + | (CIPHER_ID_ARIA, MODE_CFB) + | (CIPHER_ID_ARIA, MODE_ECB) => { + AlgorithmContext::Aria(Bytes(*(cipher_context.cipher_ctx as *const aria_context))) + } (CIPHER_ID_DES, MODE_CBC) | (CIPHER_ID_DES, MODE_CTR) | (CIPHER_ID_DES, MODE_CFB) => { @@ -208,6 +215,9 @@ unsafe fn deserialize_raw_cipher(raw: SavedRawCipher, padding: raw::CipherPaddin // mbedtls_aes_context in the mbedTLS source). (*ret_aes_ctx).rk = &mut (*ret_aes_ctx).buf[0]; } + (CIPHER_ID_ARIA, AlgorithmContext::Aria(Bytes(aria_ctx))) => { + *(cipher_context.cipher_ctx as *mut aria_context) = aria_ctx + } (CIPHER_ID_DES, AlgorithmContext::Des(Bytes(des_ctx))) => { *(cipher_context.cipher_ctx as *mut des_context) = des_ctx } @@ -321,6 +331,7 @@ impl<'de, T: BytesSerde> Deserialize<'de> for Bytes { unsafe impl BytesSerde for cipher_context_t {} unsafe impl BytesSerde for aes_context {} +unsafe impl BytesSerde for aria_context {} unsafe impl BytesSerde for des_context {} unsafe impl BytesSerde for des3_context {} unsafe impl BytesSerde for gcm_context {} From 66b93241441ee67c75b9e82e1cc204eb6ce4368f Mon Sep 17 00:00:00 2001 From: "bors[bot]" <26634292+bors[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 08:46:50 +0000 Subject: [PATCH 5/9] Merge #176 176: Add support for HKDF r=jethrogb a=kedars Co-authored-by: Kedar Sovani --- mbedtls/src/hash/mod.rs | 23 +++++++++++++++++++++++ mbedtls/tests/hkdf.rs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 mbedtls/tests/hkdf.rs diff --git a/mbedtls/src/hash/mod.rs b/mbedtls/src/hash/mod.rs index 64dbaa9b4..38b975e30 100644 --- a/mbedtls/src/hash/mod.rs +++ b/mbedtls/src/hash/mod.rs @@ -147,6 +147,29 @@ impl Md { Ok(olen) } } + + pub fn hkdf(md: Type, salt: &[u8], ikm: &[u8], info: &[u8], key: &mut [u8]) -> Result<()> { + let md: MdInfo = match md.into() { + Some(md) => md, + None => return Err(Error::MdBadInputData), + }; + + unsafe { + hkdf( + md.inner, + salt.as_ptr(), + salt.len(), + ikm.as_ptr(), + ikm.len(), + info.as_ptr(), + info.len(), + key.as_mut_ptr(), + key.len(), + ) + .into_result()?; + Ok(()) + } + } } pub fn pbkdf2_hmac( diff --git a/mbedtls/tests/hkdf.rs b/mbedtls/tests/hkdf.rs new file mode 100644 index 000000000..e39c9f379 --- /dev/null +++ b/mbedtls/tests/hkdf.rs @@ -0,0 +1,34 @@ +/* Copyright (c) Fortanix, Inc. + * + * Licensed under the GNU General Public License, version 2 or the Apache License, Version + * 2.0 , at your + * option. This file may not be copied, modified, or distributed except + * according to those terms. */ + +use mbedtls::hash::Md; +use mbedtls::hash::Type as MdType; + +#[test] +fn test_hkdf_sha256() { + let ikm = [ + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + ]; + + let salt = [ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, + ]; + let info = [0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9]; + let mut output = [0u8; 42]; + Md::hkdf(MdType::Sha256, &salt, &ikm, &info, &mut output).unwrap(); + + assert_eq!( + output, + [ + 0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36, + 0x2f, 0x2a, 0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a, 0x5a, 0x4c, 0x5d, 0xb0, 0x2d, 0x56, + 0xec, 0xc4, 0xc5, 0xbf, 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18, 0x58, 0x65 + ] + ); +} From 7d6ebc8a1901a892843037f230e02af7be65ebdc Mon Sep 17 00:00:00 2001 From: "bors[bot]" <26634292+bors[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 14:06:06 +0000 Subject: [PATCH 6/9] Merge #194 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 194: Fix checks on curve parameters r=jethrogb a=zugzwang On instantiating a curve by parameters, the code checks that all field elements are non-zero in 𝔽ₚ. This is not necessary, and forbids useful curves such as e.g. the Barreto-Naehrig pairing-friendly curves, of the form y² = x³ + 257 (e.g. `a = 0`), and secp256k1 (used in Bitcoin, but can be instantiated by name). Co-authored-by: Francisco Vial-Prado --- mbedtls/src/ecp/mod.rs | 168 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 164 insertions(+), 4 deletions(-) diff --git a/mbedtls/src/ecp/mod.rs b/mbedtls/src/ecp/mod.rs index 8d28dcac8..8a675a33b 100644 --- a/mbedtls/src/ecp/mod.rs +++ b/mbedtls/src/ecp/mod.rs @@ -79,6 +79,13 @@ impl EcGroup { Ok(ret) } + /// Initialize an EcGroup with custom group parameters. + /// + /// HAZMAT: This function DOES NOT perform a full check on parameters + /// against all known attacks. The caller MUST make sure that parameters are + /// trusted. Failing to comply with this requirement may result in the use + /// of INSECURE curves. Prefer [EcGroup::new] with known curves listed in + /// [EcGroupId]. pub fn from_parameters( p: Mpi, a: Mpi, @@ -96,15 +103,16 @@ impl EcGroup { let zero = Mpi::new(0)?; // basic bounds checking - if &a <= &zero + if &a < &zero || &a >= &p - || &b <= &zero + || &b < &zero || &b >= &p - || &g_x <= &zero + || &g_x < &zero || &g_x >= &p - || &g_y <= &zero + || &g_y < &zero || &g_y >= &p || &order <= &zero + || (&a == &zero && &b == &zero) { return Err(Error::EcpBadInputData); } @@ -191,6 +199,8 @@ impl EcGroup { match self.group_id()? { EcGroupId::Curve25519 => Ok(8), EcGroupId::Curve448 => Ok(4), + // Requires a point-counting algorithm such as SEA. + EcGroupId::None => Err(Error::EcpFeatureUnavailable), _ => Ok(1), } } @@ -754,4 +764,154 @@ mod tests { let pt3 = pt1.clone(); assert_eq!(pt2.eq(&pt3).unwrap(), true); } + + #[cfg(feature = "std")] + struct Params<'a> { + p: &'a str, + a: &'a str, + b: &'a str, + g_x: &'a str, + g_y: &'a str, + n: &'a str, + } + + #[cfg(feature = "std")] + impl Into> for Params<'_> { + fn into(self) -> super::Result { + use std::str::FromStr; + EcGroup::from_parameters( + Mpi::from_str(self.p)?, + Mpi::from_str(self.a)?, + Mpi::from_str(self.b)?, + Mpi::from_str(self.g_x)?, + Mpi::from_str(self.g_y)?, + Mpi::from_str(self.n)?, + ) + } + } + + #[test] + #[cfg(feature = "std")] + fn pathological_parameters() { + // y² = x³ mod 7 (note a == b == 0) + let singular: super::Result<_> = Params { + p: "0x07", + a: "0x00", + b: "0x00", + g_x: "0x01", + g_y: "0x02", + n: "0x0b", + }.into(); + assert!(singular.is_err()); + } + + #[test] + #[cfg(feature = "std")] + fn bad_generators() { + // y² = x³ + x + 6 (mod 7) with bad generator (1, 2) and prime order 11 + let small_curve: super::Result<_> = Params { + p: "0x07", + a: "0x01", + b: "0x06", + g_x: "0x01", + g_y: "0x02", + n: "0x0b", + }.into(); + assert!(small_curve.is_err()); + + // y² = x³ + x + 6 (mod 7) with bad generator (0, 0) and prime order 11 + let small_curve_zero_gen: super::Result<_> = Params { + p: "0x07", + a: "0x01", + b: "0x06", + g_x: "0x00", + g_y: "0x00", + n: "0x0b", + }.into(); + assert!(small_curve_zero_gen.is_err()); + } + + #[test] + #[cfg(feature = "std")] + fn unknown_cofactor() { + // y² = x³ + x + 6 (mod 7) with generator (1, 6) and prime order 11 + let small_curve: super::Result<_> = Params { + p: "0x07", + a: "0x01", + b: "0x06", + g_x: "0x01", + g_y: "0x06", + n: "0x0b", + }.into(); + assert!(small_curve.unwrap().cofactor().is_err()); + } + + #[test] + #[cfg(feature = "std")] + fn zero_params_curves() { + use super::Result; + // Barreto-Naehrig 254, note a = 0 + let bn254: Result<_> = Params { + p: "0x2523648240000001BA344D80000000086121000000000013A700000000000013", + a: "0x0000000000000000000000000000000000000000000000000000000000000000", + b: "0x0000000000000000000000000000000000000000000000000000000000000002", + g_x: "0x2523648240000001BA344D80000000086121000000000013A700000000000012", + g_y: "0x0000000000000000000000000000000000000000000000000000000000000001", + n: "0x2523648240000001BA344D8000000007FF9F800000000010A10000000000000D", + }.into(); + assert!(bn254.is_ok()); + + // Prescribed embedded degree of 12, BLS12-381 + let bls12_381: Result<_> = Params { + p: "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", + a: "0x00", + b: "0x04", + g_x: "0x17F1D3A73197D7942695638C4FA9AC0FC3688C4F9774B905A14E3A3F171BAC586C55E83FF97A1AEFFB3AF00ADB22C6BB", + g_y: "0x08B3F481E3AAA0F1A09E30ED741D8AE4FCF5E095D5D00AF600DB18CB2C04B3EDD03CC744A2888AE40CAA232946C5E7E1", + n: "0x73EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + }.into(); + assert!(bls12_381.is_ok()); + + // Fp256BN + let fp256_bn: Result<_> = Params { + p: "0xfffffffffffcf0cd46e5f25eee71a49f0cdc65fb12980a82d3292ddbaed33013", + a: "0x00", + b: "0x03", + g_x: "0x01", + g_y: "0x02", + n: "0xfffffffffffcf0cd46e5f25eee71a49e0cdc65fb1299921af62d536cd10b500d", + }.into(); + assert!(fp256_bn.is_ok()); + + // id-GostR3410-2001-CryptoPro-C-ParamSet, note g_x = 0 + let gost_r3410: Result<_> = Params { + p: "0x9b9f605f5a858107ab1ec85e6b41c8aacf846e86789051d37998f7b9022d759b", + a: "0x9b9f605f5a858107ab1ec85e6b41c8aacf846e86789051d37998f7b9022d7598", + b: "0x805a", + g_x: "0x00", + g_y: "0x41ece55743711a8c3cbf3783cd08c0ee4d4dc440d4641a8f366e550dfdb3bb67", + n: "0x9b9f605f5a858107ab1ec85e6b41c8aa582ca3511eddfb74f02f3a6598980bb9", + }.into(); + assert!(gost_r3410.is_ok()); + + // secp256k1 (Bitcoin), note a = 0 + let my_secp256k1: Result = Params { + p: "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + a: "0x0000000000000000000000000000000000000000000000000000000000000000", + b: "0x0000000000000000000000000000000000000000000000000000000000000007", + g_x: "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + g_y: "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + n: "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + }.into(); + assert!(my_secp256k1.is_ok()); + let my_secp256k1 = my_secp256k1.unwrap(); + + // We compare against the known SecP256K1 + let secp256k1 = EcGroup::new(EcGroupId::SecP256K1).unwrap(); + assert!(my_secp256k1.p() == secp256k1.p()); + assert!(my_secp256k1.a() == secp256k1.a()); + assert!(my_secp256k1.b() == secp256k1.b()); + assert!(my_secp256k1.generator() == secp256k1.generator()); + assert!(my_secp256k1.order() == secp256k1.order()); + } } From 11966581c0abb97f6407d4a4effb8638f8a54345 Mon Sep 17 00:00:00 2001 From: Yuxiang Cao Date: Thu, 9 Mar 2023 12:34:47 -0800 Subject: [PATCH 7/9] pump mbedtls version --- Cargo.lock | 2 +- mbedtls/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1aec6aa2..a483a8b32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,7 +281,7 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "mbedtls" -version = "0.7.1" +version = "0.7.2" dependencies = [ "bit-vec", "bitflags 1.2.1", diff --git a/mbedtls/Cargo.toml b/mbedtls/Cargo.toml index 80deecfb5..fe9006ef2 100644 --- a/mbedtls/Cargo.toml +++ b/mbedtls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mbedtls" -version = "0.7.1" +version = "0.7.2" authors = ["Jethro Beekman "] build = "build.rs" edition = "2018" From a7aa915f37957571296a7b1c2a92b230ff0a6d3a Mon Sep 17 00:00:00 2001 From: Yuxiang Cao Date: Thu, 9 Mar 2023 12:35:46 -0800 Subject: [PATCH 8/9] pump tokio version --- Cargo.lock | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a483a8b32..8c6c42755 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bindgen" @@ -609,11 +609,13 @@ dependencies = [ [[package]] name = "tokio" -version = "1.15.0" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ + "autocfg", "pin-project-lite", + "windows-sys", ] [[package]] @@ -692,6 +694,72 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + [[package]] name = "yasna" version = "0.2.2" From 02305b7e2db1f369076e177e926233c53033f5d1 Mon Sep 17 00:00:00 2001 From: Yuxiang Cao Date: Mon, 13 Mar 2023 17:42:02 -0700 Subject: [PATCH 9/9] fix: fix error after rebase --- Cargo.lock | 265 ++++++++++++---------------- mbedtls/Cargo.toml | 3 +- mbedtls/tests/mbedtls_self_tests.rs | 6 +- 3 files changed, 118 insertions(+), 156 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c6c42755..4274dc022 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,31 +6,29 @@ version = 3 name = "aho-corasick" version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ - "memchr 0.1.11", + "memchr", ] [[package]] name = "ansi_term" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003f95e0fb6cf3d1fee8c62b2ec35135509477989fab15c358e0efa3972bdef6" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "cexpr", - "clang-sys", - "docopt", - "env_logger", + "hermit-abi", "libc", - "log 0.3.9", - "rustc-serialize", - "syntex_syntax", + "winapi", ] [[package]] @@ -43,13 +41,30 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" name = "bindgen" version = "0.58.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" +checksum = "0f8523b410d7187a43085e7e064416ea32ded16bd0a4e6fc025e21616d01258f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] [[package]] name = "bit-vec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" +checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" [[package]] name = "bitflags" @@ -107,7 +122,7 @@ checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" name = "cexpr" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" dependencies = [ "nom", ] @@ -134,58 +149,64 @@ dependencies = [ "num-integer", "num-traits", "time", - "winapi 0.3.9", + "winapi", ] [[package]] name = "clang-sys" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19911f7964ce61a02d382adee8400f919d0fedd53c5441e3d6a9858ba73e249e" +checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" dependencies = [ - "bitflags 0.7.0", "glob", "libc", + "libloading", ] [[package]] name = "clap" version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "cc", + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", ] [[package]] name = "cmake" version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3b45b225c233ea8b95309256e842264692c68eeb543e06755de9072dd1178a" +checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" dependencies = [ - "rustc_version", + "cc", ] [[package]] name = "core_io" version = "0.1.20210325" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7ef30445607f6fc8720f0a0a2c7442284b629cf0d049286860fae23e71c4d9" +checksum = "97f8932064288cc79feb4d343a399d353a6f6f001e586ece47fe518a9e8507df" dependencies = [ - "lazy_static 0.2.11", - "regex", - "rustc-serialize", - "strsim", + "rustc_version", ] [[package]] name = "env_logger" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ - "log 0.3.9", + "atty", + "humantime", + "log", "regex", + "termcolor", ] [[package]] @@ -207,7 +228,16 @@ dependencies = [ name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] [[package]] name = "hex" @@ -219,23 +249,19 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" @@ -247,21 +273,22 @@ checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" name = "libloading" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", + "cfg-if 1.0.0", + "winapi", ] [[package]] name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ - "log 0.4.11", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] @@ -284,10 +311,11 @@ name = "mbedtls" version = "0.7.2" dependencies = [ "bit-vec", - "bitflags 1.2.1", + "bitflags", "block-modes", "byteorder", "cc", + "cfg-if 1.0.0", "chrono", "core_io", "hex", @@ -310,43 +338,35 @@ dependencies = [ [[package]] name = "mbedtls-sys-auto" -version = "2.25.2" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1210639c52c5dedbea06669e4d111ecfb9f26a0e09074dbe13a73bf1a6505e" +checksum = "b2231108271d9a10052178d940926baf24b57a2eb1703732faae387592dd6ac3" dependencies = [ "bindgen", + "cc", "cfg-if 1.0.0", "cmake", - "lazy_static 1.4.0", + "lazy_static", "libc", "libz-sys", -] - -[[package]] -name = "memchr" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" -dependencies = [ - "libc", + "quote", + "syn", ] [[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" -dependencies = [ - "libc", -] +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "nom" version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" dependencies = [ - "memchr 1.0.2", + "memchr", + "version_check", ] [[package]] @@ -385,6 +405,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "pin-project-lite" version = "0.2.6" @@ -425,7 +451,7 @@ dependencies = [ "libc", "rand_core 0.3.1", "rdrand", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -466,20 +492,18 @@ dependencies = [ name = "regex" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", - "memchr 0.1.11", + "memchr", "regex-syntax", - "thread_local", - "utf8-ranges", ] [[package]] name = "regex-syntax" version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "rs-libc" @@ -494,7 +518,7 @@ dependencies = [ name = "rustc-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" @@ -564,7 +588,7 @@ checksum = "ceac490aa12c567115b40b7b7fceca03a6c9d53d5defea066123debc83c5dc1f" name = "strsim" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "syn" @@ -581,19 +605,18 @@ dependencies = [ name = "termcolor" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ - "kernel32-sys", - "libc", + "winapi-util", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "thread-id", + "unicode-width", ] [[package]] @@ -604,18 +627,16 @@ checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", "wasi", - "winapi 0.3.9", + "winapi", ] [[package]] name = "tokio" -version = "1.26.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" dependencies = [ - "autocfg", "pin-project-lite", - "windows-sys", ] [[package]] @@ -628,7 +649,7 @@ checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" name = "unicode-width" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" @@ -640,7 +661,7 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" name = "vcpkg" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec_map" @@ -652,7 +673,7 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" @@ -664,7 +685,10 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" name = "which" version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +dependencies = [ + "libc", +] [[package]] name = "winapi" @@ -680,13 +704,16 @@ dependencies = [ name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] [[package]] name = "winapi-x86_64-pc-windows-gnu" @@ -694,72 +721,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" - [[package]] name = "yasna" version = "0.2.2" diff --git a/mbedtls/Cargo.toml b/mbedtls/Cargo.toml index fe9006ef2..d83b3f43e 100644 --- a/mbedtls/Cargo.toml +++ b/mbedtls/Cargo.toml @@ -30,7 +30,7 @@ num-bigint = { version = "0.2", optional = true } bit-vec = { version = "0.5", optional = true } block-modes = { version = "0.3", optional = true } rc2 = { version = "0.3", optional = true } -tokio = { version = "1.15", optional = true } +tokio = { version = "1.16.1", optional = true } proc-macro2 = "=1.0.24" quote = "=1.0.9" @@ -48,6 +48,7 @@ rand = "0.4.0" serde_cbor = "0.6" hex = "0.3" matches = "0.1.8" +cfg-if = "1.0.0" [build-dependencies] cc = "1.0" diff --git a/mbedtls/tests/mbedtls_self_tests.rs b/mbedtls/tests/mbedtls_self_tests.rs index 9c77fe873..dbac4e443 100644 --- a/mbedtls/tests/mbedtls_self_tests.rs +++ b/mbedtls/tests/mbedtls_self_tests.rs @@ -25,13 +25,13 @@ fn enable_self_test() { static START: Once = Once::new(); - let log_f; + let _log_f: Option; cfg_if::cfg_if! { if #[cfg(feature = "std")] { - log_f = None; + _log_f = None; } else { - log_f = Some(log as _); + _log_f = Some(log as _); } }