Skip to content

Commit 5c07465

Browse files
SNOW-2118790: Moved from md5sum to md5 as it is not supported (#2481)
SNOW-2118790: changing the md5sum to md5 as older machines using x86 does not support md5sum
1 parent 00c0f13 commit 5c07465

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

scripts/packaging/load_mac_certs.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,37 @@
44
APPLE_CERT_DEVELOPER_INSTALLER="apple_dev_installer_cert.p12"
55
APPLE_CERT_DEVELOPER_APPLICATION="apple_dev_application_cert.p12"
66

7+
# Define the expected MD5 checksum
8+
EXPECTED_INSTALLER_CHECKSUM="1f9d2dfd1a6dc87c87fe0426a6ee136e"
9+
EXPECTED_APPLICATION_CHECKSUM="658613e0abe5c3187284e9662f18e1f0"
10+
711
# Decode Developer ID Installer certificate from base64 into temporary file
812
base64 -d < $APPLE_CERT_DEVELOPER_INSTALLER_BASE64 > $APPLE_CERT_DEVELOPER_INSTALLER
913

10-
# Check the checksum of the decoded Developer ID Installer certificate
11-
echo "1f9d2dfd1a6dc87c87fe0426a6ee136e $APPLE_CERT_DEVELOPER_INSTALLER" | md5sum -c -
14+
# Calculate the actual checksum of the decoded file
15+
ACTUAL_INSTALLER_CHECKSUM=$(md5 -q $APPLE_CERT_DEVELOPER_INSTALLER)
16+
17+
# Compare the actual checksum with the expected one
18+
if [ "$ACTUAL_INSTALLER_CHECKSUM" == "$EXPECTED_INSTALLER_CHECKSUM" ]; then
19+
echo "$APPLE_CERT_DEVELOPER_INSTALLER: OK"
20+
else
21+
echo "$APPLE_CERT_DEVELOPER_INSTALLER: FAILED"
22+
exit 1
23+
fi
1224

1325
# Decode Developer ID Application certificate from base64 into temporary file
1426
base64 -d < $APPLE_CERT_DEVELOPER_APPLICATION_BASE64 > $APPLE_CERT_DEVELOPER_APPLICATION
1527

16-
# Check the checksum of the decoded Developer ID Application certificate
17-
echo "658613e0abe5c3187284e9662f18e1f0 $APPLE_CERT_DEVELOPER_APPLICATION" | md5sum -c -
28+
# Calculate the actual checksum of the decoded file
29+
ACTUAL_APPLICATION_CHECKSUM=$(md5 -q $APPLE_CERT_DEVELOPER_APPLICATION)
30+
31+
# Compare the actual checksum with the expected one
32+
if [ "$ACTUAL_APPLICATION_CHECKSUM" == "$EXPECTED_APPLICATION_CHECKSUM" ]; then
33+
echo "$APPLE_CERT_DEVELOPER_APPLICATION: OK"
34+
else
35+
echo "$APPLE_CERT_DEVELOPER_APPLICATION: FAILED"
36+
exit 1
37+
fi
1838

1939
# Set the Keychain path where the certificates will be imported
2040
KEYCHAIN_PATH=$HOME/Library/Keychains/login.keychain-db

0 commit comments

Comments
 (0)