mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
Setup: update cert signing process (#5161)
This commit is contained in:
20
setup.py
20
setup.py
@@ -9,6 +9,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import sysconfig
|
import sysconfig
|
||||||
import threading
|
import threading
|
||||||
|
import urllib.error
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import warnings
|
import warnings
|
||||||
import zipfile
|
import zipfile
|
||||||
@@ -144,15 +145,16 @@ def download_SNI() -> None:
|
|||||||
print(f"No SNI found for system spec {platform_name} {machine_name}")
|
print(f"No SNI found for system spec {platform_name} {machine_name}")
|
||||||
|
|
||||||
|
|
||||||
signtool: str | None
|
signtool: str | None = None
|
||||||
if os.path.exists("X:/pw.txt"):
|
try:
|
||||||
print("Using signtool")
|
with urllib.request.urlopen('http://192.168.206.4:12345/connector/status') as response:
|
||||||
with open("X:/pw.txt", encoding="utf-8-sig") as f:
|
html = response.read()
|
||||||
pw = f.read()
|
if b"status=OK\n" in html:
|
||||||
signtool = r'signtool sign /f X:/_SITS_Zertifikat_.pfx /p "' + pw + \
|
signtool = (r'signtool sign /sha1 6df76fe776b82869a5693ddcb1b04589cffa6faf /fd sha256 /td sha256 '
|
||||||
r'" /fd sha256 /td sha256 /tr http://timestamp.digicert.com/ '
|
r'/tr http://timestamp.digicert.com/ ')
|
||||||
else:
|
print("Using signtool")
|
||||||
signtool = None
|
except (ConnectionError, TimeoutError, urllib.error.URLError) as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
build_platform = sysconfig.get_platform()
|
build_platform = sysconfig.get_platform()
|
||||||
|
Reference in New Issue
Block a user