From cb7a3f73d81a3cf36692871af4d004259785a321 Mon Sep 17 00:00:00 2001 From: Dan Aprahamian Date: Mon, 28 Oct 2019 17:55:19 -0400 Subject: [PATCH] fix(encryption): respect user bson options when using autoEncryption Fixes NODE-2278 --- lib/core/wireprotocol/command.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/wireprotocol/command.js b/lib/core/wireprotocol/command.js index f395b91b27..e6af5dabb9 100644 --- a/lib/core/wireprotocol/command.js +++ b/lib/core/wireprotocol/command.js @@ -162,7 +162,7 @@ function _cryptCommand(server, ns, cmd, options, callback) { return; } - autoEncrypter.decrypt(response.result, (err, decrypted) => { + autoEncrypter.decrypt(response.result, options, (err, decrypted) => { if (err) { callback(err, null); return; @@ -179,7 +179,7 @@ function _cryptCommand(server, ns, cmd, options, callback) { return; } - autoEncrypter.encrypt(ns, cmd, (err, encrypted) => { + autoEncrypter.encrypt(ns, cmd, options, (err, encrypted) => { if (err) { callback(err, null); return;