66
66
# Check that we have the correct environment set for signing
67
67
function assert_can_sign {
68
68
if [[ " $( uname -s) " == " Darwin" ]]; then
69
- if [[ -z ${CSC_INSTALLER_LINK -} ]]; then
70
- log_error " The variable CSC_INSTALLER_LINK is not set. It needs to point to a file containing the private key used for signing of binaries."
69
+ if [[ -z ${CSC_LINK -} ]]; then
70
+ log_error " The variable CSC_LINK is not set. It needs to point to a file containing the private key used for signing of binaries."
71
71
exit 1
72
72
fi
73
- if [[ -z ${CSC_INSTALLER_KEY_PASSWORD -} ]]; then
74
- read -rsp " CSC_INSTALLER_KEY_PASSWORD = " CSC_INSTALLER_KEY_PASSWORD
73
+ if [[ -z ${CSC_KEY_PASSWORD -} ]]; then
74
+ read -rsp " CSC_KEY_PASSWORD = " CSC_KEY_PASSWORD
75
75
echo " "
76
- export CSC_INSTALLER_KEY_PASSWORD
76
+ export CSC_KEY_PASSWORD
77
77
fi
78
78
if [[ -z ${NOTARIZE_KEYCHAIN-} || -z ${NOTARIZE_KEYCHAIN_PROFILE-} ]]; then
79
79
log_error " The variables NOTARIZE_KEYCHAIN and NOTARIZE_KEYCHAIN_PROFILE must be set."
@@ -129,9 +129,9 @@ function lipo_executables {
129
129
lipo " ${target_exes[@]} " -create -output " $BUILD_DIR /installer-downloader"
130
130
}
131
131
132
- # Create temporary keychain for importing $CSC_INSTALLER_LINK
132
+ # Create temporary keychain for importing $CSC_LINK
133
133
function setup_macos_keychain {
134
- log_info " Creating a temporary keychain \" $SIGN_KEYCHAIN_PATH \" for $CSC_INSTALLER_LINK "
134
+ log_info " Creating a temporary keychain \" $SIGN_KEYCHAIN_PATH \" for $CSC_LINK "
135
135
136
136
SIGN_KEYCHAIN_PASS=$( openssl rand -base64 64)
137
137
export SIGN_KEYCHAIN_PASS
@@ -143,12 +143,12 @@ function setup_macos_keychain {
143
143
/usr/bin/security unlock-keychain -p " $SIGN_KEYCHAIN_PASS " " $SIGN_KEYCHAIN_PATH "
144
144
/usr/bin/security set-keychain-settings " $SIGN_KEYCHAIN_PATH "
145
145
146
- # Add our keychain to the search list, keeping existing keychains , or codesign won't find it
147
- /usr/bin/security list-keychains -d user -s " $SIGN_KEYCHAIN_PATH " " $( security list-keychains -d user | tr -d ' " ' ) "
146
+ # Include keychain in the search list, or codesign won't find it
147
+ /usr/bin/security list-keychains -d user -s " $SIGN_KEYCHAIN_PATH "
148
148
149
149
log_info " Importing PKCS #12 to keychain"
150
150
151
- /usr/bin/security import " $CSC_INSTALLER_LINK " -k " $SIGN_KEYCHAIN_PATH " -P " $CSC_INSTALLER_KEY_PASSWORD " -T /usr/bin/codesign
151
+ /usr/bin/security import " $CSC_LINK " -k " $SIGN_KEYCHAIN_PATH " -P " $CSC_KEY_PASSWORD " -T /usr/bin/codesign
152
152
153
153
# Prevent password prompt when signing
154
154
/usr/bin/security set-key-partition-list -S " apple-tool:,apple:" -s -k " $SIGN_KEYCHAIN_PASS " " $SIGN_KEYCHAIN_PATH "
0 commit comments