-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Mac hardened signing on signingscript
- Loading branch information
Showing
25 changed files
with
544 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$let: | ||
scope_prefix: | ||
$match: | ||
'COT_PRODUCT == "firefox"': 'project:releng:signing:' | ||
'COT_PRODUCT == "thunderbird"': 'project:comm:thunderbird:releng:signing:' | ||
'COT_PRODUCT == "mozillavpn"': 'project:mozillavpn:releng:signing:' | ||
'COT_PRODUCT == "adhoc"': 'project:adhoc:releng:signing:' | ||
in: | ||
$merge: | ||
$match: | ||
'ENV == "prod" && scope_prefix': | ||
'${scope_prefix[0]}cert:release-signing': | ||
- "app_credentials": {"$eval": "APPLE_APP_SIGNING_CREDENTIALS"} | ||
"installer_credentials": {"$eval": "APPLE_INSTALLER_SIGNING_CREDENTIALS"} | ||
"password": {"$eval": "APPLE_SIGNING_CREDS_PASSWORD"} | ||
'${scope_prefix[0]}cert:nightly-signing': | ||
- "app_credentials": {"$eval": "APPLE_APP_SIGNING_CREDENTIALS"} | ||
"installer_credentials": {"$eval": "APPLE_INSTALLER_SIGNING_CREDENTIALS"} | ||
"password": {"$eval": "APPLE_SIGNING_CREDS_PASSWORD"} | ||
'ENV != "prod" && scope_prefix': | ||
'${scope_prefix[0]}cert:dep-signing': | ||
- "app_credentials": {"$eval": "APPLE_APP_SIGNING_DEP_CREDENTIALS"} | ||
"installer_credentials": {"$eval": "APPLE_INSTALLER_SIGNING_DEP_CREDENTIALS"} | ||
"password": {"$eval": "APPLE_SIGNING_DEP_CREDS_PASSWORD"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -x -e -v | ||
|
||
# This script is for building libdmg-hfsplus to get the `dmg` and `hfsplus` | ||
# tools for handling DMG archives on Linux. | ||
|
||
DEST=$1 | ||
if [ -d "$DEST" ]; then | ||
echo "Binaries will be installed to: $DEST" | ||
else | ||
echo "Destination directory doesn't exist!" | ||
exit 1 | ||
fi | ||
|
||
git clone --depth=1 --branch mozilla --single-branch https://github.com/mozilla/libdmg-hfsplus/ libdmg-hfsplus | ||
|
||
pushd libdmg-hfsplus | ||
|
||
# The openssl libraries in the sysroot cannot be linked in a PIE executable so we use -no-pie | ||
cmake \ | ||
-DOPENSSL_USE_STATIC_LIBS=1 \ | ||
-DCMAKE_EXE_LINKER_FLAGS=-no-pie \ | ||
. | ||
|
||
make VERBOSE=1 -j$(nproc) | ||
|
||
# We only need the dmg and hfsplus tools. | ||
strip dmg/dmg hfs/hfsplus | ||
cp dmg/dmg hfs/hfsplus "$DEST" | ||
|
||
popd | ||
rm -rf libdmg-hfsplus | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -x -e -v | ||
|
||
DEST=$1 | ||
if [ -d "$DEST" ]; then | ||
echo "Binaries will be installed to: $DEST" | ||
else | ||
echo "Destination directory doesn't exist!" | ||
exit 1 | ||
fi | ||
|
||
|
||
wget -qO- https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.26.0/apple-codesign-0.26.0-x86_64-unknown-linux-musl.tar.gz \ | ||
| tar xvz -C "$DEST" --transform 's/.*\///g' --wildcards --no-anchored 'rcodesign' | ||
|
||
chmod +x "${DEST}/rcodesign" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import logging | ||
import os | ||
from shutil import copy2 | ||
|
||
from signingscript.exceptions import SigningScriptError | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
PROVISIONING_PROFILE_FILENAMES = { | ||
"firefox": "orgmozillafirefox.provisionprofile", | ||
"devedition": "orgmozillafirefoxdeveloperedition.provisionprofile", | ||
"nightly": "orgmozillanightly.provisionprofile", | ||
} | ||
|
||
|
||
def copy_provisioning_profiles(bundlepath, configs): | ||
"""Copy provisioning profiles inside bundle | ||
Args: | ||
bundlepath (str): The absolute path to the app bundle | ||
configs (list): The list of configs with schema [{"profile_name": str, "target_path": str}] | ||
""" | ||
for cfg in configs: | ||
profile_name = cfg.get("profile_name") | ||
target_path = cfg.get("target_path") | ||
if not profile_name or not target_path: | ||
raise SigningScriptError(f"profile_name and target_path are required. Got: {cfg}") | ||
|
||
if profile_name not in PROVISIONING_PROFILE_FILENAMES.values(): | ||
raise SigningScriptError(f"profile_name not allowed: {profile_name}") | ||
|
||
profile_path = os.path.join(os.path.dirname(__file__), "data", profile_name) | ||
if not os.path.exists(profile_path): | ||
raise SigningScriptError(f"Provisioning profile not found: {profile_name}") | ||
|
||
# Resolve absolute destination path | ||
target_abs_path = os.path.join(bundlepath, target_path if target_path[0] != "/" else target_path[1:]) | ||
if os.path.exists(target_abs_path): | ||
log.warning("Provisioning profile at {target_path} already exists, overriding.") | ||
|
||
log.info(f"Copying {profile_name} to {target_abs_path}") | ||
copy2(profile_path, target_abs_path) |
Binary file added
BIN
+12.1 KB
signingscript/src/signingscript/data/orgmozillanightly.provisionprofile
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.