[MONGOCRYPT-373] Try to dynamically load csfle from mongocrypt_init in libmongocrypt Created: 27/Jan/22  Updated: 01/Jul/22  Resolved: 16/Feb/22

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

Type: New Feature Priority: Major - P3
Reporter: Kevin Albertson Assignee: Colby Pike
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to MONGOCRYPT-389 Build warning in mongocrypt_new due t... Closed
Epic Link: FLE 1.0 Shared Library
Binding Changes: Not Needed

 Description   

Background
See WRITING-9838.

Scope
Try to dynamically load csfle from mongocrypt_init in libmongocrypt.
If csfle is not found, fallback to existing behavior and try to use mongocryptd.
If csfle is found and the csfle major version is compatible, libmongocrypt must use csfle for CSFLE and must not require or use mongocryptd.
If csfle is found and the csfle major version is unsupported, mongocrypt_init must return an error.



 Comments   
Comment by Peter Woodman [ 01/Jul/22 ]

hey, i think this change had the effect of breaking the ability to static-compile libmongocrypt. is that something i can try to make a case for the utility of?

nevermind, jumped the gun here, sorry

Comment by Colby Pike [ 16/Feb/22 ]

The work to load the library and provide the APIs to drivers to specify search behavior has been done. This does not include the work to replace mongocryptd with the appropriate csfle calls, which will be tracked by another ticket.

Comment by Githook User [ 16/Feb/22 ]

Author:

{'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}

Message: MONGOCRYPT-373: APIs for loading a CSFLE library into libmongocrypt (#248)

  • Add API to append directories to a "CSE lib search paths" array
  • String, path, and DLL handling utilities
  • New once-init APIs, get current exe path, separate target for mlib components
  • Error-message getting code
  • Fix add_test() call for test-mongocrypt
  • Fix asan buffer overflow when setting stdout in log test
  • Loading of CSFLE dynamic library
  • Add an option for overriding the search behavior completely
  • Ignore _build
  • Rely on zero-init, as MSVC has trouble with compound static init
  • Allow $SYSTEM as a search path to use the system's default paths
  • Basic test cases for library loading
  • Forego closing the CSFLE library on Linux, since there seems to be trouble with static destructors
  • Generate a stub CSFLE library to use for testing.
  • DL links are transitive and required for static linking
    Branch: master
    https://github.com/mongodb/libmongocrypt/commit/bee26c6e0f16ddfead9699526cc99a092dd34a29
Generated at Thu Feb 08 09:08:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.