ANDROID: fips140: add userspace interface for evaluation testing
The FIPS lab is required to test the service indicators and version information services of the module, i.e. the fips140_is_approved_service() and fips140_module_version() functions. There are several ways we could support this: - Implement the tests in the module ourselves. However it's unclear that CMVP would allow this, and we would need the full list of tests, which could change over time depending on what the lab decides to do. - Support the lab writing, building, and loading a custom kernel module (or a custom kernel image) that tests these functions. - Provide a userspace interface to these services, restricted to builds with CONFIG_CRYPTO_FIPS140_MOD_EVAL_TESTING=y. This would allow writing the tests in userspace, which would be much easier. Implement the last solution, since it's the easier of the two solutions that are "guaranteed" to be allowed. Make the module register a char device which supports some ioctls, one per function that needs to be tested. Also provide some sample userspace code in samples/crypto/. Note: copy_to_user() would break the integrity check, so take some care to exclude it. This is allowed since this is non-production code. Bug: 188620248 Change-Id: Ic256d9c5bd4d0c57ede88a3e3e76e89554909b38 Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
@@ -71,6 +71,7 @@ SECTIONS {
|
||||
*(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)
|
||||
__cfi_jt_end = .;
|
||||
*(.text.._end)
|
||||
*(.text.._fips140_unchecked)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user