Repository navigation
client: Stop checking secret length - #580
Conversation
As that can lead to failures when the user has been using a short secret in gnome-keyring or other keyring formats. Enforcing a stronger password doesn't help anywhere at all.
📊 Code Coverage Report
Coverage report generated by cargo-tarpaulin |
|
Looking at this, doesn't it potentially inadvertently enforce more checks than before when importing from the legacy format? Previously we used In this patch we get rid of that function entirely. In legacy key import where we previously used it, we now use which means we're now applying the iteration count and salt size checks in |
It also doesn't make sense, because secrets are not necessarily passwords. E.g. one of my secrets is a low-security PIN that is only 4 characters. Still needs to work. I don't myself have any secrets shorter than that, but clearly some users do. |
|
We do have tests to cover this at https://github.com/linux-credentials/oo7/blob/main/server%2Fsrc%2Fservice%2Ftests.rs#L1213-L1312 I would have to double check but writing a test to confirm there is no regression should be pretty straightforward |
|
yes, we do actually have tests for all of this + c6c35e8 that ensures short keyring secrets are actually migrated just fine |
|
A test covers the specific scenario tested, though. That doesn't necessarily prove there is no scenario in which applying the additional checks where they were not applied before is a problem. That seems more like something for a person to think through carefully than something you can prove with a test suite. |
|
I am not sure what are you trying to say here. There are two things:
Hope this convinces you more than a test case. |
|
I don't know the details of the code flow at all, I don't know what v0 and v1 are or what migration between them are or when we're reading and when we're writing. I just noticed this PR applies checks on an operation that previously did not have them applied and wanted to verify that won't cause unexpected failures. |
|
It doesn't. |
|
To clarify, v0 is the file format used by gnome keyring for the host keyring. V1 is a format that was meant to replace v0 in gnome keyring but never happened and is only used by libsecret if the app is sandboxed. Oo7 uses v1 by default and offers auto migration from v0. |
As that can lead to failures when the user has been using a short secret in gnome-keyring or other keyring formats. Enforcing a stronger password doesn't help anywhere at all.
Fixes #542