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

Public key comparison methods panic with infinite operand #3767

Open
cthulhu-rider opened this issue Dec 18, 2024 · 0 comments
Open

Public key comparison methods panic with infinite operand #3767

cthulhu-rider opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working I4 No visible changes S4 Routine U4 Nothing urgent
Milestone

Comments

@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Dec 18, 2024

Current Behavior

Following methods panic if at least one operand is infinite:

Expected Behavior

no panic

Possible Solution

pre-check the case

Steps to Reproduce

func TestPubCmp(t *testing.T) {
	var pub1 keys.PublicKey
	require.NoError(t, pub1.DecodeBytes([]byte{0x00}))
	pk, err := keys.NewPrivateKey()
	require.NoError(t, err)
	pub2 := pk.PublicKey()
	t.Run("equal", func(t *testing.T) {
		require.NotPanics(t, func() { pub1.Equal(pub2) })
	})
	t.Run("cmp", func(t *testing.T) {
		require.NotPanics(t, func() { pub1.Cmp(pub2) })
	})
}

Context

testing the NeoFS cryprography using keys pkg

Regression

no

Your Environment

  • Version of the product used: v0.107.2
@cthulhu-rider cthulhu-rider added the bug Something isn't working label Dec 18, 2024
@roman-khimov roman-khimov added this to the v0.108.0 milestone Dec 18, 2024
@roman-khimov roman-khimov added U4 Nothing urgent S4 Routine I4 No visible changes labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working I4 No visible changes S4 Routine U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

2 participants