Skip to content

bug: tezos and eth eventstreams use invalid SHA256 invocation #1678

Description

@mcsaucy

What happened?

https://github.com/search?q=repo%3Ahyperledger%2Ffirefly+sha256.New%28%29.Sum&type=code

sha256.New().Sum != sha256.Sum256. See https://go.dev/play/p/vSW0U3Hq4qk

I tried to make a PR but couldn't work out some test failures. Additionally, I don't have enough context to know whether this is a breaking change, so I'm just gonna file this issue instead.

What did you expect to happen?

I expected vars like "unique hash" to have unique hashes in them. Instead, they have the raw plaintext with SHA256("") appended to the end.

How can we reproduce it (as minimally and precisely as possible)?

Ya just gotta switch from sha256.New().Sum to sha256.Sum256. Note that you may need to throw that in a variable and then convert the byte array to byte slice with [:].

See kubernetes-sigs/bom#524 for a similar PR.

Anything else we need to know?

No response

OS version

Details
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions