From 0ce8c912405812b12b188a4e12c7b4a261615cfc Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Wed, 26 Apr 2023 09:44:26 -0400 Subject: [PATCH] Allow sha1 --- cmake/sign_dmg.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/sign_dmg.py b/cmake/sign_dmg.py index 71cdeabc..deb7a743 100644 --- a/cmake/sign_dmg.py +++ b/cmake/sign_dmg.py @@ -16,8 +16,9 @@ import click @click.command() @click.option('--input-dmg', required=True, help='Path to the input DMG file.') @click.option('--output-dmg', required=True, help='Path to the output signed DMG file.') -@click.option('--signing-identity', required=True, help='Signing identity (Developer ID Installer).') -def sign_dmg(input_dmg, output_dmg, signing_identity): +@click.option('--sha1-hash', help='SHA-1 hash of the Developer ID Installer certificate') +@click.option('--signing-identity', help='Signing identity (Developer ID Installer).') +def sign_dmg(input_dmg: str, output_dmg: str, signing_identity: str, sha1_hash: Optional[str]) -> None: # Mount the input DMG mount_point = tempfile.mkdtemp() subprocess.run(['hdiutil', 'attach', input_dmg, '-mountpoint', mount_point]) @@ -47,7 +48,7 @@ def sign_dmg(input_dmg, output_dmg, signing_identity): '--verbose', '--options', 'runtime', '--timestamp', - '--sign', signing_identity, + '--sign', sha1_hash or signing_identity, app_bundle ], check=True) except subprocess.CalledProcessError as e: