Skip to content

Commit

Permalink
#17 fixed salt length setting when set to auto in cng-pss flow
Browse files Browse the repository at this point in the history
  • Loading branch information
avivklas committed Sep 4, 2021
1 parent 260a1e7 commit f4fa051
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions certstore_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ func (wpk *winPrivateKey) cngSignHash(opts crypto.SignerOpts, digest []byte) ([]
saltLen := pssOpts.SaltLength
if saltLen == rsa.PSSSaltLengthEqualsHash {
saltLen = len(digest)
} else if saltLen == rsa.PSSSaltLengthAuto {
saltLen = hash.Size()
}
padPtr = unsafe.Pointer(&C.BCRYPT_PSS_PADDING_INFO{
pszAlgId: algId,
Expand Down

0 comments on commit f4fa051

Please sign in to comment.