Skip to content

Commit f56b7b8

Browse files
Accept standard Xcode archive application paths
1 parent afbcde6 commit f56b7b8

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

scripts/ci/audit-ios-signed-release-artifact.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ except (OSError, plistlib.InvalidFileException):
295295
properties = payload.get("ApplicationProperties")
296296
if not isinstance(properties, dict):
297297
raise SystemExit(3)
298-
expected_relative = os.path.relpath(app_path, os.path.dirname(path))
298+
products_root = os.path.join(os.path.dirname(path), "Products")
299+
expected_relative = os.path.relpath(app_path, products_root)
299300
if properties.get("ApplicationPath") != expected_relative:
300301
raise SystemExit(4)
301302
if properties.get("CFBundleIdentifier") != expected_bundle:

scripts/test-ios-signed-release-artifact-audit.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ profile_entitlements = {
106106
}
107107
archive = {
108108
"ApplicationProperties": {
109-
"ApplicationPath": "Products/Applications/fearless.app",
109+
"ApplicationPath": "Applications/fearless.app",
110110
"CFBundleIdentifier": bundle,
111111
"SigningIdentity": "Apple Distribution: Fearless Test ($team)",
112112
"Team": team,
@@ -264,6 +264,31 @@ mutate_plist "$ARCHIVE/Info.plist" \
264264
'value["ApplicationProperties"]["Team"] = "AAAAAAAAAA"'
265265
expect_failure wrong-archive-team "xcarchive metadata"
266266

267+
prepare_case archive-path-includes-products
268+
mutate_plist "$ARCHIVE/Info.plist" \
269+
'value["ApplicationProperties"]["ApplicationPath"] = "Products/Applications/fearless.app"'
270+
expect_failure archive-path-includes-products "xcarchive metadata"
271+
272+
prepare_case archive-path-traversal
273+
mutate_plist "$ARCHIVE/Info.plist" \
274+
'value["ApplicationProperties"]["ApplicationPath"] = "../Applications/fearless.app"'
275+
expect_failure archive-path-traversal "xcarchive metadata"
276+
277+
prepare_case archive-path-absolute
278+
mutate_plist "$ARCHIVE/Info.plist" \
279+
'value["ApplicationProperties"]["ApplicationPath"] = "/Applications/fearless.app"'
280+
expect_failure archive-path-absolute "xcarchive metadata"
281+
282+
prepare_case archive-path-wrong-app
283+
mutate_plist "$ARCHIVE/Info.plist" \
284+
'value["ApplicationProperties"]["ApplicationPath"] = "Applications/attacker.app"'
285+
expect_failure archive-path-wrong-app "xcarchive metadata"
286+
287+
prepare_case archive-path-missing
288+
mutate_plist "$ARCHIVE/Info.plist" \
289+
'del value["ApplicationProperties"]["ApplicationPath"]'
290+
expect_failure archive-path-missing "xcarchive metadata"
291+
267292
prepare_case development-identity
268293
mutate_plist "$ARCHIVE/Info.plist" \
269294
'value["ApplicationProperties"]["SigningIdentity"] = "Apple Development: Unsafe"'
@@ -377,4 +402,4 @@ assert_contains "only in the explicit test harness" "$CASE_DIR/stderr"
377402
printf '%s\n' "[ios-signed-release-audit-test] PASS (rejected): override without harness"
378403

379404
printf '%s\n' \
380-
"[ios-signed-release-audit-test] PASS: 1 positive + 27 negative/adversarial contracts"
405+
"[ios-signed-release-audit-test] PASS: 1 positive + 32 negative/adversarial contracts"

0 commit comments

Comments
 (0)