Skip to content

CDRIVER-4694 calculate payload length for kms_request_append_payload() #1346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jul 18, 2023

https://jira.mongodb.org/browse/CDRIVER-4694

This fixes an assert failure during MONGODB-AWS auth when an application is bundled with both libmongoc and libmongocrypt, and libmongocrypt's KMS library is used.


Note: this is pending test with the PHP driver. I'll follow up once I confirm it resolves the issue.

This fixes an assert failure during MONGODB-AWS auth when an application is bundled with both libmongoc and libmongocrypt, and libmongocrypt's KMS library is used.
@jmikola jmikola requested a review from kevinAlbs July 18, 2023 13:23
@@ -1242,7 +1242,7 @@ _client_second (mongoc_cluster_t *cluster,
AUTH_ERROR_AND_FAIL ("Failed to parse server nonce");
}

if (!kms_request_append_payload (request, body, -1)) {
if (!kms_request_append_payload (request, body, strlen(body))) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@kevinAlbs: I can confirm that this avoids the assertion failure in PHPC. Authentication still fails for other reasons, which I'm investigating, but we do make it beyond this point.

@jmikola jmikola marked this pull request as ready for review July 18, 2023 18:33
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Thank you.

@kevinAlbs kevinAlbs merged commit 797b371 into master Jul 18, 2023
kevinAlbs pushed a commit that referenced this pull request Jul 18, 2023
#1346)

This fixes an assert failure during MONGODB-AWS auth when an application is bundled with both libmongoc and libmongocrypt, and libmongocrypt's KMS library is used.
@jmikola jmikola deleted the cdriver-4694 branch July 19, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants