feat(GODT-2771): removed cert check and install on app startup on macOS.

This commit is contained in:
Xavier Michelon
2023-08-17 18:06:23 +02:00
parent 69190daf3f
commit 452d3068f0
9 changed files with 11 additions and 47 deletions

View File

@ -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)

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -17,6 +17,12 @@
package certs
import "errors"
var (
ErrUserCanceledCertificateInstall = errors.New("the user cancelled the authorization dialog")
)
type Installer struct{}
func NewInstaller() *Installer {