From 6b914175ebbc534d5226fb7098f1ad54f12186e6 Mon Sep 17 00:00:00 2001 From: Karol Chojnowski Date: Wed, 7 Jan 2026 14:26:29 +0100 Subject: [PATCH 1/2] fix certs --- .gitignore | 2 +- integration_test/certs/localhost.crt | 30 ++++++++++++++-------------- integration_test/certs/rootCA.srl | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 4ffe1a1d..3280d515 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ bin/ .vscode/ examples/*/output/* integration_test/output +integration_test/data ######## Node # Logs @@ -109,7 +110,6 @@ dist # vuepress v2.x temp and cache directory .temp -.cache # Docusaurus cache and generated files .docusaurus diff --git a/integration_test/certs/localhost.crt b/integration_test/certs/localhost.crt index 6bf7ea70..c790659c 100644 --- a/integration_test/certs/localhost.crt +++ b/integration_test/certs/localhost.crt @@ -1,8 +1,8 @@ -----BEGIN CERTIFICATE----- -MIIEljCCAn6gAwIBAgIUFHPaG8f7cV4RN0IBQJpxUBicWIIwDQYJKoZIhvcNAQEL +MIIEljCCAn6gAwIBAgIUFHPaG8f7cV4RN0IBQJpxUBicWIowDQYJKoZIhvcNAQEL BQAwVTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkdEMQswCQYDVQQHDAJTWjEYMBYG -A1UECgwPbG9jYWxob3N0LCBJbmMuMRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMjQw -NDAzMTEyMDI1WhcNMjUwNDAzMTEyMDI1WjBVMQswCQYDVQQGEwJDTjELMAkGA1UE +A1UECgwPbG9jYWxob3N0LCBJbmMuMRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMjYw +MTA3MTI1MDQyWhcNMzYwMTA1MTI1MDQyWjBVMQswCQYDVQQGEwJDTjELMAkGA1UE CAwCR0QxCzAJBgNVBAcMAlNaMRgwFgYDVQQKDA9sb2NhbGhvc3QsIEluYy4xEjAQ BgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKo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tBJT+ij -ZAoQm0tkfBVSYntc4llwOeQVloFoz6csLQ0= +gBRZXWgOmRnpmEx6i7Djnf/j4y930zANBgkqhkiG9w0BAQsFAAOCAgEADvfy6R3h +AL/nUT/63VhMBqkheTEDWJ3bhLmYlqBMcCz9+6tYpJXCtvB8pd8X1QS0mFBQlrPo +IBbKMT+UBLoMQ9I213Lf3ybRcqXoXaDjHlhCee01umfQX6Cid/TgBzETTmLSt45L +aJcV9aktWsDtuXLwWHBpsY4CfNAGeTau4cKkx7DlvqupV0wtEtl4hBjlp0QBHu0D +oW2pMGMmtN6Tchc0+MQg3l7g5On3z0u3TCwm6TXPcOzlawCBE9xMuvz/UmzB4wKC +6PtIQwtLyq7urJwAVixx4fZDu0uZtMmbP5puo4d4zK1SZS7Ycf4hxiIqZ9qNwqmG +M0mukHtj8bMogoklFDFA/IQehI+hftxu3NlS6sZg8joKbGxaKx0ffbIMYandkCRl +LIr1Wiju1ftQ0uoIfS2g1uDrH7PHpqQPHvpizBwSayh9CpbIcGDmwk6vvY4Grn6D +Yqklmyu3JLS+/ybeaZeH1zwKJ2ml2sq1B/I9t0cF6s3+6pTVrT0lLo4lxFQEE3h3 +CYIVc/ArCSFU17gvCDJK+lz5+FneaMZbLIHOw2CoK1Z8nizpUzHa4WgRl+Zesd0a +OxRrZ3jn0jEL6ivgC3YWoWHWhENzGNwzy1jXukNn6KYnlYrMABSHrbHEBBnh7ZeY +MGNbDRqXK52mpL7HUlo3XLofUwF6Ajx8VX4= -----END CERTIFICATE----- diff --git a/integration_test/certs/rootCA.srl b/integration_test/certs/rootCA.srl index dabff719..d6222e79 100644 --- a/integration_test/certs/rootCA.srl +++ b/integration_test/certs/rootCA.srl @@ -1 +1 @@ -1473DA1BC7FB715E11374201409A7150189C5889 +1473DA1BC7FB715E11374201409A7150189C588A From a11212c5731b6bfe734219340d6319d01fda9788 Mon Sep 17 00:00:00 2001 From: Karol Chojnowski Date: Wed, 7 Jan 2026 16:56:34 +0100 Subject: [PATCH 2/2] style(utils.go): standardize error messages to start with lowercase for consistency style(health_check_test.go): suppress unused variable warning by ignoring Close return value style(init_integration_test.go): update public key comparison to use correct field for clarity style(rsa.go): standardize error message for missing password to start with lowercase style(state_test.go): update public key comparison to use correct field for clarity style(utils.go): suppress unused variable warning by ignoring Close return value --- cli/utils/utils.go | 2 +- integration_test/health_check_test.go | 4 ++-- integration_test/init_integration_test.go | 2 +- pkgs/crypto/rsa.go | 2 +- pkgs/operator/state_test.go | 6 +++--- pkgs/utils/utils.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/utils/utils.go b/cli/utils/utils.go index 871ede74..de148623 100644 --- a/cli/utils/utils.go +++ b/cli/utils/utils.go @@ -93,7 +93,7 @@ func WriteResults( return fmt.Errorf("expectedValidatorCount is 0") } if len(depositDataArr) != len(keySharesArr) || len(depositDataArr) != len(proofs) { - return fmt.Errorf("Incoming result arrays have inconsistent length") + return fmt.Errorf("incoming result arrays have inconsistent length") } if len(depositDataArr) == 0 { return fmt.Errorf("no results to write") diff --git a/integration_test/health_check_test.go b/integration_test/health_check_test.go index b9f38cf6..27a58afe 100644 --- a/integration_test/health_check_test.go +++ b/integration_test/health_check_test.go @@ -47,7 +47,7 @@ func TestHealthCheck(t *testing.T) { RootCmd.SetArgs(args) err := RootCmd.Execute() require.NoError(t, err) - w.Close() + _ = w.Close() out, _ := io.ReadAll(r) os.Stdout = rescueStdout t.Log(string(out)) @@ -63,7 +63,7 @@ func TestHealthCheck(t *testing.T) { RootCmd.SetArgs(args) err := RootCmd.Execute() require.NoError(t, err) - w.Close() + _ = w.Close() out, _ := io.ReadAll(r) os.Stdout = rescueStdout t.Log(string(out)) diff --git a/integration_test/init_integration_test.go b/integration_test/init_integration_test.go index ff1d7eaf..df2dbc66 100644 --- a/integration_test/init_integration_test.go +++ b/integration_test/init_integration_test.go @@ -457,7 +457,7 @@ func testSharesData(ops wire.OperatorsCLI, operatorCount int, keys []*rsa.Privat // Find operator ID by PubKey var operatorID uint64 for _, op := range ops { - if bytes.Equal(priv.PublicKey.N.Bytes(), op.PubKey.N.Bytes()) { + if bytes.Equal(priv.N.Bytes(), op.PubKey.N.Bytes()) { operatorID = op.ID break } diff --git a/pkgs/crypto/rsa.go b/pkgs/crypto/rsa.go index 63a00ec5..99432acf 100644 --- a/pkgs/crypto/rsa.go +++ b/pkgs/crypto/rsa.go @@ -15,7 +15,7 @@ import ( // DecryptRSAKeystore reads an encrypted RSA private key using the given password. func DecryptRSAKeystore(keyData []byte, password string) (*rsa.PrivateKey, error) { if strings.TrimSpace(password) == "" { - return nil, errors.New("Password required for encrypted PEM block") + return nil, errors.New("password required for encrypted PEM block") } // Unmarshal the JSON-encoded data diff --git a/pkgs/operator/state_test.go b/pkgs/operator/state_test.go index beaae1ea..89f825bf 100644 --- a/pkgs/operator/state_test.go +++ b/pkgs/operator/state_test.go @@ -82,7 +82,7 @@ func TestCreateInstance(t *testing.T) { wrapper, ok := inst.(*instWrapper) require.True(t, ok) - require.True(t, wrapper.LocalOwner.OperatorSecretKey.PublicKey.Equal(&privateKey[0].PublicKey)) + require.True(t, wrapper.OperatorSecretKey.PublicKey.Equal(&privateKey[0].PublicKey)) } testParams := []struct { @@ -284,7 +284,7 @@ func TestCrashByMaliciousOperatorAtInit(t *testing.T) { wrapper, ok := inst.(*instWrapper) require.True(t, ok) - require.True(t, wrapper.LocalOwner.OperatorSecretKey.PublicKey.Equal(&privateKey[0].PublicKey)) + require.True(t, wrapper.OperatorSecretKey.PublicKey.Equal(&privateKey[0].PublicKey)) // create multiple transport with wrong exchMsg := wire.Exchange{ @@ -353,7 +353,7 @@ func TestCrashByMaliciousOperatorAtReshare(t *testing.T) { wrapper, ok := inst.(*instWrapper) require.True(t, ok) - require.True(t, wrapper.LocalOwner.OperatorSecretKey.PublicKey.Equal(&privateKey[0].PublicKey)) + require.True(t, wrapper.OperatorSecretKey.PublicKey.Equal(&privateKey[0].PublicKey)) // create multiple transport with wrong exchMsg := wire.Exchange{ diff --git a/pkgs/utils/utils.go b/pkgs/utils/utils.go index 026ddbba..42cf9222 100644 --- a/pkgs/utils/utils.go +++ b/pkgs/utils/utils.go @@ -41,7 +41,7 @@ func WriteJSON(filePth string, data any) error { if err != nil { return err } - defer file.Close() + defer func() { _ = file.Close() }() return json.NewEncoder(file).Encode(data) }