VtsKernelEncryptionTest: fix skip condition for wrapped key test

TestAesInlineCryptOptimizedHwWrappedKeyPolicy can't run if the device's
inline encryption hardware doesn't support 64-bit DUNs, even if it
otherwise supports wrapped keys.  We can detect this case by checking if
creating a file in the encrypted directory fails with EINVAL.  (See
setup_per_mode_enc_key() in the Android common kernels.)

While fixing this, tighten the checks in SetEncryptionPolicy() so that
we only allow the tests to be skipped in the expected ways.

Bug: 144046242
Bug: 153730132
Test: I don't have the hardware to properly test this, but there's no
      regression in 'atest vts_kernel_encryption_test' on Cuttlefish.
      Also tested on one other device.
Change-Id: I48c69d81a58d1edf27c6a37fc30d91e21e76a530
1 file changed