Fix cryptfs RSA signing with keystore2
Fix KeymasterOperation::updateCompletely() to not treat an empty output
as an error, since for RSA signing (used by cryptfs / FDE) it is
expected that the output from update() be empty. The output is instead
produced at the end by finish().
This is one of a set of changes that is needed to get FDE working again
so that devices that launched with FDE can be upgraded to Android 12.
Bug: 186165644
Change-Id: Icf120f8b9526d051d0ebe16bc8ad1edf712241e1
diff --git a/Keymaster.cpp b/Keymaster.cpp
index bb26b64..08e06d1 100644
--- a/Keymaster.cpp
+++ b/Keymaster.cpp
@@ -81,14 +81,7 @@
ks2Operation = nullptr;
return false;
}
-
- if (!output) {
- LOG(ERROR) << "Keystore2 operation update didn't return output.";
- ks2Operation = nullptr;
- return false;
- }
-
- consumer((const char*)output->data(), output->size());
+ if (output) consumer((const char*)output->data(), output->size());
}
return true;
}