Allow no digest given to imply KM_DIGEST_NONE if it was authorized

The KM1 legacy support wrapper was to strict in requiring a digest to be
specified whey the requested purpose and padding combination did not
require a digest.

This patch allows no digest given to imply KM_DIGEST_NONE if
KM_DIGEST_NONE was authorized.

Also fixes a bug where key data was not correctly initialized in the
rsa_keymaster1_operation when KM_PAD_NONE was requested.

Bug: 77228204
Test: atest android.keystore.cts.KeyPairGeneratorTest#testGenerate_RSA_ModernSpec_UsableForTLSPeerAuth
Change-Id: Ia3278a5afb751d5be191b73c4bb04e3fe1f5586a
(cherry picked from commit f73092fa0228f4efabca948c7c7ce92579384424)
2 files changed