Skip to content
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

Fix authentication for Azure API in xbcloud #1611

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

imrivera
Copy link

@imrivera imrivera commented Sep 17, 2024

There was a problem when an Azure key contained a null byte, the result when decoding base64 was trimmed and part of the key was lost.

Also if the decoded binary key started or ended with white space, some bytes would be discarded.

This PR fixes both problems

@@ -558,15 +558,15 @@ TEST(azure_signer, basicDNS) {
req.append_payload("test", 4);
Azure_signer signer(
"my-storage-account",
"zUfvsKXc6+2RMJCwvnElnG/"
"Kk7wxQ8V4TPXIuZ53qFwJNtpLUEjYdBe9iGTkMgwUGFHVfFgn2qkgoqDP/b3OAg==",
"zUfvsKXcAO2RMJCwvnElnG/"
Copy link
Author

Choose a reason for hiding this comment

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

Now this key contains a NULL byte when decoded, and it ends in \r to check that the request signing is correctly done

@imrivera imrivera force-pushed the fix_azure_key_signing_in_xbcloud branch from d2f7dc8 to cd7678c Compare September 17, 2024 14:34
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.

1 participant