Skip to content

Commit 50478fa

Browse files
authored
CXX-2410 Add support for KMIP KMS provider (#894)
* Add support for setting TLS options for client encryption * Add support for setting TLS options for auto encryption * Make mongocxx::client_encryption moveable * Add KMIP provider and TLS options to basic CSE test helpers * Add test case sections to Prose Test 7 - Custom Endpoint Test * Update Prose Test 2 - Data Key and Double Encryption with KMIP * Update Prose Test 6 - Corpus Test with KMIP * Update Prose Test 7 - Custom Endpoint Test with KMIP * Add CSE Prose Test 11 - KMS TLS Options Tests * Add CAFile and tlsCertificateKeyFile env vars to Evergreen * Add !mayfail to KMS TLS Options Tests due to CDRIVER-4181 * Update client_encryption::create_data_key docs to include supported KMS providers * Update options::data_key docs to include KMIP * Add new MONGOCXX_TEST_* env vars to should_run_client_side_encryption_test * Add KMIP support for legacy runner in autoEncryptionOpts * Sync legacy CSE spec tests with 61b81891 * CXX-2155 Sync legacy CSE spec tests with 947be4cf * CXX-2410 Sync legacy CSE spec tests with 5964c134 * CXX-2488 Sync legacy CSE spec tests with 6a7158d5 * CXX-2487 Sync legacy CSE spec tests with 02b4275d * Divide CSE legacy test runner into sections by file and test description * Improve error message on unexpected exception
1 parent f1f3f50 commit 50478fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7397
-709
lines changed

.mci.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -406,29 +406,38 @@ functions:
406406
407407
export MONGODB_API_VERSION="${MONGODB_API_VERSION}"
408408
409+
pushd ../../
410+
cd drivers-evergreen-tools
411+
export DRIVERS_TOOLS=$(pwd)
412+
if [ "Windows_NT" == "$OS" ]; then
413+
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
414+
fi
415+
popd
416+
409417
if [ "$(uname -m)" == "ppc64le" ]; then
410418
echo "Skipping CSFLE test setup (CDRIVER-4246/CXX-2423)"
411419
else
412420
# export environment variables for encryption tests
413421
set +o errexit
422+
423+
if [ "Windows_NT" == "$OS"]; then
424+
export MONGOCXX_TEST_CSFLE_TLS_CA_FILE=$DRIVERS_TOOLS\.evergreen\x509gen\ca.pem
425+
export MONGOCXX_TEST_CSFLE_TLS_CERTIFICATE_KEY_FILE=$DRIVERS_TOOLS\.evergreen\x509gen\client.pem
426+
else
427+
export MONGOCXX_TEST_CSFLE_TLS_CA_FILE=$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem
428+
export MONGOCXX_TEST_CSFLE_TLS_CERTIFICATE_KEY_FILE=$DRIVERS_TOOLS/.evergreen/x509gen/client.pem
429+
fi
430+
414431
export MONGOCXX_TEST_AWS_SECRET_ACCESS_KEY="${cse_aws_secret_access_key}"
415432
export MONGOCXX_TEST_AWS_ACCESS_KEY_ID="${cse_aws_access_key_id}"
416433
export MONGOCXX_TEST_AZURE_TENANT_ID="${cse_azure_tenant_id}"
417434
export MONGOCXX_TEST_AZURE_CLIENT_ID="${cse_azure_client_id}"
418435
export MONGOCXX_TEST_AZURE_CLIENT_SECRET="${cse_azure_client_secret}"
419436
export MONGOCXX_TEST_GCP_EMAIL="${cse_gcp_email}"
420437
export MONGOCXX_TEST_GCP_PRIVATEKEY="${cse_gcp_privatekey}"
421-
422-
set -o errexit
423-
fi
424438
425-
pushd ../../
426-
cd drivers-evergreen-tools
427-
export DRIVERS_TOOLS=$(pwd)
428-
if [ "Windows_NT" == "$OS" ]; then
429-
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
439+
set -o errexit
430440
fi
431-
popd
432441
433442
if [ "$(uname -m)" == "ppc64le" ]; then
434443
echo "Skipping CSFLE test setup (CDRIVER-4246/CXX-2423)"

data/client_side_encryption/aggregate.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,6 @@
150150
"command_name": "listCollections"
151151
}
152152
},
153-
{
154-
"command_started_event": {
155-
"command": {
156-
"listCollections": 1,
157-
"filter": {
158-
"name": "datakeys"
159-
},
160-
"$db": "keyvault"
161-
},
162-
"command_name": "listCollections"
163-
}
164-
},
165153
{
166154
"command_started_event": {
167155
"command": {
@@ -273,18 +261,6 @@
273261
"command_name": "aggregate"
274262
}
275263
},
276-
{
277-
"command_started_event": {
278-
"command": {
279-
"listCollections": 1,
280-
"filter": {
281-
"name": "datakeys"
282-
},
283-
"$db": "keyvault"
284-
},
285-
"command_name": "listCollections"
286-
}
287-
},
288264
{
289265
"command_started_event": {
290266
"command": {

data/client_side_encryption/azureKMS.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@
6464
"bsonType": "string",
6565
"algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
6666
}
67+
},
68+
"encrypted_string_kmip": {
69+
"encrypt": {
70+
"keyId": [
71+
{
72+
"$binary": {
73+
"base64": "dBHpr8aITfeBQ15grpbLpQ==",
74+
"subType": "04"
75+
}
76+
}
77+
],
78+
"bsonType": "string",
79+
"algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
80+
}
6781
}
6882
},
6983
"bsonType": "object"
@@ -139,18 +153,6 @@
139153
"command_name": "listCollections"
140154
}
141155
},
142-
{
143-
"command_started_event": {
144-
"command": {
145-
"listCollections": 1,
146-
"filter": {
147-
"name": "datakeys"
148-
},
149-
"$db": "keyvault"
150-
},
151-
"command_name": "listCollections"
152-
}
153-
},
154156
{
155157
"command_started_event": {
156158
"command": {

0 commit comments

Comments
 (0)