From c93e33113c8be0afb715e1c6378544c6893a3142 Mon Sep 17 00:00:00 2001 From: Viktor Benei Date: Tue, 22 Nov 2016 14:39:21 +0100 Subject: [PATCH 1/2] ignore / don't try to export the dash (-) identity which can be present if a target/project is set to "no code sign" --- cmd/common.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/common.go b/cmd/common.go index 2f2a2d1a..96968af2 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -66,9 +66,17 @@ func exportCodeSigningFiles(toolName, absExportOutputDirPath string, codeSigning fmt.Println() fmt.Println() utils.Printlnf("=== Required Identities/Certificates (%d) ===", len(codeSigningSettings.Identities)) + cleanedUpIdentities := []common.CodeSigningIdentityInfo{} for idx, anIdentity := range codeSigningSettings.Identities { utils.Printlnf(" * (%d): %s", idx+1, anIdentity.Title) + if anIdentity.Title == "-" { + fmt.Println(" " + colorstring.Yellow("WARNING:") + " This entry (" + colorstring.Yellow("-") + ") means that one of your target/project is set to " + colorstring.Yellow("NO CODE SIGN")) + fmt.Println(" Please try to fix this issue first if you'd experience any code signing problems!") + } else { + cleanedUpIdentities = append(cleanedUpIdentities, anIdentity) + } } + codeSigningSettings.Identities = cleanedUpIdentities fmt.Println("============================================") fmt.Println() From a4bb6f3ac8ab347cf653135db1e2f33d14cdf800 Mon Sep 17 00:00:00 2001 From: Viktor Benei Date: Tue, 22 Nov 2016 14:45:29 +0100 Subject: [PATCH 2/2] go lint fix --- cmd/common.go | 2 +- osxkeychain/osxkeychain.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/common.go b/cmd/common.go index 96968af2..79000475 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -236,7 +236,7 @@ func collectAndExportIdentities(codeSigningSettings common.CodeSigningSettings, } if len(validIdentityRefs) < 1 { - return errors.New("Identity not found in the keychain, or it was invalid (expired)!") + return errors.New("Identity not found in the keychain, or it was invalid (expired)") } if len(validIdentityRefs) > 1 { log.Warning(colorstring.Yellow("Multiple matching Identities found in Keychain! Most likely you have duplicated identities in separate Keychains, e.g. one in System.keychain and one in your Login.keychain, or you have revoked versions of the Certificate.")) diff --git a/osxkeychain/osxkeychain.go b/osxkeychain/osxkeychain.go index 230d4580..5e0ec1a9 100644 --- a/osxkeychain/osxkeychain.go +++ b/osxkeychain/osxkeychain.go @@ -190,7 +190,7 @@ func FindIdentity(identityLabel string, isFullLabelMatch bool) ([]IdentityWithRe identitiesArrRef := C.CFArrayRef(resultRefs) identitiesCount := C.CFArrayGetCount(identitiesArrRef) if identitiesCount < 1 { - return nil, fmt.Errorf("No Identity (certificate + related private key) found in your Keychain!") + return nil, fmt.Errorf("No Identity (certificate + related private key) found in your Keychain") } log.Debugf("identitiesCount: %d", identitiesCount)