x/crypto: breaking api change in cryptobyte String.ReadASN1Integer since v0.4.0 leads to panic #63987
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
golang.org/x/crypto 0.4.0 introduced a breaking API change in the
AddASN1Int64()
method.Previously, reflection was used to determine the underlying type of the provided
out
argument.As of golang/crypto@2c47667 - it instead uses type assertions.
This is a breaking change - while previously one could pass named types whose underlying types are integers,
that same code as of x/crypto >=0.4.0 will panic.
Reproduction:
https://go.dev/play/p/1__wSXq30mR
...
What did you expect to see?
I expected code similar to the reproduction above to continue functioning with newer versions of x/crypto.
If this was not feasible, I would have at a minimum expected a release note describing the breaking change,
or to see it reflected in semantic versioning of the library.
What did you see instead?
Working code began to panic upon upgrading x/crypto >= 0.4.0.
The text was updated successfully, but these errors were encountered: