diff options
| author | Shawn Willden <swillden@google.com> | 2015-08-13 20:34:21 -0600 |
|---|---|---|
| committer | Shawn Willden <swillden@google.com> | 2015-08-13 20:37:17 -0600 |
| commit | 3fceedc788498733952279a97944f4ea22892577 (patch) | |
| tree | cfb723b0d693acb33bceeaa8f66ae660a446ca9c | |
| parent | d599b15c0693950bdc72fb867872044fdc484ef5 (diff) | |
| download | android_system_keymaster-3fceedc788498733952279a97944f4ea22892577.tar.gz android_system_keymaster-3fceedc788498733952279a97944f4ea22892577.tar.bz2 android_system_keymaster-3fceedc788498733952279a97944f4ea22892577.zip | |
Hack to work around broken bullhead keymaster app.
Bug: 23193626
Change-Id: I71564a7ff6b3050c5fbb7bd0c12caca5a663334a
| -rw-r--r-- | soft_keymaster_device.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/soft_keymaster_device.cpp b/soft_keymaster_device.cpp index 9f3418e..6ffa6f8 100644 --- a/soft_keymaster_device.cpp +++ b/soft_keymaster_device.cpp @@ -73,6 +73,14 @@ static keymaster_error_t add_digests(keymaster1_device_t* dev, keymaster_algorit keymaster_digest_t* digests; size_t digests_length; + if (algorithm == KM_ALGORITHM_RSA && + (purpose == KM_PURPOSE_ENCRYPT || purpose == KM_PURPOSE_DECRYPT)) { + // Temporary hack: On bullhead there's a problem with the keymaster app. It rejects + // requests for digests for RSA and purpose ENCRYPT or DECRYPT. Since the result is the + // same as for SIGN or VERIFY, we just ask for SIGN in this case. + // TODO(swillden): Remove this hack when bullhead's keymaster is fixed. + purpose = KM_PURPOSE_SIGN; + } keymaster_error_t error = dev->get_supported_digests(dev, algorithm, purpose, &digests, &digests_length); if (error != KM_ERROR_OK) { |
