Skip to content

Fix NPE in ThreadSafeHMAC when secret is not set #964

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
Sep 9, 2015

Conversation

bomgar
Copy link
Contributor

@bomgar bomgar commented Sep 8, 2015

apparently the '&' is important even if no secret is present

@slandelle
Copy link
Contributor

Sorry, but what does this fix exactly? Could you provide a test case that fails without it?

apparently the '&' is important even if no secret is present
@bomgar
Copy link
Contributor Author

bomgar commented Sep 9, 2015

Test added.
The OAuthSignatureCalculator already handles it correctly if the user key is null. But the secret causes a NPE in the ThreadSafeHMAC.

@slandelle
Copy link
Contributor

Isn't the secret mandatory?

@bomgar
Copy link
Contributor Author

bomgar commented Sep 9, 2015

The user key and secret are not necessary. It is possible to authenticate a consumer only.

@slandelle slandelle changed the title Fix NPE Fix NPE in ThreadSafeHMAC when secret is not set Sep 9, 2015
slandelle added a commit that referenced this pull request Sep 9, 2015
Fix NPE in ThreadSafeHMAC when secret is not set
@slandelle slandelle merged commit 6ca14a1 into AsyncHttpClient:master Sep 9, 2015
@slandelle slandelle added this to the 2.0.0 milestone Sep 9, 2015
@slandelle
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants