PBKDF2 one-shot#48107
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsThis is a draft for PBKDF2 one-shots (an API that is yet-to-be-approved). Opening as a draft to get some feedback from the CI system. Work left to be done:
Implementation notes:
|
|
Unrelated but exciting: All of the macOS work was done on a M1 Mac Mini without Rosetta (running as ARM64). Very cool to see dotnet/runtime in good shape for Apple Silicon. |
|
Hm. Trying to use the pseudo handles in Windows 7 actually crashes the process with an access violation, so we can't even get an NTSTATUS back saying it failed. Do we just do an OS version check? |
Reorder to keep alphabetic consistency. Add comment documentation. Tighten validation between password and salt inputs and their length. NULL input requires a zero length.
While here, use a stack allocation for small password inputs, which seems likely.
vcsjones
left a comment
There was a problem hiding this comment.
@bartonjs @GrabYourPitchforks I think this is at a point where it can be looked at in more scrutiny and might nearly resemble something complete, barring some self-review questions.
|
Apology in advance for changing the PR title and breaking email inbox threading. |
GrabYourPitchforks
left a comment
There was a problem hiding this comment.
Reviewed the Windows implementation and skimmed the non-Windows implementations. Generally LGTM. Some open questions about whether avoiding the allocation is worth it in the Windows case.
Checks that inputs are valid before doing any allocations.
Work left to be done:
BCryptKeyDerivationfor Windows 8+.Implementation notes:
PKCS5_PBKDF2_HMAC. This was a PEBCAK error while reading documentation. So no shimming required.Closes #24897