mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Ignore reported pairing state if pinned cert is not found
This commit is contained in:
parent
a1b58ab2fc
commit
f7bfa63145
@ -256,13 +256,9 @@ public class NvHTTP {
|
|||||||
|
|
||||||
// This may be null, but that's okay
|
// This may be null, but that's okay
|
||||||
details.remoteAddress = getXmlString(serverInfo, "ExternalIP");
|
details.remoteAddress = getXmlString(serverInfo, "ExternalIP");
|
||||||
|
|
||||||
try {
|
// This has some extra logic to always report unpaired if the pinned cert isn't there
|
||||||
details.pairState = Integer.parseInt(getXmlString(serverInfo, "PairStatus")) == 1 ?
|
details.pairState = getPairState(serverInfo);
|
||||||
PairState.PAIRED : PairState.NOT_PAIRED;
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
details.pairState = PairState.FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
details.runningGameId = getCurrentGame(serverInfo);
|
details.runningGameId = getCurrentGame(serverInfo);
|
||||||
@ -362,11 +358,20 @@ public class NvHTTP {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PairingManager.PairState getPairState() throws IOException, XmlPullParserException {
|
public PairingManager.PairState getPairState() throws IOException, XmlPullParserException {
|
||||||
return pm.getPairState(getServerInfo());
|
return getPairState(getServerInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
public PairingManager.PairState getPairState(String serverInfo) throws IOException, XmlPullParserException {
|
public PairingManager.PairState getPairState(String serverInfo) throws IOException, XmlPullParserException {
|
||||||
return pm.getPairState(serverInfo);
|
// If we don't have a server cert, we can't be paired even if the host thinks we are
|
||||||
|
if (serverCert == null) {
|
||||||
|
return PairState.NOT_PAIRED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!NvHTTP.getXmlString(serverInfo, "PairStatus").equals("1")) {
|
||||||
|
return PairState.NOT_PAIRED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return PairState.PAIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getMaxLumaPixelsH264(String serverInfo) throws XmlPullParserException, IOException {
|
public long getMaxLumaPixelsH264(String serverInfo) throws XmlPullParserException, IOException {
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
package com.limelight.nvstream.http;
|
package com.limelight.nvstream.http;
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import javax.crypto.ShortBufferException;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@ -177,14 +173,6 @@ public class PairingManager {
|
|||||||
r.nextInt(10), r.nextInt(10),
|
r.nextInt(10), r.nextInt(10),
|
||||||
r.nextInt(10), r.nextInt(10));
|
r.nextInt(10), r.nextInt(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
public PairState getPairState(String serverInfo) throws IOException, XmlPullParserException {
|
|
||||||
if (!NvHTTP.getXmlString(serverInfo, "PairStatus").equals("1")) {
|
|
||||||
return PairState.NOT_PAIRED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return PairState.PAIRED;
|
|
||||||
}
|
|
||||||
|
|
||||||
public X509Certificate getPairedCert() {
|
public X509Certificate getPairedCert() {
|
||||||
return serverCert;
|
return serverCert;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user