mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +00:00
Pad the SHA-1 hash for Gen5 and below servers
This commit is contained in:
@@ -152,7 +152,12 @@
|
|||||||
else {
|
else {
|
||||||
challengeRespHash = [cryptoMan SHA1HashData: challengeRespHashInput];
|
challengeRespHash = [cryptoMan SHA1HashData: challengeRespHashInput];
|
||||||
}
|
}
|
||||||
NSData* challengeRespEncrypted = [cryptoMan aesEncrypt:challengeRespHash withKey:aesKey];
|
|
||||||
|
assert([challengeRespHash length] <= 32);
|
||||||
|
NSMutableData* paddedHash = [NSMutableData dataWithData:challengeRespHash];
|
||||||
|
[paddedHash setLength:32];
|
||||||
|
|
||||||
|
NSData* challengeRespEncrypted = [cryptoMan aesEncrypt:paddedHash withKey:aesKey];
|
||||||
|
|
||||||
HttpResponse* secretResp = [[HttpResponse alloc] init];
|
HttpResponse* secretResp = [[HttpResponse alloc] init];
|
||||||
[_httpManager executeRequestSynchronously:[HttpRequest requestForResponse:secretResp withUrlRequest:[_httpManager newChallengeRespRequest:challengeRespEncrypted]]];
|
[_httpManager executeRequestSynchronously:[HttpRequest requestForResponse:secretResp withUrlRequest:[_httpManager newChallengeRespRequest:challengeRespEncrypted]]];
|
||||||
|
|||||||
Reference in New Issue
Block a user