summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2013-02-13 15:58:46 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-02-13 15:58:46 -0800
commit76e694172a16e346ff2ce783c3768176bd351319 (patch)
tree2cd86447312d10fcc1cfc874dc78373a391847ae
parent9b0aa6c906b22a91440ef5b980f6294c3dd42348 (diff)
parent8ab767786a3b59c72b613f84d40b181428327ac1 (diff)
downloadframeworks_base-76e694172a16e346ff2ce783c3768176bd351319.zip
frameworks_base-76e694172a16e346ff2ce783c3768176bd351319.tar.gz
frameworks_base-76e694172a16e346ff2ce783c3768176bd351319.tar.bz2
am 8ab76778: Merge "KeyChain: return null instead of throw"
# Via Gerrit Code Review (1) and Kenny Root (1) * commit '8ab767786a3b59c72b613f84d40b181428327ac1': KeyChain: return null instead of throw
-rw-r--r--keystore/java/android/security/KeyChain.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java
index 31c38d5..d7119fff 100644
--- a/keystore/java/android/security/KeyChain.java
+++ b/keystore/java/android/security/KeyChain.java
@@ -336,7 +336,12 @@ public final class KeyChain {
KeyChainConnection keyChainConnection = bind(context);
try {
IKeyChainService keyChainService = keyChainConnection.getService();
- byte[] certificateBytes = keyChainService.getCertificate(alias);
+
+ final byte[] certificateBytes = keyChainService.getCertificate(alias);
+ if (certificateBytes == null) {
+ return null;
+ }
+
TrustedCertificateStore store = new TrustedCertificateStore();
List<X509Certificate> chain = store
.getCertificateChain(toCertificate(certificateBytes));