summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-22 12:02:39 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-22 12:02:39 -0400
commit5b4aa6db428263aa0a48ab3efb896df66a852bce (patch)
treead3188045edea2fa89842e61d75e46c27b8c035e /packages
parent585c67f70f18b8879ced854c5865141d6c650cd8 (diff)
parent6ee4e59c1d10a80d0b873a1e93108b85c283323a (diff)
downloadframeworks_base-5b4aa6db428263aa0a48ab3efb896df66a852bce.zip
frameworks_base-5b4aa6db428263aa0a48ab3efb896df66a852bce.tar.gz
frameworks_base-5b4aa6db428263aa0a48ab3efb896df66a852bce.tar.bz2
Merge change 26315 into eclair
* changes: VpnService: use Credentials instead of CertTool.
Diffstat (limited to 'packages')
-rw-r--r--packages/VpnServices/src/com/android/server/vpn/L2tpIpsecService.java23
1 files changed, 5 insertions, 18 deletions
diff --git a/packages/VpnServices/src/com/android/server/vpn/L2tpIpsecService.java b/packages/VpnServices/src/com/android/server/vpn/L2tpIpsecService.java
index 13b4952..9909905 100644
--- a/packages/VpnServices/src/com/android/server/vpn/L2tpIpsecService.java
+++ b/packages/VpnServices/src/com/android/server/vpn/L2tpIpsecService.java
@@ -17,7 +17,7 @@
package com.android.server.vpn;
import android.net.vpn.L2tpIpsecProfile;
-import android.security.CertTool;
+import android.security.Credentials;
import java.io.IOException;
@@ -30,16 +30,18 @@ class L2tpIpsecService extends VpnService<L2tpIpsecProfile> {
@Override
protected void connect(String serverIp, String username, String password)
throws IOException {
+ L2tpIpsecProfile p = getProfile();
// IPSEC
DaemonProxy ipsec = startDaemon(IPSEC);
ipsec.sendCommand(serverIp, L2tpService.L2TP_PORT,
- getUserkeyPath(), getUserCertPath(), getCaCertPath());
+ Credentials.USER_PRIVATE_KEY + p.getUserCertificate(),
+ Credentials.USER_CERTIFICATE + p.getUserCertificate(),
+ Credentials.CA_CERTIFICATE + p.getCaCertificate());
ipsec.closeControlSocket();
sleep(2000); // 2 seconds
// L2TP
- L2tpIpsecProfile p = getProfile();
MtpdHelper.sendCommand(this, L2tpService.L2TP_DAEMON, serverIp,
L2tpService.L2TP_PORT,
(p.isSecretEnabled() ? p.getSecretString() : null),
@@ -51,19 +53,4 @@ class L2tpIpsecService extends VpnService<L2tpIpsecProfile> {
stopDaemon(IPSEC);
stopDaemon(MtpdHelper.MTPD);
}
-
- private String getCaCertPath() {
- return CertTool.getInstance().getCaCertificate(
- getProfile().getCaCertificate());
- }
-
- private String getUserCertPath() {
- return CertTool.getInstance().getUserCertificate(
- getProfile().getUserCertificate());
- }
-
- private String getUserkeyPath() {
- return CertTool.getInstance().getUserPrivateKey(
- getProfile().getUserCertificate());
- }
}