Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Davis Goodin <[email protected]>
  • Loading branch information
qmuntal and dagood authored Nov 29, 2022
1 parent f1d2d12 commit 1ddc890
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions openssl/ecdh.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func NewPrivateKeyECDH(curve string, bytes []byte) (*PrivateKeyECDH, error) {
return nil, newOpenSSLError("EC_KEY_set_private_key")
}
k := &PrivateKeyECDH{curve, key}
// Note: Same as in NewPublicKeyECDH regarding finalizer and KeepAlive.
runtime.SetFinalizer(k, (*PrivateKeyECDH).finalize)
return k, nil
}
Expand Down Expand Up @@ -208,7 +207,6 @@ func GenerateKeyECDH(curve string) (*PrivateKeyECDH, []byte, error) {
}

k := &PrivateKeyECDH{curve, key}
// Note: Same as in NewPublicKeyECDH regarding finalizer and KeepAlive.
runtime.SetFinalizer(k, (*PrivateKeyECDH).finalize)
return k, bytes, nil
}
2 changes: 1 addition & 1 deletion openssl/ecdh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// The following tests has been copied from
// https://github.com/golang/go/blob/master/src/crypto/ecdh/ecdh_test.go.
// https://github.com/golang/go/blob/bb0d8297d76cb578baad8fa1485565d9acf44cc5/src/crypto/ecdh/ecdh_test.go.

func TestECDH(t *testing.T) {
for _, tt := range []string{"P-256", "P-384", "P-521"} {
Expand Down

0 comments on commit 1ddc890

Please sign in to comment.