security(core,fido2,piv): fix sensitive data handling#447
Open
DennisDyallo wants to merge 1 commit intoyubikit-appletsfrom
Open
security(core,fido2,piv): fix sensitive data handling#447DennisDyallo wants to merge 1 commit intoyubikit-appletsfrom
DennisDyallo wants to merge 1 commit intoyubikit-appletsfrom
Conversation
…, and key operations Remove 38 Console.WriteLine statements from SCP implementation that unconditionally dumped session encryption keys (S-ENC, S-MAC, S-RMAC), cryptograms, MAC chains, and plaintext APDU data to stdout. Replace LogTrace plaintext hex dumps with length-only logging. Zero PIN bytes in FIDO2 ClientPin PadPin/ComputePinHash after use. Zero all intermediate buffers (pinHashEnc, newPinEnc, message, pinHash) in ClientPin async method finally blocks. Capture and zero .ToArray() key copies in PinUvAuthProtocol V1/V2 Encrypt/Decrypt and PivSession.Authentication DecryptBlock/EncryptBlock. Implement IDisposable on ScpState to zero MAC chain and dispose SessionKeys, with disposal chain through ScpProcessor and PcscProtocolScp. Reduce OTP HID protocol logger hex dumps to length-only metadata. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
Console.WriteLinestatements from SCP implementation that unconditionally dumped session encryption keys (S-ENC, S-MAC, S-RMAC), cryptograms, MAC chains, and plaintext APDU data to stdoutCryptographicOperations.ZeroMemory()Security Impact
Files Changed (10)
src/Core/src/SmartCard/Scp/ScpState.Scp03.cssrc/Core/src/SmartCard/Scp/ScpState.cssrc/Core/src/SmartCard/Scp/ScpProcessor.cssrc/Core/src/SmartCard/Scp/StaticKeys.cssrc/Core/src/SmartCard/Scp/PcscProtocolScp.cssrc/Fido2/src/Pin/ClientPin.cssrc/Fido2/src/Pin/PinUvAuthProtocolV1.cssrc/Fido2/src/Pin/PinUvAuthProtocolV2.cssrc/Piv/src/PivSession.Authentication.cssrc/Core/src/Hid/Otp/OtpHidProtocol.csTest plan
dotnet build.cs build— 0 errorsdotnet build.cs test— 9/9 unit test projects passingdotnet format --verify-no-changes— cleangrep -rn "Console.WriteLine" src/— 0 matches in production code🤖 Generated with Claude Code