diff options
author | Kenny Root <kroot@google.com> | 2013-02-13 16:02:04 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-02-13 16:02:04 -0800 |
commit | 3795f510d313077308a065ae1fe15252d0e6d8b3 (patch) | |
tree | 948153d65d60dfc54981d9d2e7c22ef7908f99a8 | |
parent | a7d72dfded3437e05c303dc40d61248022eb048b (diff) | |
parent | 76e694172a16e346ff2ce783c3768176bd351319 (diff) | |
download | frameworks_base-3795f510d313077308a065ae1fe15252d0e6d8b3.zip frameworks_base-3795f510d313077308a065ae1fe15252d0e6d8b3.tar.gz frameworks_base-3795f510d313077308a065ae1fe15252d0e6d8b3.tar.bz2 |
am 76e69417: am 8ab76778: Merge "KeyChain: return null instead of throw"
# Via Android Git Automerger (1) and others
* commit '76e694172a16e346ff2ce783c3768176bd351319':
KeyChain: return null instead of throw
-rw-r--r-- | keystore/java/android/security/KeyChain.java | 7 |
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)); |