Skip to content

Commit 35a2fb8

Browse files
Use hashlib.sha1 in dossier_codesiging_reader.py (#2537)
This is faster than calling out to another process and filtering. It also fixes a bug related to formatting that I ran into when running this on Linux. Signed-off-by: Brentley Jones <github@brentleyjones.com>
1 parent e428fef commit 35a2fb8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tools/dossier_codesigningtool/dossier_codesigning_reader.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import collections
6161
import concurrent.futures
6262
import glob
63+
import hashlib
6364
import io
6465
import json
6566
import os
@@ -306,9 +307,7 @@ def _parse_provisioning_profile(provisioning_profile_path):
306307

307308
def _generate_sha1(data):
308309
"""Returns the SHA1 of the data as a string in uppercase."""
309-
openssl_command = ['openssl', 'sha1']
310-
cmd_output = _execute_and_filter_output(openssl_command, inputstr=data)
311-
return cmd_output.upper().strip()
310+
return hashlib.sha1(data).hexdigest().upper()
312311

313312

314313
def _find_codesign_identities(signing_keychain=None):

0 commit comments

Comments
 (0)