keybase / go-crypto

[mirror] Go supplementary cryptography libraries
https://godoc.org/golang.org/x/crypto
BSD 3-Clause "New" or "Revised" License
50 stars 20 forks source link

Handle invalid sig flags for ECDSA and EdDSA #43

Closed zapu closed 7 years ago

zapu commented 7 years ago

the question is, where and how do we not write valid sig flags to the signatures

zapu commented 7 years ago

Also here is "shorter" test case, also from the same id - I hacked sig checker to not do the verification skipping optimization. It fails even for link 0 IIRC.

const b_pub_key = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: https://keybase.io/download
Version: Keybase Go 1.0.18 (linux)

xlIEU48kqRMIKoZIzj0DAQcCAwTLNQcHOGaQzRpX7txSgs4Pf3FdHknWvJhgJJ0U
5wk607SmIQFRfVCvzxny5RQsANL3cg26ARQ2pLE4Za4C7hZMzRg8YmVuZ3QubHVl
ZXJzQGdtYWlsLmNvbT7CZgQQEwgAGP8AAAAFglOPJKn/AAAACZBcFMyn0JbJmAAA
reQBAL/ipjkc+3WA3zaJQVImdGnlTL6ukN1CM6PPqWEvLFPAAQCkJfkosi8b2MVG
gAck3OZTxPuF6j414eJN51AvtpzXZc5WBFOPJKkSCCqGSM49AwEHAgME4omQKKpO
U8I9ucgp8U9QHfOh4ZXBgtdqvltE60lFU77wh7ZQSC1c/T5opD/sRBauuoUz1v1e
j/dhRKJAKLFvXQMBCAfCZgQYEwgAGP8AAAAFglOPJKn/AAAACZBcFMyn0JbJmAAA
Fy4BAI9fK35MHxQZFIW2XuLFN0BPrIFaXwgVawH4qgZyGeZdAQCyKEBG6CxG293I
9UqkwX18rZ56Iz7kQxEujPas7pXPXA==
=XpdH
-----END PGP PUBLIC KEY BLOCK-----
`

const b_payload = `-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP v1.1.3
Comment: https://keybase.io/crypto

yMC+AnicO8LLzMAlHCNyZvmFaSdnMJ4+UF7KEOK1+2e1UlJ+SqWSVbVSdiqYSsvM
S08tKijKzCtRslIyMUu2TDYyMTJLNbAwMrdITbVIMrFISUs2TTY0SU5ONE8xsASq
sLRQ0lHKyC8G6QAak5RYnKqXmQ8UA3LiM1OAoljUl4IlUoxSDdKMjC1STcyMLQyN
zEyTTC0NkoyMDC0sLU2SDAxACotTi/ISc1OBqpNS89JLlGp1lEoqC0D88tSkeKBs
WWZyanxSZl4K0O1ADWWpRcWZ+XlKVoZAlcklmSCthiZAaGFsaWSpo5RaUZBZlBqf
CVJham5mYQAEOkoFRallSlZ5pTk5OkrFqYV5+UBZoEWJ6UB7ijPT8xJLSotSlWoP
xbEwCHMxsLEygYKPgYtTABaollqMDO/WFTc+WbrZx8Oi/o0q07zjftvvOoXvefF7
6sFHMplrtRsZGX4I+jZaSuz17mzNWL1Nh1vkceR3UWH+srexvyvP5RRpBQAAdkyP
lA==
=+wQP
-----END PGP MESSAGE-----