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

crypto/cipher: cfb mode possible bug #8576

Closed
gopherbot opened this issue Aug 23, 2014 · 5 comments
Closed

crypto/cipher: cfb mode possible bug #8576

gopherbot opened this issue Aug 23, 2014 · 5 comments

Comments

@gopherbot
Copy link

by emil2k:

There may be a bug with the CFB mode encryption, take a look at the report here :
http://stackoverflow.com/a/25463091/220710
@bradfitz
Copy link
Contributor

Comment 1:

Adam, summary from that URL:
In src/pkg/crypto/cipher/cfb.go:
func (x *cfb) XORKeyStream(dst, src []byte) {
....
        if !x.decrypt {
            copy(x.next[x.outUsed:], dst) // BUG? `dst` should be `src`
        }

Owner changed to @agl.

@ncw
Copy link
Contributor

ncw commented Aug 24, 2014

Comment 2:

I don't know whether the code is correct or not, but either way the tests should have
some test vectors.  The tests don't actually check the code implements CFB correctly,
only that the decode(encode(x)) == x.
http://golang.org/src/pkg/crypto/cipher/cfb_test.go

@agl
Copy link
Contributor

agl commented Aug 25, 2014

Comment 3:

Have replied on the StackOverflow page. https://golang.org/cl/136720043 coming
to add test vectors for CFB mode.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 4:

CL https://golang.org/cl/136720043 mentions this issue.

@agl
Copy link
Contributor

agl commented Aug 25, 2014

Comment 5:

This issue was closed by revision a6cd733.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Fixes golang#8576.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/136720043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Fixes golang#8576.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/136720043
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants