[MONGOCRYPT-21] libmongocrypt creates data keys in the future Created: 06/Aug/19  Updated: 28/Oct/23  Resolved: 06/Aug/19

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

Type: Bug Priority: Major - P3
Reporter: Shane Harvey Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-3448 CSFLE - garbled creationDate and upda... Closed
is related to PYTHON-1937 pymongocrypt add support for explicit... Closed

 Description   

Creating a data key document with mongocrypt_ctx_datakey_init returns a bson document where 'creationDate' and 'updateDate' are both set to the year 21043. Here's the raw bytes returned from libmongocrypt decoded with python:

>>> import bson
>>> bson.BSON(b'X\x01\x00\x00\x05_id\x00\x10\x00\x00\x00\x04\xddq\xb1h\xfb?O\t\x8e\x87\xb4\x12+\x8d\x84\xd7\x04keyAltNames\x00 \x00\x00\x00\x020\x00\x07\x00\x00\x00second\x00\x021\x00\x06\x00\x00\x00first\x00\x00\x05keyMaterial\x00\xa0\x00\x00\x00\x00<p\xfek\xf5\x81aEq}F|\xf4\xbd\rg\xe1\xf0\xe8\xc9\x92\xbb\xa4\xd0\xaa`T\xc2||zR\x84\x92\thS\xc6w\xcbM\xdd\x9f\xf8\x84\xb8\x83I\x8a\xd4\x165\xb5\xf0\xdc\x1cOP\xf1\x95}\x98\xb0?\xe5\xc3~V\x9f9\x14\xcc\xf3\x90\xbbYe\xe6\xf8\xc3\xd1\xb4\xb4\xc7\xb2)[\xd5EJT\x02\x04\xe8\n\xe2k\x8f\x19\x84\xd0Q\x9c\xf5p7\xa1\x9e\xbf\xf7h]\xa3\x02_\xf7\x91\x15\xde\xf8\x97\xb7q\x0e\xae=\xdc\x8a\xc2\xc6\xce2\x1cI\x0f\x86-\x88\xfdG*\xc1[%\x91\xf0\xd0\xf0\x90\x19I\xebI\xd6\x9c\ts)\xcd\x0f\tcreationDate\x00\xc8@\x07Mn#\x02\x00\tupdateDate\x00\xc8@\x07Mn#\x02\x00\x10status\x00\x00\x00\x00\x00\x03masterKey\x00\x19\x00\x00\x00\x02provider\x00\x06\x00\x00\x00local\x00\x00\x00').decode()
{u'status': 0, u'_id': UUID('dd71b168-fb3f-4f09-8e87-b4122b8d84d7'), u'masterKey': {u'provider': u'local'}, u'keyAltNames': [u'second', u'first'], u'updateDate': datetime.datetime(21043, 8, 30, 13, 31, 57), u'keyMaterial': Binary('<p\xfek\xf5\x81aEq}F|\xf4\xbd\rg\xe1\xf0\xe8\xc9\x92\xbb\xa4\xd0\xaa`T\xc2||zR\x84\x92\thS\xc6w\xcbM\xdd\x9f\xf8\x84\xb8\x83I\x8a\xd4\x165\xb5\xf0\xdc\x1cOP\xf1\x95}\x98\xb0?\xe5\xc3~V\x9f9\x14\xcc\xf3\x90\xbbYe\xe6\xf8\xc3\xd1\xb4\xb4\xc7\xb2)[\xd5EJT\x02\x04\xe8\n\xe2k\x8f\x19\x84\xd0Q\x9c\xf5p7\xa1\x9e\xbf\xf7h]\xa3\x02_\xf7\x91\x15\xde\xf8\x97\xb7q\x0e\xae=\xdc\x8a\xc2\xc6\xce2\x1cI\x0f\x86-\x88\xfdG*\xc1[%\x91\xf0\xd0\xf0\x90\x19I\xebI\xd6\x9c\ts)\xcd\x0f', 0), u'creationDate': datetime.datetime(21043, 8, 30, 13, 31, 57)}



 Comments   
Comment by Githook User [ 06/Aug/19 ]

Author:

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

Message: CDRIVER-3271 fix creationDate and updateDate
Branch: master
https://github.com/mongodb/libmongocrypt/commit/f9bde7222499314e561fabe8f21587ddbdbb169f

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