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

x/crypto/nacl/auth: Sum() copies Size bytes into KeySize sized array #41692

Closed
sauerbraten opened this issue Sep 29, 2020 · 2 comments
Closed
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@sauerbraten
Copy link

The auth package's Sum() function currently uses the KeySize constant to allocate an array for the authenticator to return (of type [Size]byte). It works fine since both constants are equal to 32, but https://github.com/golang/crypto/blob/5c72a883971a4325f8c62bf07b6d38c20ea47a6a/nacl/auth/auth.go#L43 should still use the Size constant for clarity.

The original NaCl C++ API uses the equivalent BYTES constant (not KEYBYTES): https://github.com/jeremywohl/nacl/blob/515c9bf085b5154d553ecf04288936850819c788/crypto_auth/wrapper-auth.cpp#L8

@gopherbot gopherbot added this to the Unreleased milestone Sep 29, 2020
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 29, 2020
@FiloSottile
Copy link
Contributor

Good catch, we'd welcome a PR to fix this.

@FiloSottile FiloSottile added help wanted NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 29, 2020
woat added a commit to woat/crypto that referenced this issue Sep 29, 2020
@gopherbot
Copy link

Change https://golang.org/cl/258357 mentions this issue: nacl/auth: prefer Size instead of KeySize

woat added a commit to woat/crypto that referenced this issue Sep 30, 2020
@golang golang locked and limited conversation to collaborators Oct 2, 2021
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 28, 2022
Fixes golang/go#41692

Change-Id: If6e885ca2e016dfecf534093c989356142ec7823
GitHub-Last-Rev: fe67c18f18ccfc766687b8db4bda92b9f7879a2b
GitHub-Pull-Request: golang/crypto#154
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 29, 2022
Fixes golang/go#41692

Change-Id: If6e885ca2e016dfecf534093c989356142ec7823
GitHub-Last-Rev: fe67c18f18ccfc766687b8db4bda92b9f7879a2b
GitHub-Pull-Request: golang/crypto#154
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
c-expert-zigbee pushed a commit to c-expert-zigbee/crypto_go that referenced this issue Mar 29, 2022
Fixes golang/go#41692

Change-Id: If6e885ca2e016dfecf534093c989356142ec7823
GitHub-Last-Rev: fe67c18f18ccfc766687b8db4bda92b9f7879a2b
GitHub-Pull-Request: golang/crypto#154
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
LewiGoddard pushed a commit to LewiGoddard/crypto that referenced this issue Feb 16, 2023
Fixes golang/go#41692

Change-Id: If6e885ca2e016dfecf534093c989356142ec7823
GitHub-Last-Rev: fe67c18f18ccfc766687b8db4bda92b9f7879a2b
GitHub-Pull-Request: golang/crypto#154
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
BiiChris pushed a commit to BiiChris/crypto that referenced this issue Sep 15, 2023
Fixes golang/go#41692

Change-Id: If6e885ca2e016dfecf534093c989356142ec7823
GitHub-Last-Rev: fe67c18
GitHub-Pull-Request: golang#154
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants