Skip to content

Commit 56cc9c3

Browse files
authored
Merge pull request #262 from Vaisman/fix-unusedbit-panic
demo: fix UnusedBit panic on signing error
2 parents 07d7dac + a6888e8 commit 56cc9c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

demo/encode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func CreateCertificate(config *CAConfig, issuanceLog *MerkleTree, cosigners []*C
406406
}
407407
})
408408
if certConfig.UnusedBit {
409-
if sig, err := certSig.Bytes(); err == nil && len(sig) == 0 || sig[len(sig)-1]&1 != 0 {
409+
if sig, err := certSig.Bytes(); err == nil && (len(sig) == 0 || sig[len(sig)-1]&1 != 0) {
410410
certSig.SetError(errors.New("last bit in signature with not zero, unable to encode as unused"))
411411
return
412412
}

0 commit comments

Comments
 (0)