Support pending CompOS keys.
When CompOS generates new artifacts it may also need to generate a new
keypair. Modify odsign to account for this. It needs to start up
CompOS to find out if the pending key is now the correct one; if so it
replaces the existing key, otherwise we keep the current key (if there
is one).
The pending keys are stored in /data/misc/apexdata/com.android.compos
since they are created & written by CompOS.
Fixed another RsaPublicKey bug.
Bug: 190166662
Test: Manual: No keys at all, no pending key, valid pending key, invalid pending key.
Change-Id: I17871b1e59380d037d71e8065f4cad699374ecaf
diff --git a/ondevice-signing/FakeCompOs.cpp b/ondevice-signing/FakeCompOs.cpp
index e2273a3..cd54e28 100644
--- a/ondevice-signing/FakeCompOs.cpp
+++ b/ondevice-signing/FakeCompOs.cpp
@@ -231,5 +231,5 @@
std::string signatureString(reinterpret_cast<char*>(signature.value().data()),
signature.value().size());
std::string dataString(reinterpret_cast<char*>(data.data()), data.size());
- return verifySignature(dataString, signatureString, publicKey);
+ return verifyRsaPublicKeySignature(dataString, signatureString, publicKey);
}