<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20:51 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CDRIVER-4414] Allow applications and wrapping drivers to detect crypt_shared availability</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4414</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Related to: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#detecting-crypt_shared-availability&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Detecting crypt_shared Availability&lt;/a&gt; in the CSFLE spec.&lt;/p&gt;

&lt;p&gt;Applications and drivers wrapping libmongoc don&apos;t have any way to determine if &lt;tt&gt;crypt_shared&lt;/tt&gt; is used, because &lt;tt&gt;mongocrypt_crypt_shared_lib_version_string&lt;/tt&gt; requires a &lt;tt&gt;mongocrypt_t *&lt;/tt&gt; resource, which is internal to libmongoc&apos;s private &lt;tt&gt;struct __mongoc_crypt_t&lt;/tt&gt; (typedef-ed as &lt;tt&gt;_mongoc_crypt_t&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;_mongoc_crypt_t&lt;/tt&gt; is created by &lt;tt&gt;_mongoc_crypt_new&lt;/tt&gt;, which is only called in three places within libmongoc:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Initializing &lt;tt&gt;topology-&amp;gt;crypt&lt;/tt&gt; member for single-threaded and pooled modes.&lt;/li&gt;
	&lt;li&gt;Creating &lt;tt&gt;mongoc_client_encryption_t&lt;/tt&gt;, which isn&apos;t relevant since &lt;tt&gt;crypt_shared&lt;/tt&gt; is never required there.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In a previous discussion with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=colby.pike%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;colby.pike@mongodb.com&quot;&gt;colby.pike@mongodb.com&lt;/a&gt; I asked if libmongoc or libmongocrypt had any safeguards in place to avoid loading multiple versions of &lt;tt&gt;crypt_shared&lt;/tt&gt;. His response was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;1: Correct, the version of crypt_shared is orthogonal to the version of libmongocrypt, since crypt_shared is loaded dynamically.&lt;br/&gt;
2: Applications cannot load more than one version of crypt_shared library simultaneously, even if they are of the same version (multiple uses of the same library is allowed, as long as it is the same file every time). There are some guards in check to prevent this as well, but they aren&apos;t fool-proof.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Ideally, it&apos;d be great if libmongoc or libmongocrypt could provide some global API (not tied to a client/pool) that allowed applications to query the &lt;tt&gt;crypt_shared&lt;/tt&gt; version. This would allow PHP to report its version the same way we do libmongoc and libmongocrypt itself. If that&apos;s not possible, providing some API to query the &lt;tt&gt;crypt_shared&lt;/tt&gt; version through a pool or client would be sufficient (although that could be more complicated as it would require exposing &lt;tt&gt;&lt;em&gt;mongoc_crypt_t&lt;/tt&gt; _and&lt;/em&gt; its &lt;tt&gt;mongocrypt_t *&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2075275">CDRIVER-4414</key>
            <summary>Allow applications and wrapping drivers to detect crypt_shared availability</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="colby.pike@mongodb.com">Colby Pike</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Jun 2022 15:58:19 +0000</created>
                <updated>Wed, 3 Aug 2022 22:25:05 +0000</updated>
                            <resolved>Wed, 3 Aug 2022 22:24:18 +0000</resolved>
                                    <version>1.22.0-beta0</version>
                                    <fixVersion>1.23.0</fixVersion>
                                    <component>libmongocrypt</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4643067" author="jmikola@gmail.com" created="Mon, 27 Jun 2022 19:48:25 +0000"  >&lt;p&gt;The API I was thinking of would likely need to be some global function that would be expected to return &lt;tt&gt;NULL&lt;/tt&gt; until the process happens to dynamically load the library. It looks like there&apos;s always some global state tracked in &lt;tt&gt;mongocrypt.c&lt;/tt&gt; around where &lt;tt&gt;_try_load_csfle&lt;/tt&gt; is called, so that&apos;s what I was expecting could be updated.&lt;/p&gt;

&lt;p&gt;If that&apos;s not feasible, then an API on &lt;tt&gt;mongoc_client_t&lt;/tt&gt; works.&lt;/p&gt;</comment>
                            <comment id="4643009" author="kevin.albertson" created="Mon, 27 Jun 2022 19:30:40 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Ideally, it&apos;d be great if libmongoc or libmongocrypt could provide some global API (not tied to a client/pool) that allowed applications or query the crypt_shared version.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I am not sure if that is possible. &lt;tt&gt;crypt_shared&lt;/tt&gt; is dynamically linked at runtime. It will not be linked until a &lt;tt&gt;mongoc_client_t&lt;/tt&gt; or &lt;tt&gt;mongoc_client_pool_t&lt;/tt&gt; is created with auto encryption options.&lt;/p&gt;

&lt;p&gt;I think it is OK to add an API on &lt;tt&gt;mongoc_client_t&lt;/tt&gt; or &lt;tt&gt;mongoc_client_pool_t&lt;/tt&gt;. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmikola%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jmikola@mongodb.com&quot;&gt;jmikola@mongodb.com&lt;/a&gt; would this API be sufficient?&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// Returns shared library version string. Returns NULL if not loaded or not found.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;const char* mongoc_client_crypt_shared_lib_version_string (mongoc_client_t* client);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// Returns shared library version string. Returns NULL if not loaded or not found.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;const char* mongoc_client_pool_crypt_shared_lib_version_string (mongoc_client_pool_t* pool);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2075282">PHPC-2103</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2106199">CDRIVER-4450</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0ilfs:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>