Use new SecureRandom() to avoid blocking#18758
Use new SecureRandom() to avoid blocking#18758andrross merged 1 commit intoopensearch-project:mainfrom
new SecureRandom() to avoid blocking#18758Conversation
|
❌ Gradle check result for b8d73a6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for f51e9c8: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
This class was recently changed to use `SecureRandom.getInstanceStrong()` instead of `new SecureRandom()`. This results in a blocking call on certain systems if the entropy is exhausted. This commit reverts back to the previous implementation in the non-FIPS case to avoid problems with blocking. Signed-off-by: Andrew Ross <andrross@amazon.com>
|
❌ Gradle check result for 3f47eb3: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18758 +/- ##
============================================
+ Coverage 72.79% 72.85% +0.05%
- Complexity 68525 68529 +4
============================================
Files 5574 5563 -11
Lines 314807 314437 -370
Branches 45675 45627 -48
============================================
- Hits 229178 229071 -107
+ Misses 67046 66830 -216
+ Partials 18583 18536 -47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@beanuwave FYI, I think this change is a step back towards FIPS compliance (but addresses the issue with hanging service) |
peterzhuamazon
left a comment
There was a problem hiding this comment.
Hi @andrross thanks for this PR.
Assume we dont need to backport this to 2.19 (assume FIPS only merged in main).
Thanks.
@reta I honestly don't fully understand the compliance requirements, but in FIPS mode won't we hit this case? |
|
@peterzhuamazon Correct, no backport to 2.19 needed |
The fallback [1] is still using |
This class was recently changed to use `SecureRandom.getInstanceStrong()` instead of `new SecureRandom()`. This results in a blocking call on certain systems if the entropy is exhausted. This commit reverts back to the previous implementation in the non-FIPS case to avoid problems with blocking. Signed-off-by: Andrew Ross <andrross@amazon.com>
|
@andrross Thanks for fixing the issue quickly! |
|
@YeonghyeonKO This fix will be available in 3.2, scheduled to be released next month. |
@reta @cwperks @beanuwave What's the right thing to do here? Should that fallback also be doing |
This class was recently changed to use `SecureRandom.getInstanceStrong()` instead of `new SecureRandom()`. This results in a blocking call on certain systems if the entropy is exhausted. This commit reverts back to the previous implementation in the non-FIPS case to avoid problems with blocking. Signed-off-by: Andrew Ross <andrross@amazon.com>
|
The backport to To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-3.2 3.2
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-3.2
# Create a new branch
git switch --create backport/backport-18758-to-3.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 52b102e36d7dc3f309864e8e4d5e023375a93830
# Push it to GitHub
git push --set-upstream origin backport/backport-18758-to-3.2
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-3.2Then, create a pull request where the |
|
@cwperks This was merged 3 weeks ago, way before the 3.2 branch was created. Why did you add the backport label? |
I meant to add the v3.2.0 label >.< |
This class was recently changed to use
SecureRandom.getInstanceStrong()instead ofnew SecureRandom(). This results in a blocking call on certain systems if the entropy is exhausted. This commit reverts back to the previous implementation in the non-FIPS case to avoid problems with blocking.Related Issues
Resolves #18729
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.