diff options
author | Seth Moore <sethmo@google.com> | 2021-05-07 03:37:24 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-07 03:37:24 +0000 |
commit | 7ac158fda828553e168c7358becb95a2c238545a (patch) | |
tree | be7c9823ce8b8189c01d1d432200f7ac5fb722c9 /keystore | |
parent | 5e024acb23d75d0d739d5345f82f6796b65b5659 (diff) | |
parent | 85d779c4a47f85bebef0d9d80eda06d860242d93 (diff) |
Merge "Don't re-wrap DeviceIdAttestationExceptions" am: 27bc799e7e am: 02359c00d6 am: 85d779c4a4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1698089
Change-Id: I9aefcc9b3b93a37437885d7e6fb1a8d9734b3dd1
Diffstat (limited to 'keystore')
-rw-r--r-- | keystore/java/android/security/keystore/AttestationUtils.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/keystore/java/android/security/keystore/AttestationUtils.java b/keystore/java/android/security/keystore/AttestationUtils.java index 66d842ec5614..4da2a28fffc3 100644 --- a/keystore/java/android/security/keystore/AttestationUtils.java +++ b/keystore/java/android/security/keystore/AttestationUtils.java @@ -260,6 +260,11 @@ public abstract class AttestationUtils { } catch (SecurityException e) { throw e; } catch (Exception e) { + // If a DeviceIdAttestationException was previously wrapped with some other type, + // let's throw the original exception instead of wrapping it yet again. + if (e.getCause() instanceof DeviceIdAttestationException) { + throw (DeviceIdAttestationException) e.getCause(); + } throw new DeviceIdAttestationException("Unable to perform attestation", e); } } |