Skip to content

Commit

Permalink
Unconditionally set private key in getPsiphonConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
efryntov committed Nov 12, 2024
1 parent ac7316d commit 4c5d223
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,14 @@ public String getPsiphonConfig() {
.put("RotatingSyncFrequency", 0));

// Set inproxy parameters that we stored in shared preferences earlier
String storedProxyPrivateKey = conduitServiceParameters.privateKey();
// Set only if not null, otherwise an ephemeral key will be generated internally
if (storedProxyPrivateKey != null) {
psiphonConfig.put("InproxyProxySessionPrivateKey", storedProxyPrivateKey);
}
// We trust that the parameters are valid as they were validated when they were loaded in the beginning of this method
psiphonConfig.put("InproxyProxySessionPrivateKey", conduitServiceParameters.privateKey());

int storedMaxClients = conduitServiceParameters.maxClients();
psiphonConfig.put("InproxyMaxClients", storedMaxClients);
psiphonConfig.put("InproxyMaxClients", conduitServiceParameters.maxClients());

int storedLimitUpstream = conduitServiceParameters.limitUpstreamBytes();
psiphonConfig.put("InproxyLimitUpstreamBytesPerSecond", storedLimitUpstream);
psiphonConfig.put("InproxyLimitUpstreamBytesPerSecond", conduitServiceParameters.limitUpstreamBytes());

int storedLimitDownstream = conduitServiceParameters.limitDownstreamBytes();
psiphonConfig.put("InproxyLimitDownstreamBytesPerSecond", storedLimitDownstream);
psiphonConfig.put("InproxyLimitDownstreamBytesPerSecond", conduitServiceParameters.limitDownstreamBytes());

// Convert back to json string
return psiphonConfig.toString();
Expand Down

0 comments on commit 4c5d223

Please sign in to comment.