Commit e45108ec authored by Eric Biggers's avatar Eric Biggers
Browse files

ANDROID: fips140: block crypto operations until tests complete



As per the new guidance from the lab, the module must block crypto
operations until the tests have completed.  It's unclear what this means
exactly (given that technically this is impossible), but let's make some
changes that should be enough to comply with the requirement's intent.

First, register the library functions and update the live algorithms
after the tests rather than before the tests.  This is a trivial change.

Much more problematic is the fact that the algorithms are registered
with the kernel's crypto framework before the tests run, as the tests
depend on the framework.  Unfortunately, the lab believes that the
kernel isn't allowed to enforce the ordering here; the module itself
must.  Moreover, trying to solve this by copying the crypto API
framework into the module proved to be heavily problematic.

Thus, implement an alternate solution: make the module override the tfm
initialization function of every algorithm it registers, so that it can
wait for the tests to complete before allowing the use of any algorithm.
This is sufficient if the user makes a supported sequence of API calls.

Bug: 153614920
Bug: 188620248
Change-Id: I11ffba90c08114dda4e91c4be7ce8b608c4e14c1
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
(cherry picked from commit 02e48f38)
parent 6b995f5a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment