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: using nil iv in cbc causes index of out bounds panic #3411

Closed
snaury opened this issue Mar 27, 2012 · 3 comments
Closed

crypto/cipher: using nil iv in cbc causes index of out bounds panic #3411

snaury opened this issue Mar 27, 2012 · 3 comments
Milestone

Comments

@snaury
Copy link
Contributor

snaury commented Mar 27, 2012

When creating a cbc encrypter/decrypter it doesn't check for nil iv (for example, I was
expecting it to use "default" iv of all zeros in that case), and causes a
confusing panic much later, when calling CryptBlocks. Post Go 1 it would likely be
better to:

- (optional) check iv for nil and use make([]byte, BlockSize) to create a
"zero" iv
- panic if iv size is less than BlockSize, so it is clear where is the actual error
@rsc
Copy link
Contributor

rsc commented Mar 28, 2012

Comment 1:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 2:

Labels changed: added go1.1.

@agl
Copy link
Contributor

agl commented Oct 17, 2012

Comment 3:

This issue was closed by revision fcd5fd2.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
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