[GODRIVER-2352] Add ClientEncryption entity and Key Management API operations to Unified Test Format Created: 21/Mar/22  Updated: 27/Mar/23  Resolved: 24/Jun/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.10.0

Type: New Feature Priority: Unknown
Reporter: PM Bot Assignee: Preston Vasquez
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by GODRIVER-2261 Key Management API Closed
is duplicated by GODRIVER-2456 Reduce expected removeKeyAltName oper... Closed
is duplicated by GODRIVER-2470 Allow RewrapManyDataKeyResult.bulkWri... Closed
Issue split
split from DRIVERS-2017 Add ClientEncryption entity and Key M... Closed
Quarter: FY23Q2
Upstream Changes Summary:

DRIVERS-2017:


 Description   

This ticket was split from DRIVERS-2017, please see that ticket for a detailed description.



 Comments   
Comment by Githook User [ 24/Jun/22 ]

Author:

{'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}

Message: GODRIVER-2352 Key Management API (#975)

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>

Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/653b149f4ccecfaed5ca499bacd97386082c03a1

Comment by Ezra Chung [ 06/Jun/22 ]

preston.vasquez@mongodb.com Binary. See the Extended JSON specification regarding type wrapper objects such as $binary.

Again, the expected binary is being encoded in base64 form in both code and the spec tests. The BSON parser is expected to convert the base64 representation into its corresponding binary value during parsing before further analysis.

Comment by Preston Vasquez [ 03/Jun/22 ]

ezra.chung@mongodb.com Are you expecting the KeyMaterial option for creating a data key to be a binary or a base64 string? This has be confused.

Comment by Preston Vasquez [ 02/Jun/22 ]

ezra.chung@mongodb.com thank you!

Comment by Ezra Chung [ 02/Jun/22 ]

preston.vasquez@mongodb.com The custom key material is given in base64 form in the spec. However, the 128-byte base64 string itself is not the custom key material to submit to mongocrypt_ctx_setopt_key_material. The 128-byte base64 string must be decoded into the actual 96-byte custom key material (see lines 743-744). The 96-byte custom key material may be hard-coded if preferable (as done for other tests on line 101), but I believe it more convenient to decode the base64 string instead.

$ printf "xPTAjBRG5JiPm+d3fj6XLi2q5DMXUS/f1f+SMAlhhwkhDRL0kr8r9GDLIGTAGlvC+HVjSIgdL+RKwZCvpXSyxTICWSXTUYsWYPyu3IoHbuBZdmw2faM3WhcRIgbMReU5" | base64 -d | wc -c
96

Comment by Preston Vasquez [ 01/Jun/22 ]

ezra.chung@mongodb.com, I'm working on implementing the part of this ticket concerning key materials.  I'm reading through the C code you wrote and came across this prose test from the specifications.  The base64-encoded string is 128 bytes in length.  Could you explain how/point me to the code where we truncates this data to the 96 bytes required by mongocrypt_ctx_setopt_key_material?

Comment by Githook User [ 17/May/22 ]

Author:

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

Message: GODRIVER-2352 Add clientEncryption entity to unified test format (#920)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/cb28f46bbf4da093701392ad048195b7342b0f72

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