Use correct error code for rate limiting.

Note that this CL depends on cl 712195, which must be submitted first.

Bug: 21607106
Change-Id: Iafc42d1c8a1145a31ea252b33b404044f92ec62b
This commit is contained in:
Shawn Willden 2015-06-18 12:26:59 -06:00
parent da6e899f4e
commit 0417060e8e

View file

@ -350,7 +350,7 @@ static int keymaster_sign_object(struct crypt_mnt_ftr *ftr,
keymaster_error_t error = keymaster1_dev->begin(keymaster1_dev, KM_PURPOSE_SIGN, &key,
&param_set, NULL /* out_params */,
&op_handle);
if (error == KM_ERROR_VERIFICATION_FAILED) {
if (error == KM_ERROR_KEY_RATE_LIMIT_EXCEEDED) {
// Key usage has been rate-limited. Wait a bit and try again.
sleep(KEYMASTER_CRYPTFS_RATE_LIMIT);
error = keymaster1_dev->begin(keymaster1_dev, KM_PURPOSE_SIGN, &key,