Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packaging/mas/submit_for_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import requests
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
from cryptography.hazmat.primitives.serialization import load_pem_private_key

API = "https://api.appstoreconnect.apple.com/v1"
Expand All @@ -49,7 +50,7 @@ def _b64(data: bytes) -> str:

key = load_pem_private_key(key_pem, password=None)
der_sig = key.sign(segments.encode(), ec.ECDSA(hashes.SHA256()))
r, s = ec.utils.decode_dss_signature(der_sig)
r, s = decode_dss_signature(der_sig)
raw_sig = r.to_bytes(32, "big") + s.to_bytes(32, "big")
return segments + "." + _b64(raw_sig)

Expand Down
Loading