Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detached pgp verify was broken for messages shorter than 100 bytes #1862

Merged
merged 1 commit into from
Feb 2, 2016

Conversation

zanderz
Copy link
Contributor

@zanderz zanderz commented Feb 1, 2016

As per https://keybase.atlassian.net/browse/CORE-2267
C:\Program Files\Keybase>keybase pgp verify -d sig1.txt -i msg1.txt
ERROR unexpected EOF
@maxtaco @oconnor663

@@ -53,7 +53,7 @@ func (p *StreamPeeker) Peek(buf []byte) (n int, err error) {
return 0, ErrCannotPeek
}
n, err = io.ReadFull(p.r, buf)
p.buf = append(p.buf, buf...)
p.buf = append(p.buf, buf[:n]...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copying all 100 bytes of buf even if the message was shorter, and then those extra bytes were being included in the hash

@zanderz zanderz changed the title Detached verify was broken for messages shorter than 100 bytes Detached pgp verify was broken for messages shorter than 100 bytes Feb 1, 2016
doVerify(t, msg)
}

func TestPGPVerifyShortMsg(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified this new test failed before the included changes

zanderz pushed a commit that referenced this pull request Feb 2, 2016
Detached pgp verify was broken for messages shorter than 100 bytes
@zanderz zanderz merged commit 3a60956 into master Feb 2, 2016
@zanderz zanderz deleted the zanderz/CORE-2267 branch February 2, 2016 16:30
jzila pushed a commit that referenced this pull request Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants