[codex] Handle invalid cached wrapping keys#155
Draft
SirAndrosBot wants to merge 1 commit into
Draft
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
InvalidProtectedKeyExceptionfor malformed cached wrapping-key material.Why
Issue #98 reports a long Windows Hello unlock followed by an abort. The maintainer noted that the screenshot error is thrown when
pbKey != 32.KeePassWinHello generates a 256-bit (32-byte) random wrapping password and protects it with Windows Hello. A valid cached entry created by this plugin must therefore decrypt to exactly 32 bytes. Any other length is corrupt, tampered, or foreign cached material; it must not be padded, truncated, or passed to the AES engine.
Previously the invalid length reached KeePass's AES validation and produced a low-level
ArgumentOutOfRangeExceptionforpbKey. The generic cleanup path removed the cache entry, but the user saw a confusing internal error. The new path validates earlier, reports the actual recovery action, and keeps normal authentication available.Security behavior
finallypath.Refs #98
Validation
git diff --checkpassed with only Git LF-to-CRLF working-copy warnings.MSBuild.exe src\KeePassWinHello.csproj /t:Rebuild /p:Configuration=Release /p:DefineConstants=MONO /p:FrameworkPathOverride=C:\Windows\Microsoft.NET\Framework\v4.0.30319 /p:ReferencePath=C:\proj\KeePassWinHello\libpassed with 0 warnings and 0 errors.Manual test required