Fix inconsistent error condition
Keymaster1Engine::GetKeymaster1PublicKey may propagate an error
condition in two different ways, depending on how it fails.
If it returns nullptr the error may be set in the error parameter
or it may be in the state of openSSL. The caller of this function
would try to retrieve the error from openSSL regardless of how
it failed. This is wrong.
With this patch,GetKeymaster1PublicKey retrieves the error from
openSSL when it happens and consistently returns an error code
in the error parameter.
This patch also modifies the callers to check for errors
accordingly.
Test: ran full keystore CTS test
Change-Id: Id6f4c14657e3742d900f4e27aaf74379616c7b9c
1 file changed