forked from Silverfish/proton-bridge
chore: upgraded golangci-lint v1.52.2 and fixed all issues.
This commit is contained in:
@ -107,7 +107,6 @@ const (
|
||||
|
||||
// certPEMToDER converts a certificate in PEM format to DER format, which is the format required by Apple's Security framework.
|
||||
func certPEMToDER(certPEM []byte) ([]byte, error) {
|
||||
|
||||
block, left := pem.Decode(certPEM)
|
||||
if block == nil {
|
||||
return []byte{}, errors.New("invalid PEM certificate")
|
||||
@ -127,7 +126,7 @@ func installCert(certPEM []byte) error {
|
||||
}
|
||||
|
||||
p := C.CBytes(certDER)
|
||||
defer C.free(unsafe.Pointer(p))
|
||||
defer C.free(unsafe.Pointer(p)) //nolint:unconvert
|
||||
|
||||
errCode := C.installTrustedCert((*C.char)(p), (C.ulonglong)(len(certDER)))
|
||||
switch errCode {
|
||||
@ -147,7 +146,7 @@ func uninstallCert(certPEM []byte) error {
|
||||
}
|
||||
|
||||
p := C.CBytes(certDER)
|
||||
defer C.free(unsafe.Pointer(p))
|
||||
defer C.free(unsafe.Pointer(p)) //nolint:unconvert
|
||||
|
||||
if errCode := C.removeTrustedCert((*C.char)(p), (C.ulonglong)(len(certDER))); errCode != 0 {
|
||||
return fmt.Errorf("could not install certificate from keychain (error %v)", errCode)
|
||||
|
||||
@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
// This test implies human interactions to enter password and is disabled by default.
|
||||
func _TestTrustedCertsDarwin(t *testing.T) {
|
||||
func _TestTrustedCertsDarwin(t *testing.T) { //nolint:unused
|
||||
template, err := NewTLSTemplate()
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user