diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2022-05-16 10:22:33 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-17 02:35:37 +0000 |
commit | ad2271e4c9dfeffd8a11b04a23da361483d695fb (patch) | |
tree | a326e656d1c11b9fe885673203966f2de6c0bf06 /src/mongo/crypto | |
parent | 13ec926abfad8452f9e44196d5592577d245032e (diff) | |
download | mongo-ad2271e4c9dfeffd8a11b04a23da361483d695fb.tar.gz |
SERVER-66120 Use consistent way to refer to FLE 2 encryption in user-facing messages
Diffstat (limited to 'src/mongo/crypto')
-rw-r--r-- | src/mongo/crypto/encryption_fields.idl | 2 | ||||
-rw-r--r-- | src/mongo/crypto/fle_crypto.cpp | 30 | ||||
-rw-r--r-- | src/mongo/crypto/fle_field_schema.idl | 8 |
3 files changed, 23 insertions, 17 deletions
diff --git a/src/mongo/crypto/encryption_fields.idl b/src/mongo/crypto/encryption_fields.idl index 1a1090ab59d..fc8b243c908 100644 --- a/src/mongo/crypto/encryption_fields.idl +++ b/src/mongo/crypto/encryption_fields.idl @@ -40,7 +40,7 @@ enums: feature_flags: featureFlagFLE2: - description: "Enable FLE2 support" + description: "Enable Queryable Encryption support" cpp_varname: gFeatureFlagFLE2 default: true version: 6.0 diff --git a/src/mongo/crypto/fle_crypto.cpp b/src/mongo/crypto/fle_crypto.cpp index e870634cb48..38800792351 100644 --- a/src/mongo/crypto/fle_crypto.cpp +++ b/src/mongo/crypto/fle_crypto.cpp @@ -903,7 +903,7 @@ void convertToFLE2Payload(FLEKeyVault* keyVault, if (ep.getAlgorithm() == Fle2AlgorithmInt::kEquality) { uassert(6338602, str::stream() << "Type '" << typeName(el.type()) - << "' is not a valid type for FLE 2 encryption", + << "' is not a valid type for Queryable Encryption", isFLE2EqualityIndexedSupportedType(el.type())); if (ep.getType() == Fle2PlaceholderType::kInsert) { @@ -923,19 +923,21 @@ void convertToFLE2Payload(FLEKeyVault* keyVault, findpayload, builder); } else { - uasserted(6410100, "No other FLE2 placeholders supported at this time."); + uasserted(6410100, + "No other Queryable Encryption placeholders supported at this time."); } } else if (ep.getAlgorithm() == Fle2AlgorithmInt::kUnindexed) { uassert(6379102, str::stream() << "Type '" << typeName(el.type()) - << "' is not a valid type for FLE 2 encryption", + << "' is not a valid type for Queryable Encryption", isFLE2UnindexedSupportedType(el.type())); auto payload = FLE2UnindexedEncryptedValue::serialize(userKey, el); builder->appendBinData( fieldNameToSerialize, payload.size(), BinDataType::Encrypt, payload.data()); } else { - uasserted(6338603, "Only FLE 2 style encryption placeholders are supported"); + uasserted(6338603, + "Only Queryable Encryption style encryption placeholders are supported"); } @@ -954,7 +956,7 @@ void parseAndVerifyInsertUpdatePayload(std::vector<EDCServerPayloadInfo>* pField uassert(6373504, str::stream() << "Type '" << typeName(static_cast<BSONType>(iupayload.getType())) - << "' is not a valid type for FLE 2 encryption", + << "' is not a valid type for Queryable Encryption", isValidBSONType(iupayload.getType()) && isFLE2EqualityIndexedSupportedType(static_cast<BSONType>(iupayload.getType()))); @@ -1023,7 +1025,7 @@ void convertServerPayload(ConstDataRange cdr, uassert(6373506, str::stream() << "Type '" << typeName(sp.bsonType) - << "' is not a valid type for FLE 2 encryption", + << "' is not a valid type for Queryable Encryption", isFLE2EqualityIndexedSupportedType(sp.bsonType)); auto swEncrypted = @@ -1450,8 +1452,8 @@ void FLEClientCrypto::validateDocument(const BSONObj& doc, BSONElement safeContent = doc[kSafeContent]; - // If there are no tags and no safeContent, then this document is not FLE 2 and is therefore - // fine + // If there are no tags and no safeContent, then this document is not Queryable Encryption and + // is therefore fine if (tags.size() == 0 && safeContent.eoo()) { return; } @@ -1807,7 +1809,7 @@ FLE2IndexedEqualityEncryptedValue::FLE2IndexedEqualityEncryptedValue( indexKeyId(payload.getIndexKeyId()), clientEncryptedValue(vectorFromCDR(payload.getValue())) { uassert(6373508, - "Invalid BSON Type in FLE2InsertUpdatePayload", + "Invalid BSON Type in Queryable Encryption InsertUpdatePayload", isValidBSONType(payload.getType())); } @@ -1856,7 +1858,7 @@ StatusWith<FLE2IndexedEqualityEncryptedValue> FLE2IndexedEqualityEncryptedValue: } uassert(6373509, - "Invalid BSON Type in FLE2InsertUpdatePayload", + "Invalid BSON Type in Queryable Encryption InsertUpdatePayload", isValidBSONType(swBsonType.getValue())); auto type = static_cast<BSONType>(swBsonType.getValue()); @@ -1964,7 +1966,9 @@ StatusWith<std::vector<uint8_t>> FLE2IndexedEqualityEncryptedValue::serialize( std::vector<uint8_t> FLE2UnindexedEncryptedValue::serialize(const FLEUserKeyAndId& userKey, const BSONElement& element) { BSONType bsonType = element.type(); - uassert(6379107, "Invalid BSON data type", isFLE2UnindexedSupportedType(bsonType)); + uassert(6379107, + "Invalid BSON data type for Queryable Encryption", + isFLE2UnindexedSupportedType(bsonType)); auto value = ConstDataRange(element.value(), element.value() + element.valuesize()); auto cdrKeyId = userKey.keyId.toCDR(); @@ -2000,7 +2004,9 @@ std::pair<BSONType, std::vector<uint8_t>> FLE2UnindexedEncryptedValue::deseriali auto userKey = keyVault->getUserKeyById(keyId); BSONType bsonType = static_cast<BSONType>(adc.read<uint8_t>()); - uassert(6379111, "Invalid BSON data type", isFLE2UnindexedSupportedType(bsonType)); + uassert(6379111, + "Invalid BSON data type for Queryable Encryption", + isFLE2UnindexedSupportedType(bsonType)); auto data = uassertStatusOK( decryptDataWithAssociatedData(userKey.key.toCDR(), assocDataCdr, cipherTextCdr)); diff --git a/src/mongo/crypto/fle_field_schema.idl b/src/mongo/crypto/fle_field_schema.idl index a1d3ef5394a..f1184621c85 100644 --- a/src/mongo/crypto/fle_field_schema.idl +++ b/src/mongo/crypto/fle_field_schema.idl @@ -134,7 +134,7 @@ structs: type: IDLAnyType cpp_name: value cm: - description: "FLE2 max contention counter" + description: "Queryable Encryption max contention counter" type: long cpp_name: maxContentionCounter @@ -205,13 +205,13 @@ structs: type: bindata_generic cpp_name: eccDerivedToken cm: - description: "FLE2 max counter" + description: "Queryable Encryption max counter" type: long cpp_name: maxCounter optional: true EncryptionInformation: - description: "Implements Encryption Information which includes the schema for FLE 2 that is consumed by query_analysis, queries and write_ops" + description: "Implements Encryption Information which includes the schema for Queryable Encryption that is consumed by query_analysis, queries and write_ops" strict: true fields: type: @@ -229,7 +229,7 @@ structs: type: object_owned unstable: true crudProcessed: - description: "A boolean to indicate whether the CRUD layer has already processed this FLE2 request. Used to prevent infinite recursion." + description: "A boolean to indicate whether the CRUD layer has already processed this Queryable Encryption request. Used to prevent infinite recursion." type: bool optional: true unstable: true |