[MONGOCRYPT-146] `ismaster` check in whitelist should be case insensitive Created: 05/Jun/19  Updated: 28/Oct/23  Resolved: 07/Jun/19

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Build libmongocrypt library

 Description   

For whatever reason the node driver sends ismaster instead of isMaster, which results in encryption failure with libmongocrypt

> db.runCommand({ ismaster: 1 })
{
    "ismaster" : true,
    "maxBsonObjectSize" : 16777216,
    "maxMessageSizeBytes" : 48000000,
    "maxWriteBatchSize" : 100000,
    "localTime" : ISODate("2019-06-05T00:27:09.649Z"),
    "logicalSessionTimeoutMinutes" : 30,
    "connectionId" : 132,
    "minWireVersion" : 0,
    "maxWireVersion" : 8,
    "readOnly" : false,
    "ok" : 1
}
> db.runCommand({ isMaster: 1 })
{
    "ismaster" : true,
    "maxBsonObjectSize" : 16777216,
    "maxMessageSizeBytes" : 48000000,
    "maxWriteBatchSize" : 100000,
    "localTime" : ISODate("2019-06-05T00:27:13.211Z"),
    "logicalSessionTimeoutMinutes" : 30,
    "connectionId" : 132,
    "minWireVersion" : 0,
    "maxWireVersion" : 8,
    "readOnly" : false,
    "ok" : 1
}

While we may make the change to use the camel case form in the driver, I would prefer not to make that change today. Can we change the check in libmongocrypt to use stricmp for this command?



 Comments   
Comment by Githook User [ 07/Jun/19 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3172 make ismaster check case insensitive
Branch: master
https://github.com/mongodb/libmongocrypt/commit/c81bd8fc4d789c68e84881e51d8cba101702be99

Comment by Matt Broadstone [ 05/Jun/19 ]

jeff.yemin has also pointed out that the SDAM docs use the lowercase form ismaster, so this is likely not specific to node.

Generated at Thu Feb 08 09:08:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.