diff --git a/.evergreen/MSRV-Cargo.toml.diff b/.evergreen/MSRV-Cargo.toml.diff index 08227d970..0cd2a3969 100644 --- a/.evergreen/MSRV-Cargo.toml.diff +++ b/.evergreen/MSRV-Cargo.toml.diff @@ -1,4 +1,6 @@ -168c168 +112a113 +> url = "=2.5.0" +167c168 < time = "0.3.9" --- > time = "=0.3.9" diff --git a/deny.toml b/deny.toml index c3f421d82..844706a46 100644 --- a/deny.toml +++ b/deny.toml @@ -77,6 +77,7 @@ allow = [ "BSD-3-Clause", "MPL-2.0", "Unicode-DFS-2016", + "Unicode-3.0", ] # List of explicitly disallowed licenses # See https://spdx.org/licenses/ for list of possible licenses diff --git a/src/action/csfle/encrypt.rs b/src/action/csfle/encrypt.rs index ed06457f4..601cacaa0 100644 --- a/src/action/csfle/encrypt.rs +++ b/src/action/csfle/encrypt.rs @@ -51,6 +51,7 @@ impl ClientEncryption { client_enc: self, mode: Expression { value: expression }, key: key.into(), + #[allow(deprecated)] algorithm: Algorithm::RangePreview, options: Some(EncryptOptions { query_type: Some("rangePreview".into()), diff --git a/src/client/csfle/client_encryption/encrypt.rs b/src/client/csfle/client_encryption/encrypt.rs index 2c4be2927..a9229ce2d 100644 --- a/src/client/csfle/client_encryption/encrypt.rs +++ b/src/client/csfle/client_encryption/encrypt.rs @@ -74,7 +74,7 @@ impl ClientEncryption { } if let Some(range_options) = &opts.range_options { let options_doc = bson::to_document(range_options)?; - builder = builder.range_options(options_doc)?; + builder = builder.algorithm_range(options_doc)?; } Ok(builder) } diff --git a/src/test/csfle.rs b/src/test/csfle.rs index 0111e7980..874201ca9 100644 --- a/src/test/csfle.rs +++ b/src/test/csfle.rs @@ -218,11 +218,7 @@ async fn custom_key_material() -> Result<()> { datakeys.insert_one(key_doc).await?; let encrypted = enc - .encrypt( - "test", - EncryptKey::Id(new_key_id), - Algorithm::AeadAes256CbcHmacSha512Deterministic, - ) + .encrypt("test", EncryptKey::Id(new_key_id), Algorithm::Deterministic) .await?; let expected = base64::decode( "AQAAAAAAAAAAAAAAAAAAAAACz0ZOLuuhEYi807ZXTdhbqhLaS2/t9wLifJnnNYwiw79d75QYIZ6M/\ @@ -370,7 +366,7 @@ async fn data_key_double_encryption() -> Result<()> { .encrypt( format!("hello {}", provider.name()), EncryptKey::Id(datakey_id), - Algorithm::AeadAes256CbcHmacSha512Deterministic, + Algorithm::Deterministic, ) .await?; assert_eq!(encrypted.subtype, BinarySubtype::Encrypted); @@ -390,7 +386,7 @@ async fn data_key_double_encryption() -> Result<()> { .encrypt( format!("hello {}", provider.name()), EncryptKey::AltName(format!("{}_altname", provider.name())), - Algorithm::AeadAes256CbcHmacSha512Deterministic, + Algorithm::Deterministic, ) .await?; assert_eq!(other_encrypted.subtype, BinarySubtype::Encrypted); @@ -491,7 +487,7 @@ async fn external_key_vault() -> Result<()> { .encrypt( "test", EncryptKey::Id(base64_uuid("LOCALAAAAAAAAAAAAAAAAA==")?), - Algorithm::AeadAes256CbcHmacSha512Deterministic, + Algorithm::Deterministic, ) .await; if with_external_key_vault { @@ -811,8 +807,8 @@ async fn run_corpus_test(local_schema: bool) -> Result<()> { return Err(failure!("Invalid method {:?}", method)); } let algo = match subdoc.get_str("algo")? { - "rand" => Algorithm::AeadAes256CbcHmacSha512Random, - "det" => Algorithm::AeadAes256CbcHmacSha512Deterministic, + "rand" => Algorithm::Random, + "det" => Algorithm::Deterministic, s => return Err(failure!("Invalid algorithm {:?}", s)), }; let kms = KmsProvider::from_name(subdoc.get_str("kms")?); @@ -973,7 +969,7 @@ async fn validate_roundtrip( .encrypt( value.clone(), EncryptKey::Id(key_id), - Algorithm::AeadAes256CbcHmacSha512Deterministic, + Algorithm::Deterministic, ) .await?; let decrypted = client_encryption.decrypt(encrypted.as_raw_binary()).await?; @@ -1543,7 +1539,7 @@ impl DeadlockTestCase { .encrypt( RawBson::String("string0".to_string()), EncryptKey::AltName("local".to_string()), - Algorithm::AeadAes256CbcHmacSha512Deterministic, + Algorithm::Deterministic, ) .await?; @@ -2551,11 +2547,7 @@ impl DecryptionEventsTestdata { )?; let key_id = client_encryption.create_data_key(MasterKey::Local).await?; let ciphertext = client_encryption - .encrypt( - "hello", - EncryptKey::Id(key_id), - Algorithm::AeadAes256CbcHmacSha512Deterministic, - ) + .encrypt("hello", EncryptKey::Id(key_id), Algorithm::Deterministic) .await?; let mut malformed_ciphertext = ciphertext.clone(); let last = malformed_ciphertext.bytes.last_mut().unwrap(); @@ -3125,6 +3117,7 @@ async fn range_explicit_encryption_test( .encrypt( bson_numbers[num].clone(), key1_id.clone(), + #[allow(deprecated)] Algorithm::RangePreview, ) .contention_factor(0) @@ -3144,6 +3137,7 @@ async fn range_explicit_encryption_test( .encrypt( bson_numbers[&6].clone(), key1_id.clone(), + #[allow(deprecated)] Algorithm::RangePreview, ) .contention_factor(0) @@ -3256,6 +3250,7 @@ async fn range_explicit_encryption_test( // Case 6: Encrypting a document greater than the maximum errors if bson_type != "DoubleNoPrecision" && bson_type != "DecimalNoPrecision" { let num = get_raw_bson_from_num(bson_type, 201); + #[allow(deprecated)] let error = client_encryption .encrypt(num, key1_id.clone(), Algorithm::RangePreview) .contention_factor(0) @@ -3272,6 +3267,7 @@ async fn range_explicit_encryption_test( } else { rawdoc! { &key: { "$numberInt": "6" } } }; + #[allow(deprecated)] let error = client_encryption .encrypt(value, key1_id.clone(), Algorithm::RangePreview) .contention_factor(0) @@ -3293,6 +3289,7 @@ async fn range_explicit_encryption_test( .encrypt( bson_numbers[&6].clone(), key1_id.clone(), + #[allow(deprecated)] Algorithm::RangePreview, ) .contention_factor(0)