diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab527c04..56094389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: [1.60.0, stable, nightly] + rust: [1.68.2, stable, nightly] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} @@ -24,7 +24,7 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - run: rustup component add clippy @@ -34,7 +34,7 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - run: rustup component add rustfmt @@ -44,7 +44,7 @@ jobs: name: Check dependencies for security issues runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - run: cargo install --locked --version "~0.17" cargo-audit @@ -56,7 +56,7 @@ jobs: outputs: license_changed: ${{ steps.license_diff.outputs.license_changed }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - run: cargo install --locked --version "~0.5" cargo-about diff --git a/.github/workflows/license_update.yml b/.github/workflows/license_update.yml index fb201d50..24e13816 100644 --- a/.github/workflows/license_update.yml +++ b/.github/workflows/license_update.yml @@ -18,7 +18,7 @@ jobs: steps: # Clone the repository and check if THIRD_PARTY_LICENSES_RUST_CRATES.html # is up-to-date. - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v4 with: persist-credentials: false - run: cargo install --locked --version "~0.5" cargo-about diff --git a/.github/workflows/summary.yml b/.github/workflows/summary.yml index 63b932ce..349ae10b 100644 --- a/.github/workflows/summary.yml +++ b/.github/workflows/summary.yml @@ -9,7 +9,7 @@ jobs: if: ${{ github.repository == "aws/aws-nitro-enclaves-cli" }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: create summary run: | # Get list of open PRs through GH CLI formatting by columns diff --git a/Cargo.lock b/Cargo.lock index bbc98702..7cfa268f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -909,9 +909,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.142" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -1025,14 +1025,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bca52966..44a5b38d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "1.2.3" authors = ["The AWS Nitro Enclaves Team "] edition = "2018" license = "Apache-2.0" -rust-version = "1.60" +rust-version = "1.68" [dependencies] serde = { version = ">=1.0", features = ["derive"] } diff --git a/README.md b/README.md index b7c17467..94396892 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![msrv] -[msrv]: https://img.shields.io/badge/MSRV-1.60.0-blue +[msrv]: https://img.shields.io/badge/MSRV-1.68.2-blue ## Nitro Enclaves Command Line Interface (Nitro CLI) diff --git a/SPECS/aws-nitro-enclaves-cli.spec b/SPECS/aws-nitro-enclaves-cli.spec index 7b4d1dad..cc3baab1 100644 --- a/SPECS/aws-nitro-enclaves-cli.spec +++ b/SPECS/aws-nitro-enclaves-cli.spec @@ -31,8 +31,8 @@ Source0: aws-nitro-enclaves-cli.tar.gz Source1: nitro-cli-dependencies.tar.gz BuildRequires: openssl-devel -BuildRequires: rust >= 1.60 -BuildRequires: cargo >= 1.60 +BuildRequires: rust >= 1.68 +BuildRequires: cargo >= 1.68 BuildRequires: make BuildRequires: llvm BuildRequires: clang diff --git a/driver-bindings/Cargo.toml b/driver-bindings/Cargo.toml index 76d301cd..f926bf06 100644 --- a/driver-bindings/Cargo.toml +++ b/driver-bindings/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" authors = ["The AWS Nitro Enclaves Team "] edition = "2018" description = "Rust FFI bindings to Linux Nitro Enclaves driver generated using bindgen." -rust-version = "1.60" +rust-version = "1.68" diff --git a/eif_loader/Cargo.toml b/eif_loader/Cargo.toml index a2394a62..d4cde96d 100644 --- a/eif_loader/Cargo.toml +++ b/eif_loader/Cargo.toml @@ -3,7 +3,7 @@ name = "eif_loader" version = "0.1.0" authors = ["The AWS Nitro Enclaves Team "] edition = "2018" -rust-version = "1.60" +rust-version = "1.68" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/enclave_build/Cargo.toml b/enclave_build/Cargo.toml index f2cb830a..9ed9bb5c 100644 --- a/enclave_build/Cargo.toml +++ b/enclave_build/Cargo.toml @@ -3,7 +3,7 @@ name = "enclave_build" version = "0.1.0" authors = ["The AWS Nitro Enclaves Team "] edition = "2018" -rust-version = "1.60" +rust-version = "1.68" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/samples/command_executer/Cargo.toml b/samples/command_executer/Cargo.toml index f98ebb5e..86617baf 100644 --- a/samples/command_executer/Cargo.toml +++ b/samples/command_executer/Cargo.toml @@ -3,7 +3,7 @@ name = "command-executer" version = "0.1.0" authors = ["The AWS Nitro Enclaves Team "] edition = "2018" -rust-version = "1.60" +rust-version = "1.68" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/common/mod.rs b/src/common/mod.rs index fafc37d2..e50099ac 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -56,8 +56,9 @@ const SOCKETS_DIR_PATH: &str = "/run/nitro_enclaves"; const BACKTRACE_VAR: &str = "BACKTRACE"; /// All possible errors which may occur. -#[derive(Debug, Clone, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Clone, Copy, Hash, PartialEq)] pub enum NitroCliErrorEnum { + #[default] /// Unspecified error (should avoid using it thoughout the code). UnspecifiedError = 0, /// Error for handling missing arguments. @@ -180,12 +181,6 @@ pub enum NitroCliErrorEnum { EIFSignatureCheckerError, } -impl Default for NitroCliErrorEnum { - fn default() -> NitroCliErrorEnum { - NitroCliErrorEnum::UnspecifiedError - } -} - impl Eq for NitroCliErrorEnum {} /// The type of commands that can be sent to an enclave process. diff --git a/src/enclave_proc/connection.rs b/src/enclave_proc/connection.rs index 47fa2ca8..458ae1b7 100644 --- a/src/enclave_proc/connection.rs +++ b/src/enclave_proc/connection.rs @@ -12,7 +12,6 @@ use std::collections::HashMap; use std::io::Write; use std::os::unix::io::AsRawFd; use std::os::unix::net::UnixStream; -use std::string::ToString; use std::sync::{Arc, Mutex}; use crate::common::{receive_from_stream, write_u64_le}; diff --git a/src/enclave_proc/resource_manager.rs b/src/enclave_proc/resource_manager.rs index 600061ce..294c88f2 100644 --- a/src/enclave_proc/resource_manager.rs +++ b/src/enclave_proc/resource_manager.rs @@ -11,7 +11,6 @@ use eif_loader::{enclave_ready, TIMEOUT_MINUTE_MS}; use libc::c_int; use log::{debug, info}; use std::collections::BTreeMap; -use std::convert::{From, Into}; use std::fs::{File, OpenOptions}; use std::io::prelude::*; use std::io::Error; @@ -109,8 +108,9 @@ pub struct MemoryRegion { } /// The state an enclave may be in. -#[derive(Clone)] +#[derive(Clone, Default)] pub enum EnclaveState { + #[default] /// The enclave is not running (it's either not started or has been terminated). Empty, /// The enclave is running. @@ -180,12 +180,6 @@ impl ToString for EnclaveState { } } -impl Default for EnclaveState { - fn default() -> Self { - EnclaveState::Empty - } -} - impl Default for EnclaveBuildInfo { fn default() -> Self { EnclaveBuildInfo::new(BTreeMap::new()) diff --git a/tools/Dockerfile b/tools/Dockerfile index 01498fb3..344f2a8c 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -30,7 +30,7 @@ RUN cd /tmp/openssl_src/openssl-${OPENSSL_VERSION} && \ make install_sw # Setup the right rust ver -ENV RUST_VERSION=1.60.0 +ENV RUST_VERSION=1.68.2 RUN source $HOME/.cargo/env && \ ARCH=$(uname -m) && \ rustup toolchain install ${RUST_VERSION}-${ARCH}-unknown-linux-gnu && \ diff --git a/vsock_proxy/Cargo.toml b/vsock_proxy/Cargo.toml index e180b09c..4a59bbe2 100644 --- a/vsock_proxy/Cargo.toml +++ b/vsock_proxy/Cargo.toml @@ -3,7 +3,7 @@ name = "vsock-proxy" version = "0.1.0" authors = ["The AWS Nitro Enclaves Team "] edition = "2018" -rust-version = "1.60" +rust-version = "1.68" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html