diff --git a/Cargo.lock b/Cargo.lock index 5aa8d633..36f65d60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.13.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -17,6 +17,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aesm-client" version = "0.5.4" @@ -33,7 +39,7 @@ dependencies = [ "sgxs", "sgxs-loaders", "unix_socket2", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -51,7 +57,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -80,7 +86,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -143,14 +149,15 @@ checksum = "ac1e8deebfdca687fcef6fe024fc92cf8183f203075ce4fda263ae6ea13a8dc3" [[package]] name = "backtrace" -version = "0.3.53" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", + "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.7.2", "object", "rustc-demangle", ] @@ -201,8 +208,8 @@ dependencies = [ "lazycell", "log 0.4.14", "peeking_take_while", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "regex", "rustc-hash", "shlex", @@ -322,9 +329,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.61" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" +checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" [[package]] name = "cexpr" @@ -358,7 +365,7 @@ dependencies = [ "num-traits", "serde", "time 0.1.44", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -551,7 +558,7 @@ dependencies = [ "commoncrypto", "hex 0.3.2", "openssl", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -572,8 +579,8 @@ checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "strsim 0.10.0", "syn 1.0.81", ] @@ -585,7 +592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", - "quote 1.0.10", + "quote 1.0.35", "syn 1.0.81", ] @@ -831,7 +838,7 @@ dependencies = [ "openssl", "sgx-isa", "sgxs", - "tokio 0.2.22", + "tokio", ] [[package]] @@ -851,7 +858,7 @@ dependencies = [ "sha2 0.9.8", "shiplift", "tempfile", - "tokio 1.14.0", + "tokio", "url 2.2.2", ] @@ -910,8 +917,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22deed3a8124cff5fa835713fa105621e43bbdc46690c3a6b68328a012d350d4" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "rustversion", "syn 1.0.81", "synstructure", @@ -933,8 +940,8 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", "synstructure", ] @@ -954,7 +961,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.2.10", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -972,7 +979,7 @@ dependencies = [ "cfg-if 0.1.10", "crc32fast", "libc", - "miniz_oxide", + "miniz_oxide 0.4.3", ] [[package]] @@ -1082,22 +1089,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" version = "0.1.30" @@ -1160,8 +1151,8 @@ checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" dependencies = [ "autocfg 1.0.1", "proc-macro-hack", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -1192,7 +1183,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1274,9 +1265,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.22.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -1298,7 +1289,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.14.0", + "tokio", "tokio-util", "tracing", ] @@ -1359,7 +1350,7 @@ checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes 1.1.0", "http", - "pin-project-lite 0.2.7", + "pin-project-lite", ] [[package]] @@ -1424,9 +1415,9 @@ dependencies = [ "httparse", "httpdate", "itoa 0.4.8", - "pin-project-lite 0.2.7", - "socket2", - "tokio 1.14.0", + "pin-project-lite", + "socket2 0.4.2", + "tokio", "tower-service", "tracing", "want", @@ -1444,8 +1435,8 @@ dependencies = [ "once_cell", "openssl", "openssl-sys", - "parking_lot", - "tokio 1.14.0", + "parking_lot 0.11.2", + "tokio", "tokio-openssl", "tower-layer", ] @@ -1459,7 +1450,7 @@ dependencies = [ "bytes 1.1.0", "hyper 0.14.15", "native-tls", - "tokio 1.14.0", + "tokio", "tokio-native-tls", ] @@ -1473,7 +1464,7 @@ dependencies = [ "hex 0.4.3", "hyper 0.14.15", "pin-project 1.0.8", - "tokio 1.14.0", + "tokio", ] [[package]] @@ -1501,7 +1492,7 @@ dependencies = [ "sgx_pkix", "sgxs", "sgxs-loaders", - "tokio 1.14.0", + "tokio", "url 2.2.2", ] @@ -1557,7 +1548,7 @@ dependencies = [ "futures-core", "inotify-sys", "libc", - "tokio 1.14.0", + "tokio", ] [[package]] @@ -1594,7 +1585,7 @@ dependencies = [ "fortanix-sgx-abi", "futures 0.3.17", "static_assertions", - "tokio 0.2.22", + "tokio", ] [[package]] @@ -1648,16 +1639,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "language-tags" version = "0.2.2" @@ -1678,8 +1659,8 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.138" -source = "git+https://github.com/fortanix/libc.git?branch=fortanixvme#c62c6451c40a47c8bd25a857450a4c2a249b38f4" +version = "0.2.152" +source = "git+https://github.com/fortanix/libc.git?branch=fortanixvme#b7a815ea60c182f9d4b326f610f68a26239c8030" dependencies = [ "rustc-std-workspace-core", ] @@ -1691,7 +1672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" dependencies = [ "cc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1701,7 +1682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1721,9 +1702,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] @@ -1794,15 +1775,15 @@ dependencies = [ "cmake", "lazy_static", "libc", - "quote 1.0.10", + "quote 1.0.35", "syn 1.0.81", ] [[package]] name = "memchr" -version = "2.3.3" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memoffset" @@ -1855,84 +1836,28 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ - "adler", + "adler 0.2.3", "autocfg 1.0.1", ] [[package]] -name = "mio" -version = "0.6.23" +name = "miniz_oxide" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log 0.4.14", - "miow 0.2.2", - "net2", - "slab", - "winapi 0.2.8", + "adler 1.0.2", ] [[package]] name = "mio" -version = "0.7.14" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log 0.4.14", - "miow 0.3.7", - "ntapi", - "winapi 0.3.9", -] - -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log 0.4.14", - "mio 0.6.23", - "miow 0.3.7", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.23", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi 0.3.9", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", ] [[package]] @@ -1965,17 +1890,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nitro-attestation-verify" version = "0.1.1" @@ -2127,15 +2041,6 @@ dependencies = [ "pkix", ] -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "num" version = "0.2.1" @@ -2199,8 +2104,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -2267,9 +2172,12 @@ dependencies = [ [[package]] name = "object" -version = "0.21.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" @@ -2339,7 +2247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2350,7 +2258,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.9", ] [[package]] @@ -2364,7 +2282,20 @@ dependencies = [ "libc", "redox_syscall 0.2.10", "smallvec", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.4.1", + "smallvec", + "windows-targets", ] [[package]] @@ -2467,8 +2398,8 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -2478,22 +2409,16 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] [[package]] name = "pin-project-lite" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e555d9e657502182ac97b539fb3dae8b79cda19e3e4f8ffb5e8de4f18df93c95" - -[[package]] -name = "pin-project-lite" -version = "0.2.7" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2544,8 +2469,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", "version_check 0.9.2", ] @@ -2556,8 +2481,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "version_check 0.9.2", ] @@ -2584,11 +2509,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ - "unicode-xid 0.2.1", + "unicode-ident", ] [[package]] @@ -2622,7 +2547,7 @@ version = "2.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6653d384a260fedff0a466e894e05c5b8d75e261a14e9f93e81e43ef86cad23" dependencies = [ - "log 0.3.9", + "log 0.4.14", "which 4.0.2", ] @@ -2655,11 +2580,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.10" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "proc-macro2 1.0.32", + "proc-macro2 1.0.78", ] [[package]] @@ -2672,7 +2597,7 @@ dependencies = [ "libc", "rand_core 0.3.1", "rdrand", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2691,7 +2616,7 @@ dependencies = [ "rand_os", "rand_pcg", "rand_xorshift", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2816,7 +2741,7 @@ checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ "libc", "rand_core 0.4.2", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2830,7 +2755,7 @@ dependencies = [ "libc", "rand_core 0.4.2", "rdrand", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2876,6 +2801,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" version = "1.4.1" @@ -2900,7 +2834,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2936,11 +2870,11 @@ dependencies = [ "mime 0.3.16", "native-tls", "percent-encoding 2.1.0", - "pin-project-lite 0.2.7", + "pin-project-lite", "serde", "serde_json", "serde_urlencoded", - "tokio 1.14.0", + "tokio", "tokio-native-tls", "url 2.2.2", "wasm-bindgen", @@ -3001,8 +2935,8 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9bdc5e856e51e685846fb6c13a1f5e5432946c2c90501bdc76a1319f19e29da" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3025,7 +2959,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3121,8 +3055,8 @@ name = "serde_derive" version = "1.0.130" source = "git+https://github.com/fortanix/serde.git?branch=master#80449547025fc4a016a333e96c0cdaf7e4a96f67" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3132,8 +3066,8 @@ version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3163,8 +3097,8 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3198,8 +3132,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48b35457e9d855d3dc05ef32a73e0df1e2c0fd72c38796a4ee909160c8eeec2" dependencies = [ "darling", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3264,7 +3198,7 @@ dependencies = [ "report-test", "sgx-isa", "sgxs", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3301,7 +3235,7 @@ dependencies = [ "sgxs", "sgxs-loaders", "syn 0.15.44", - "winapi 0.3.9", + "winapi", "yansi", ] @@ -3353,7 +3287,7 @@ dependencies = [ "serde", "serde_json", "tar", - "tokio 1.14.0", + "tokio", "url 2.2.2", ] @@ -3407,7 +3341,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", ] [[package]] @@ -3445,19 +3389,30 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "unicode-xid 0.2.1", ] +[[package]] +name = "syn" +version = "2.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", "unicode-xid 0.2.1", ] @@ -3494,7 +3449,7 @@ dependencies = [ "rand 0.7.3", "redox_syscall 0.1.57", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3530,8 +3485,8 @@ version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3552,7 +3507,7 @@ checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3593,43 +3548,21 @@ checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" [[package]] name = "tokio" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "libc", - "memchr", - "mio 0.6.23", - "mio-named-pipes", - "mio-uds", - "num_cpus", - "pin-project-lite 0.1.10", - "signal-hook-registry", - "slab", - "tokio-macros 0.2.5", - "winapi 0.3.9", -] - -[[package]] -name = "tokio" -version = "1.14.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ - "autocfg 1.0.1", + "backtrace", "bytes 1.1.0", "libc", - "memchr", - "mio 0.7.14", + "mio", "num_cpus", - "pin-project-lite 0.2.7", - "tokio-macros 1.7.0", - "winapi 0.3.9", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.5", + "tokio-macros", + "windows-sys", ] [[package]] @@ -3645,24 +3578,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" -dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", - "syn 1.0.81", -] - -[[package]] -name = "tokio-macros" -version = "1.7.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", - "syn 1.0.81", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.50", ] [[package]] @@ -3672,7 +3594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.14.0", + "tokio", ] [[package]] @@ -3684,7 +3606,7 @@ dependencies = [ "futures-util", "openssl", "openssl-sys", - "tokio 1.14.0", + "tokio", ] [[package]] @@ -3696,8 +3618,8 @@ dependencies = [ "bytes 1.1.0", "futures-core", "futures-sink", - "pin-project-lite 0.2.7", - "tokio 1.14.0", + "pin-project-lite", + "tokio", "tracing", ] @@ -3738,7 +3660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite 0.2.7", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -3749,8 +3671,8 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", ] @@ -3814,6 +3736,12 @@ dependencies = [ "matches", ] +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + [[package]] name = "unicode-normalization" version = "0.1.13" @@ -3993,6 +3921,12 @@ version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" version = "0.2.80" @@ -4012,8 +3946,8 @@ dependencies = [ "bumpalo", "lazy_static", "log 0.4.14", - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", "wasm-bindgen-shared", ] @@ -4036,7 +3970,7 @@ version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ - "quote 1.0.10", + "quote 1.0.35", "wasm-bindgen-macro-support", ] @@ -4046,8 +3980,8 @@ version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ - "proc-macro2 1.0.32", - "quote 1.0.10", + "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.81", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -4088,12 +4022,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -4104,12 +4032,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4122,7 +4044,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4132,22 +4054,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "winreg" -version = "0.10.1" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "winapi 0.3.9", + "windows-targets", ] [[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +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.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "winapi", ] [[package]] diff --git a/intel-sgx/enclave-runner/Cargo.toml b/intel-sgx/enclave-runner/Cargo.toml index 9b766772..1130a129 100644 --- a/intel-sgx/enclave-runner/Cargo.toml +++ b/intel-sgx/enclave-runner/Cargo.toml @@ -35,7 +35,7 @@ nix = "0.13.0" # MIT openssl = { version = "0.10", optional = true } # Apache-2.0 crossbeam = "0.8.2" # MIT/Apache-2.0 num_cpus = "1.10.0" # MIT/Apache-2.0 -tokio = { version = "0.2", features = ["full"] } # MIT +tokio = { version = "1.35", features = ["full"] } # MIT futures = { version = "0.3", features = ["compat", "io-compat"] } # MIT/Apache-2.0 [features] diff --git a/intel-sgx/enclave-runner/src/usercalls/interface.rs b/intel-sgx/enclave-runner/src/usercalls/interface.rs index c8731bcc..092d403d 100644 --- a/intel-sgx/enclave-runner/src/usercalls/interface.rs +++ b/intel-sgx/enclave-runner/src/usercalls/interface.rs @@ -13,6 +13,7 @@ use fortanix_sgx_abi::*; use super::abi::{UsercallResult, Usercalls}; use super::{EnclaveAbort, IOHandlerInput}; +use tokio::io::ReadBuf; use futures::FutureExt; use futures::future::Future; @@ -33,7 +34,11 @@ impl<'future, 'ioinput: 'future, 'tcs: 'ioinput> Usercalls<'future> for Handler< async move { unsafe { let ret = match from_raw_parts_mut_nonnull(buf, len) { - Ok(buf) => self.0.read(fd, buf).await, + Ok(buf) => { + let mut buf = ReadBuf::new(buf); + self.0.read(fd, &mut buf).await + .map(|_| buf.filled().len()) + }, Err(e) => Err(e), }; return (self, Ok(ret.to_sgx_result())); diff --git a/intel-sgx/enclave-runner/src/usercalls/mod.rs b/intel-sgx/enclave-runner/src/usercalls/mod.rs index ef8800c2..b9969c31 100644 --- a/intel-sgx/enclave-runner/src/usercalls/mod.rs +++ b/intel-sgx/enclave-runner/src/usercalls/mod.rs @@ -21,15 +21,15 @@ use failure::{self, bail}; use fnv::FnvHashMap; use futures::future::{poll_fn, Either, Future, FutureExt}; use futures::lock::Mutex; -use futures::StreamExt; use lazy_static::lazy_static; #[cfg(unix)] use libc::*; #[cfg(unix)] use nix::sys::signal; -use tokio::io::{AsyncRead, AsyncWrite}; -use tokio::stream::Stream as TokioStream; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; +use tokio::runtime::Builder as RuntimeBuilder; use tokio::sync::{broadcast, mpsc as async_mpsc, oneshot, Semaphore}; +use tokio::sync::broadcast::error::RecvError; use fortanix_sgx_abi::*; use ipc_queue::{self, DescriptorGuard, Identified, QueueEvent}; use ipc_queue::position::WritePosition; @@ -85,11 +85,11 @@ macro_rules! forward { } impl AsyncRead for ReadOnly { - forward!(fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll>); + forward!(fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context, buf: &mut ReadBuf) -> Poll>); } impl AsyncRead for WriteOnly { - fn poll_read(self: Pin<&mut Self>, _cx: &mut Context, _buf: &mut [u8]) -> Poll> { + fn poll_read(self: Pin<&mut Self>, _cx: &mut Context, _buf: &mut ReadBuf) -> Poll> { Poll::Ready(Err(IoErrorKind::BrokenPipe.into())) } } @@ -117,7 +117,7 @@ impl AsyncWrite for WriteOnly { struct Stdin; impl AsyncRead for Stdin { - fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll> { + fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut ReadBuf) -> Poll> { const BUF_SIZE: usize = 8192; trait AsIoResult { @@ -140,7 +140,7 @@ impl AsyncRead for Stdin { lazy_static::lazy_static! { static ref STDIN: Mutex = { - let (mut tx, rx) = async_mpsc::channel(8); + let (tx, rx) = async_mpsc::channel(8); thread::spawn(move || { let mut buf = [0u8; BUF_SIZE]; while let Ok(len) = io::stdin().read(&mut buf) { @@ -161,7 +161,7 @@ impl AsyncRead for Stdin { Poll::Ready(mut stdin) => { if stdin.buf.is_empty() { let pipeerr = tokio::io::Error::new(tokio::io::ErrorKind::BrokenPipe, "broken pipe"); - stdin.buf = match Pin::new(&mut stdin.rx).poll_next(cx) { + stdin.buf = match Pin::new(&mut stdin.rx).poll_recv(cx) { Poll::Ready(Some(vec)) => vec, Poll::Ready(None) => return Poll::Ready(Err(pipeerr)), _ => return Poll::Pending, @@ -171,10 +171,10 @@ impl AsyncRead for Stdin { (&[], inbuf) => inbuf, (inbuf, _) => inbuf, }; - let len = cmp::min(buf.len(), inbuf.len()); - buf[..len].copy_from_slice(&inbuf[..len]); + let len = cmp::min(buf.remaining(), inbuf.len()); + buf.put_slice(&inbuf[..len]); stdin.buf.drain(..len); - Poll::Ready(Ok(len)) + Poll::Ready(Ok(())) } Poll::Pending => Poll::Pending } @@ -185,9 +185,8 @@ pub trait AsyncStream: AsyncRead + AsyncWrite + 'static + Send + Sync { fn poll_read_alloc(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { let mut v: Vec = vec![0; 8192]; - self.poll_read(cx, v.as_mut_slice()).map(move |res| { - res.map(|size| { v.truncate(size); v }) - }) + let mut buffer = ReadBuf::new(&mut v); + self.poll_read(cx, &mut buffer).map(|b| b.map(|_| buffer.filled().to_vec())) } } @@ -239,15 +238,15 @@ impl AsyncStreamAdapter { } } - fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll> { + fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context, buf: &mut ReadBuf) -> Poll> { match self.stream.as_mut().poll_read(cx, buf) { Poll::Pending => { self.read_queue.push_back(cx.waker().clone()); Poll::Pending } - Poll::Ready(Ok(ret)) => { + Poll::Ready(Ok(())) => { notify_other_tasks(cx, &mut self.read_queue); - Poll::Ready(Ok(ret)) + Poll::Ready(Ok(())) } Poll::Ready(Err(e)) => Poll::Ready(Err(e)), } @@ -298,7 +297,7 @@ impl AsyncStreamContainer { } } - async fn async_read(&self, buf: &mut [u8]) -> IoResult { + async fn async_read(&self, buf: &mut ReadBuf<'_>) -> IoResult<()> { poll_fn(|cx| { let inner_ref = &mut self.inner.lock(); let mut inner = Pin::new(inner_ref); @@ -407,15 +406,13 @@ impl AsyncListenerContainer { impl AsyncListener for tokio::net::TcpListener { fn poll_accept( - mut self: Pin<&mut Self>, + self: Pin<&mut Self>, cx: &mut Context, local_addr: Option<&mut String>, peer_addr: Option<&mut String>, ) -> Poll>>> { - let mut incoming = self.incoming(); - let inner = Pin::new(&mut incoming); - match inner.poll_next(cx) { - Poll::Ready(Some(Ok(stream))) => { + match tokio::net::TcpListener::poll_accept(&self, cx) { + Poll::Ready(Ok((stream, _peer))) => { if let Some(local_addr) = local_addr { *local_addr = stream.local_addr().map(|addr| addr.to_string()).unwrap_or_else(|_err| "error".to_owned()); } @@ -424,8 +421,7 @@ impl AsyncListener for tokio::net::TcpListener { } Poll::Ready(Ok(Some(Box::new(stream)))) } - Poll::Ready(Some(Err(e))) => Poll::Ready(Err(e)), - Poll::Ready(None) => Poll::Ready(Ok(None)), + Poll::Ready(Err(e)) => Poll::Ready(Err(e)), Poll::Pending => Poll::Pending, } } @@ -579,7 +575,9 @@ impl PendingEvents { return EV_ABORT; } if ev != EV_ABORT { - permit.forget(); + if let Ok(permit) = permit { + permit.forget(); + } } ev } @@ -867,23 +865,20 @@ impl EnclaveState { fn syscall_loop( enclave: Arc, - io_queue_receive: tokio::sync::mpsc::UnboundedReceiver, + mut io_queue_receive: tokio::sync::mpsc::UnboundedReceiver, io_queue_send: tokio::sync::mpsc::UnboundedSender, work_sender: crossbeam::channel::Sender, ) -> EnclaveResult { let (tx_return_channel, mut rx_return_channel) = tokio::sync::mpsc::unbounded_channel(); let enclave_clone = enclave.clone(); - let mut rt = tokio::runtime::Builder::new() - .basic_scheduler() + let mut rt = RuntimeBuilder::new_current_thread() .enable_all() .build() .expect("failed to create tokio Runtime"); let local_set = tokio::task::LocalSet::new(); let return_future = async move { - while let (Some(work), stream) = rx_return_channel.into_future().await { - rx_return_channel = stream; - let (my_result, mode) = work; + while let Some((my_result, mode)) = rx_return_channel.recv().await { let res = match (my_result, mode) { (Err(EnclaveAbort::Secondary), _) | (Ok(_), ReturnSource::ExecutableNonMain) => continue, @@ -993,9 +988,7 @@ impl EnclaveState { } }); - let mut recv_queue = io_queue_receive.into_future(); - while let (Some(work), stream) = recv_queue.await { - recv_queue = stream.into_future(); + while let Some(work) = io_queue_receive.recv().await { let enclave_clone = enclave_clone.clone(); let tx_return_channel = tx_return_channel.clone(); match work { @@ -1148,8 +1141,7 @@ impl EnclaveState { Err(EnclaveAbort::IndefiniteWait) | Err(EnclaveAbort::Secondary) | Ok(_) => false, }; - let mut rt = tokio::runtime::Builder::new() - .basic_scheduler() + let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .build() .expect("failed to create tokio Runtime"); @@ -1420,7 +1412,7 @@ impl<'tcs> IOHandlerInput<'tcs> { } #[inline(always)] - async fn read(&self, fd: Fd, buf: &mut [u8]) -> IoResult { + async fn read(&self, fd: Fd, buf: &mut ReadBuf<'_>) -> IoResult<()> { let file_desc = self.lookup_fd(fd).await?; file_desc.as_stream()?.async_read(buf).await } @@ -1792,8 +1784,8 @@ impl ipc_queue::AsyncSynchronizer for QueueSynchronizer { async move { let mut subscription = self.subscription.lock().await; match subscription.recv().await { - Ok(()) | Err(broadcast::RecvError::Lagged(_)) => Ok(()), - Err(broadcast::RecvError::Closed) => Err(ipc_queue::SynchronizationError::ChannelClosed), + Ok(()) | Err(RecvError::Lagged(_)) => Ok(()), + Err(RecvError::Closed) => Err(ipc_queue::SynchronizationError::ChannelClosed), } }.boxed_local() } diff --git a/ipc-queue/Cargo.toml b/ipc-queue/Cargo.toml index 2a4d1cd7..84c03597 100644 --- a/ipc-queue/Cargo.toml +++ b/ipc-queue/Cargo.toml @@ -21,7 +21,7 @@ static_assertions = "1.1.0" [target.'cfg(not(target_env = "sgx"))'.dev-dependencies] futures = { version = "0.3", features = ["compat", "io-compat"] } -tokio = { version = "0.2", features = ["full"] } +tokio = { version = "1.35", features = ["full"] } [package.metadata.fortanix-sgx] # set number of threads so tests can run properly diff --git a/ipc-queue/src/interface_async.rs b/ipc-queue/src/interface_async.rs index 6b442c2b..2ff9495d 100644 --- a/ipc-queue/src/interface_async.rs +++ b/ipc-queue/src/interface_async.rs @@ -105,6 +105,7 @@ mod tests { use futures::future::FutureExt; use futures::lock::Mutex; use tokio::sync::broadcast; + use tokio::sync::broadcast::error::{SendError, RecvError}; use crate::*; use crate::test_support::TestValue; @@ -250,11 +251,11 @@ mod tests { } } - fn send(&self, val: T) -> Result<(), broadcast::SendError> { + fn send(&self, val: T) -> Result<(), SendError> { self.tx.send(val).map(|_| ()) } - async fn recv(&self) -> Result { + async fn recv(&self) -> Result { let mut rx = self.rx.lock().await; rx.recv().await }