Skip to content

Commit

Permalink
Merge "Switch Base64 decoder implementation used in harmony SSL tests"
Browse files Browse the repository at this point in the history
am: ed56a64

Change-Id: I250e99c9b05b88eabad302aa848b5ac87ad162fe
  • Loading branch information
15characterlimi authored and android-build-merger committed Dec 2, 2016
2 parents 9ce8dff + ed56a64 commit 7ad34f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.Base64;
import javax.net.ssl.HandshakeCompletedEvent;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.KeyManager;
Expand All @@ -39,7 +40,6 @@
import javax.net.ssl.X509TrustManager;
import javax.security.cert.X509Certificate;
import junit.framework.TestCase;
import libcore.io.Base64;
import org.apache.harmony.xnet.tests.support.mySSLSession;

/**
Expand Down Expand Up @@ -535,7 +535,7 @@ public X509Certificate[] getChain() {
* for the result.
*/
private KeyManager[] getKeyManagers(String keys) throws Exception {
byte[] bytes = Base64.decode(keys.getBytes());
byte[] bytes = Base64.getDecoder().decode(keys.getBytes());
InputStream inputStream = new ByteArrayInputStream(bytes);

KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@

import junit.framework.TestCase;

import libcore.io.Base64;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Base64;

import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
Expand Down Expand Up @@ -391,7 +390,7 @@ public void test_WantClientAuth() throws Exception {
*/
private KeyManager[] getKeyManagers() throws Exception {
String keys = (useBKS ? SERVER_KEYS_BKS : SERVER_KEYS_JKS);
byte[] bytes = Base64.decode(keys.getBytes());
byte[] bytes = Base64.getDecoder().decode(keys.getBytes());
InputStream inputStream = new ByteArrayInputStream(bytes);

KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Base64;

import javax.net.ssl.ExtendedSSLSession;
import javax.net.ssl.KeyManager;
Expand All @@ -42,7 +43,6 @@
import org.apache.harmony.tests.javax.net.ssl.HandshakeCompletedEventTest.TestTrustManager;

import junit.framework.TestCase;
import libcore.io.Base64;
import libcore.java.security.StandardNames;

public class SSLSessionTest extends TestCase {
Expand Down Expand Up @@ -643,7 +643,7 @@ public KeyStore getStore() {
* for the result.
*/
private KeyStore getKeyStore(String keys) throws Exception {
byte[] bytes = Base64.decode(keys.getBytes());
byte[] bytes = Base64.getDecoder().decode(keys.getBytes());
InputStream inputStream = new ByteArrayInputStream(bytes);

KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.security.KeyStore;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Base64;
import javax.net.ssl.HandshakeCompletedEvent;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.KeyManager;
Expand All @@ -35,7 +36,6 @@
import javax.net.ssl.TrustManager;
import javax.security.cert.X509Certificate;
import junit.framework.TestCase;
import libcore.io.Base64;
import libcore.java.security.StandardNames;
import org.apache.harmony.tests.javax.net.ssl.HandshakeCompletedEventTest.TestTrustManager;

Expand Down Expand Up @@ -587,7 +587,7 @@ public X509Certificate[] getChain() {
* for the result.
*/
private KeyManager[] getKeyManagers(String keys) throws Exception {
byte[] bytes = Base64.decode(keys.getBytes());
byte[] bytes = Base64.getDecoder().decode(keys.getBytes());
InputStream inputStream = new ByteArrayInputStream(bytes);

KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
Expand Down

0 comments on commit 7ad34f2

Please sign in to comment.