Consistent errors for KeyStoreWrapper decryption with any security provider #57132
Labels
:Core/Infra/Settings
Settings infrastructure and APIs
>enhancement
help wanted
adoptme
:Security/Security
Security issues without another label
Team:Core/Infra
Meta label for core/infra team
Team:Security
Meta label for security team
As identified in #57050 (comment) , when using the BouncyCastle FIPS security provider, the decryption with a wrong password fails in non predictable ways. Sometimes the
CipherInputStream
doesn't throw anAEADBadTagException
as expected butreadFully
fails to read the stream fully and thus we fail because of these unconsumed stream contents:elasticsearch/server/src/main/java/org/elasticsearch/common/settings/KeyStoreWrapper.java
Line 379 in c117c0c
We should look at a) why this happens and b) figure out if there is a way to consistently catch Exceptions caused by invalid passwords for any security provider so that we can throw a relevant and useful error message for the users.
The text was updated successfully, but these errors were encountered: