Skip to content

Commit

Permalink
Precompute RSA key values so that tests succeed (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Apr 29, 2023
1 parent 04f4a39 commit 0d936c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/keyconv/keyconv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func TestKeyconv(t *testing.T) {
if !checker(t, keyconv.RSAPrivateKey(&dst, tc.Src), `keyconv.RSAPrivateKey should succeed`) {
return
}

if !tc.Error {
// From Go 1.20 on, for purposes of our test, we need the
// precomputed values as well
dst.Precompute()
if !assert.Equal(t, key, &dst, `keyconv.RSAPrivateKey should produce same value`) {
return
}
Expand All @@ -63,6 +67,9 @@ func TestKeyconv(t *testing.T) {
return
}
if !tc.Error {
// From Go 1.20 on, for purposes of our test, we need the
// precomputed values as well
dst.Precompute()
if !assert.Equal(t, key, dst, `keyconv.RSAPrivateKey should produce same value`) {
return
}
Expand Down

0 comments on commit 0d936c8

Please sign in to comment.