diff options
author | Garret Kelly <gdk@google.com> | 2019-05-21 15:18:20 -0400 |
---|---|---|
committer | Garret Kelly <gdk@google.com> | 2019-05-21 15:19:34 -0400 |
commit | 33b5e38acfce52b537bf82e3f5d3cadf6e627976 (patch) | |
tree | 2c4ea6f287be23d742aa74c73c6956a8efc043a0 | |
parent | 53ef156e633540c9732cab949930e3c4df74eaa3 (diff) | |
download | android-33b5e38acfce52b537bf82e3f5d3cadf6e627976.tar.gz |
keymaster: Fix callback invocations
Fix a pair of sites where a HIDL callback is being invoked potentially
more than once, or invalid data is being after an error has already been
reported to the caller.
Bug: None
Test: None
Signed-off-by: Garret Kelly <gdk@google.com>
Change-Id: Ifd8e5d8c30705485a9a1ff191a80f1ae9c2d751a
-rw-r--r-- | hals/keymaster/KeymasterDevice.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hals/keymaster/KeymasterDevice.cpp b/hals/keymaster/KeymasterDevice.cpp index 61614e9..c312262 100644 --- a/hals/keymaster/KeymasterDevice.cpp +++ b/hals/keymaster/KeymasterDevice.cpp @@ -346,6 +346,7 @@ Return<void> KeymasterDevice::getHmacSharingParameters( if (ec != ErrorCode::OK) { _hidl_cb(ec, HmacSharingParameters()); + return Void(); } const std::string & nonce = response.hmac_sharing_params().nonce(); @@ -717,6 +718,7 @@ Return<void> KeymasterDevice::attestKey( ::strftime(not_after_str, sizeof(not_after_str), "%y%m%d%H%M%SZ", gmtime(¬_after)) == 0) { _hidl_cb(ErrorCode::UNKNOWN_ERROR, hidl_vec<hidl_vec<uint8_t> >{}); + return Void(); } startRequest.mutable_blob()->set_blob(&keyToAttest[0], keyToAttest.size()); |