Fixing passing pointer to uninitialized object.

There was a bug in the code for extracting the raw EC public key x and y
coordinates from the certificate retrieved from keymaster. Two boringssl
BIGNUM objects were declared on the stack with pointers passed in
directly to a function without the objects first being initialized. This
went undetected in Cuttlefish, but predictably caused KM on Trusty to
attempt to access a memory page it didn't own.

This patch also fixes a pair of memory leaks and cleans up the memory
management.

Bug: 192199094
Test: atest VtsHalRemotelyProvisionedComponentTargetTests
Change-Id: Ic513dc9fc2146ef0c131f04088f1d25c9963bc2a
Merged-In: Ic513dc9fc2146ef0c131f04088f1d25c9963bc2a
1 file changed