Truncate too-long digests for keymaster 0 ECDSA sign operations
BoringSSL doesn't pre-truncate too-long digests before calling the ECDSA
sign operation via the ENGINE interface, and TrustyKeymaster is picky
about accepting them. This means that trying to sign a message with,
say, a 256-bit key and a 384-bit hash fails on Volantis.
This CL also corrects an error in get_supported_digests for ECDSA, which
was advertising support for MD5. BoringSSL doesn't support ECDSA with
MD5 and we're not offering it in the JCA API, so the solution is simply
not to advertise it and to return a better error code if it's requested
anyway.
Bug: 22355708
Change-Id: Iba2dad6953db7eda23951760b734f499a13c5191
3 files changed