forked from Silverfish/proton-bridge
feat(GODT-2771): removed cert check and install on app startup on macOS.
This commit is contained in:
@ -234,10 +234,6 @@ const (
|
||||
errAuthorizationCanceled = -60006
|
||||
)
|
||||
|
||||
var (
|
||||
ErrUserCanceledCertificateInstall = errors.New("the user cancelled the authorization dialog")
|
||||
)
|
||||
|
||||
// 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)
|
||||
|
||||
@ -40,7 +40,7 @@ func TestCertInKeychain(t *testing.T) {
|
||||
}
|
||||
|
||||
// This test require human interaction (macOS security prompts), and is disabled by default.
|
||||
func TestCertificateTrust(t *testing.T) {
|
||||
func _TestCertificateTrust(t *testing.T) {
|
||||
certPEM := generatePEMCertificate(t)
|
||||
require.False(t, isCertTrusted(certPEM))
|
||||
require.NoError(t, addCertToKeychain(certPEM))
|
||||
@ -52,7 +52,7 @@ func TestCertificateTrust(t *testing.T) {
|
||||
}
|
||||
|
||||
// This test require human interaction (macOS security prompts), and is disabled by default.
|
||||
func TestInstallAndRemove(t *testing.T) {
|
||||
func _TestInstallAndRemove(t *testing.T) {
|
||||
certPEM := generatePEMCertificate(t)
|
||||
|
||||
// fresh install
|
||||
|
||||
@ -25,6 +25,6 @@ func uninstallCert([]byte) error {
|
||||
return nil // Linux doesn't have a root cert store.
|
||||
}
|
||||
|
||||
func isCertInstalled([]byte) error {
|
||||
func isCertInstalled([]byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -25,6 +25,6 @@ func uninstallCert([]byte) error {
|
||||
return nil // NOTE(GODT-986): Uninstall certs from root cert store?
|
||||
}
|
||||
|
||||
func isCertInstalled([]byte) error {
|
||||
func isCertInstalled([]byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -17,6 +17,12 @@
|
||||
|
||||
package certs
|
||||
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
ErrUserCanceledCertificateInstall = errors.New("the user cancelled the authorization dialog")
|
||||
)
|
||||
|
||||
type Installer struct{}
|
||||
|
||||
func NewInstaller() *Installer {
|
||||
|
||||
Reference in New Issue
Block a user