Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ jobs:
uses: hugo19941994/delete-draft-releases@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete existing tag if exist
uses: ClementTsang/delete-tag-and-release@v0.3.1
continue-on-error: true
with:
tag_name: v${{ env.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand Down
14 changes: 12 additions & 2 deletions endpoint/register/pypush_gsa_icloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def icloud_login_mobileme(username='', password=''):
password = getpass('Password: ')

g = gsa_authenticate(username, password)
if not g:
raise Exception("Authentication failed. Please verify your Apple ID and password.")
pet = g["t"]["com.apple.gs.idms.pet"]["token"]
adsid = g["adsid"]

Expand Down Expand Up @@ -82,9 +84,17 @@ def gsa_authenticate(username, password):
r = gsa_authenticated_request(
{"A2k": a, "ps": ["s2k", "s2k_fo"], "u": username, "o": "init"})

if "Status" in r and r["Status"].get("ec", 0) != 0:
logger.error(f"Authentication initialization failed: {r['Status'].get('em', 'Unknown error')} (ec: {r['Status'].get('ec')})")
return None

if "sp" not in r:
logger.error("Authentication initialization failed: Server response did not contain SRP parameters.")
return None

if r["sp"] not in ["s2k", "s2k_fo"]:
logger.warning(f"This implementation only supports s2k and sk2_fo. Server returned {r['sp']}")
return
return None

# Change the password out from under the SRP library, as we couldn't calculate it without the salt.
usr.p = encrypt_password(password, r["s"], r["i"], r["sp"])
Expand Down Expand Up @@ -144,7 +154,7 @@ def gsa_authenticated_request(parameters):
"Content-Type": "text/x-xml-plist",
"Accept": "*/*",
"User-Agent": "akd/1.0 CFNetwork/978.0.7 Darwin/18.7.0",
"X-MMe-Client-Info": '<MacBookPro18,3> <Mac OS X;13.4.1;22F8> <com.apple.AOSKit/282 (com.apple.dt.Xcode/3594.4.19)>'
"X-MMe-Client-Info": '<MacBookPro18,3> <Mac OS X;13.4.1;22F8> <com.apple.AuthKit/1 (com.apple.akd/1.0)>'
}

with requests.post(
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
2.7.3-DEV