store ls secret as b64

This commit is contained in:
zzz
2019-05-29 11:53:55 +00:00
parent 973aab8f53
commit a3fe7467c3
4 changed files with 12 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ import net.i2p.I2PAppContext;
import net.i2p.I2PException;
import net.i2p.client.I2PClient;
import net.i2p.crypto.SigType;
import net.i2p.data.Base64;
import net.i2p.data.DataHelper;
import net.i2p.data.Destination;
import net.i2p.data.Hash;
@@ -596,7 +597,12 @@ public class GeneralHelper {
* @since 0.9.40
*/
public String getBlindedPassword(int tunnel) {
return getProperty(tunnel, "i2cp.leaseSetSecret", "");
String rv = getProperty(tunnel, "i2cp.leaseSetSecret", null);
if (rv != null)
rv = DataHelper.getUTF8(Base64.decode(rv));
if (rv == null)
rv = "";
return rv;
}
/**

View File

@@ -277,7 +277,7 @@ public class TunnelConfig {
/** @since 0.9.40 */
public void setBlindedPassword(String s) {
if (s != null && s.length() > 0)
_otherOptions.put("i2cp.leaseSetSecret", s);
_otherOptions.put("i2cp.leaseSetSecret", Base64.encode(DataHelper.getUTF8(s.trim())));
else
_otherOptions.remove("i2cp.leaseSetSecret");
}