[LTP] [PATCH v2 1/3] lib: Merge security related sources
Cyril Hrubis
chrubis@suse.cz
Tue Mar 26 11:24:16 CET 2024
Hi!
> Merge FIPS and lockdown related library sources to new tst_security.[ch]
> file to shorten number of the files in the library. More security
> related code will be added in next commit.
Sound good.
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> changes v1->v2:
> * New commit: lib: Merge security related sources
>
> I'll send more cleanup in a different patchset.
>
> Kind regards,
> Petr
>
> include/tst_fips.h | 15 ------
> include/tst_lockdown.h | 11 ----
> include/tst_security.h | 17 ++++++
> include/tst_test.h | 4 +-
> lib/tst_fips.c | 24 ---------
> lib/{tst_lockdown.c => tst_security.c} | 73 +++++++++++++++-----------
> 6 files changed, 62 insertions(+), 82 deletions(-)
> delete mode 100644 include/tst_fips.h
> delete mode 100644 include/tst_lockdown.h
> create mode 100644 include/tst_security.h
> delete mode 100644 lib/tst_fips.c
> rename lib/{tst_lockdown.c => tst_security.c} (86%)
>
> diff --git a/include/tst_fips.h b/include/tst_fips.h
> deleted file mode 100644
> index 881c32391..000000000
> --- a/include/tst_fips.h
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Copyright (c) 2021 Petr Vorel <pvorel@suse.cz>
> - */
> -
> -#ifndef TST_FIPS_H__
> -#define TST_FIPS_H__
> -
> -/*
> - * Detect whether FIPS enabled
> - * @return 0: FIPS not enabled, 1: FIPS enabled
> - */
> -int tst_fips_enabled(void);
> -
> -#endif /* TST_FIPS_H__ */
> diff --git a/include/tst_lockdown.h b/include/tst_lockdown.h
> deleted file mode 100644
> index 07e90c1af..000000000
> --- a/include/tst_lockdown.h
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later
> - * Copyright (c) Linux Test Project, 2020-2021
> - */
> -
> -#ifndef TST_LOCKDOWN_H
> -#define TST_LOCKDOWN_H
> -
> -int tst_secureboot_enabled(void);
> -int tst_lockdown_enabled(void);
> -
> -#endif /* TST_LOCKDOWN_H */
> diff --git a/include/tst_security.h b/include/tst_security.h
> new file mode 100644
> index 000000000..438b16dbb
> --- /dev/null
> +++ b/include/tst_security.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later
> + * Copyright (c) Linux Test Project, 2020-2024
> + */
> +
> +#ifndef TST_SECURITY_H__
> +#define TST_SECURITY_H__
> +
> +/*
> + * Detect whether FIPS enabled
> + * @return 0: FIPS not enabled, 1: FIPS enabled
> + */
> +int tst_fips_enabled(void);
> +
> +int tst_lockdown_enabled(void);
> +int tst_secureboot_enabled(void);
> +
> +#endif /* TST_SECURITY_H__ */
> diff --git a/include/tst_test.h b/include/tst_test.h
> index 47b5902f9..98d74d82e 100644
> --- a/include/tst_test.h
> +++ b/include/tst_test.h
> @@ -40,8 +40,8 @@
> #include "tst_capability.h"
> #include "tst_hugepage.h"
> #include "tst_assert.h"
> -#include "tst_lockdown.h"
> -#include "tst_fips.h"
> +#include "tst_security.h"
> +#include "tst_security.h"
Huh, included twice?
Other than that:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list