Skip to content

CSHARP-6023: Update libmongocrypt URLs for 1.18.0+#2011

Merged
adelinowona merged 3 commits into
mongodb:mainfrom
adelinowona:csharp6023
May 27, 2026
Merged

CSHARP-6023: Update libmongocrypt URLs for 1.18.0+#2011
adelinowona merged 3 commits into
mongodb:mainfrom
adelinowona:csharp6023

Conversation

@adelinowona
Copy link
Copy Markdown
Contributor

@adelinowona adelinowona commented May 26, 2026

Summary

  • Updates libmongocrypt from 1.15.2 to 1.18.2
  • Switches all download URLs from S3 (mciuploads.s3.amazonaws.com) to GitHub releases (github.com/mongodb/libmongocrypt/releases)
  • Adds GPG signature verification of downloaded tarballs on Linux and macOS (skipped on Windows where gpg is not guaranteed to be available)
  • Updates purls.txt and sbom.json to reflect the new version

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the driver’s bundled libmongocrypt native binaries to version 1.18.2, changes the download source from S3 to GitHub Releases, and adds GPG signature verification during the build-time download/extract step.

Changes:

  • Bump libmongocrypt from 1.15.2 → 1.18.2 and switch download URLs to GitHub release assets.
  • Update native-binary download/extract MSBuild targets to use per-platform tarball names and add GPG verification on Linux/macOS.
  • Update purls.txt to reflect the new libmongocrypt version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/MongoDB.Driver.Encryption/MongoDB.Driver.Encryption.csproj Updates libmongocrypt version + download source; adds signature verification steps in the MSBuild download pipeline.
purls.txt Updates SBOM purl version for libmongocrypt to 1.18.2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +108 to +110
<DownloadFile SourceUrl="https://pgp.mongodb.com/libmongocrypt.pub" DestinationFolder="$(LibMongoCryptTmpPath)"/>
<Exec Command="gpg --batch --import $(LibMongoCryptTmpPath)/libmongocrypt.pub" Condition="!$([MSBuild]::IsOSPlatform('Windows'))" />
<Exec Command="gpg --batch --verify $(LibMongoCryptTmpPath)/$(LibMongoCryptAscFile) $(LibMongoCryptTmpPath)/$(LibMongoCryptTarball)" Condition="!$([MSBuild]::IsOSPlatform('Windows'))" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I investigated this but hit a hard limit: GPG derives its agent socket path from the homedir, and Unix sockets have a ~108-character path limit. Our libmongocryptTmpPath is long enough that the full socket path exceeds the limit, causing GPG to exit with code 2. The key being imported is the official public MongoDB signing key — importing it into the default keyring is idempotent and benign so I think we can afford to not do this.

Comment thread src/MongoDB.Driver.Encryption/MongoDB.Driver.Encryption.csproj Outdated
Comment thread src/MongoDB.Driver.Encryption/MongoDB.Driver.Encryption.csproj
@adelinowona adelinowona added the maintenance Non-code maintenance (deps, docs, configs, etc.). label May 26, 2026
@adelinowona adelinowona changed the title CSHARP-6023: Update libmongocrypt to 1.18.2 using GitHub release URLs CSHARP-6023: Update libmongocrypt URLs for 1.18.0+ May 26, 2026
Download libmongocrypt binaries from GitHub releases instead of S3,
and verify tarball signatures with GPG on non-Windows platforms.
Copy link
Copy Markdown
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please investigate test-csfle-with-azure-kms variant failure as well as failures on the latest/rapid variants, because I cannot see the same failure on the main branch (before the libmongocrypt bump).

Copy link
Copy Markdown
Contributor

@BorisDog BorisDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM.
Did you verify that the build fails when verification fails?

sanych-sun and others added 2 commits May 27, 2026 01:34
With libmongocrypt 1.17.0+, mixing CSFLE and QE in a $lookup no longer
errors client-side. The server now rejects it with a different message.
@adelinowona adelinowona requested a review from sanych-sun May 27, 2026 15:35
Copy link
Copy Markdown
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adelinowona adelinowona merged commit 7f8777c into mongodb:main May 27, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Non-code maintenance (deps, docs, configs, etc.).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants