--TEST-- MongoDB\Driver\ClientEncryption::createDataKey() may leak "masterKey" option --SKIPIF-- createClientEncryption([ 'keyVaultNamespace' => CSFLE_KEY_VAULT_NS, 'kmsProviders' => ['local' => ['key' => new MongoDB\BSON\Binary(CSFLE_LOCAL_KEY, 0)]], ]); /* The "local" provider does not support a "masterKey" option, but this is * sufficient to grow the stack-allocated bson_t and test for a possible leak. */ throws(function () use ($clientEncryption) { $clientEncryption->createDataKey('local', ['masterKey' => ['foo' => str_repeat('a', 4096)]]); }, MongoDB\Driver\Exception\EncryptionException::class); ?> ===DONE=== --EXPECT-- OK: Got MongoDB\Driver\Exception\EncryptionException ===DONE===