[MONGOCRYPT-1] libmongocrypt is using the wrong encryption key for AEAD encryption with 96 byte keys Created: 19/Jun/19  Updated: 28/Oct/23  Resolved: 19/Jun/19

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

Type: Bug Priority: Critical - P2
Reporter: Mark Benvenuto Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Per https://tools.ietf.org/html/draft-mcgrew-aead-aes-cbc-hmac-sha2-05, the ENC_KEY is bytes [32..63] of the key. libmongocrypt is using the last 32 bytes of the key. This is incorrect.

Bug is here:
https://github.com/mongodb/libmongocrypt/blob/3596d57cfb0a8837b1338af15cfd7e7f9dcc838f/src/mongocrypt-crypto.c#L373

shreyas.kalyan



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

Author:

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

Message: CDRIVER-3199 fix key offset
Branch: master
https://github.com/mongodb/libmongocrypt/commit/b8e04511888e6a6ced74d434e3e0261d31093340

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