Skip to content

Commit

Permalink
certs: unify blacklist_hashes.c and blacklist_nohashes.c
Browse files Browse the repository at this point in the history
These two files are very similar. Unify them.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Mickaël Salaün <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
masahir0y committed Jul 27, 2022
1 parent 9008a67 commit 31f6d95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
12 changes: 5 additions & 7 deletions certs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@
#

obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o blacklist_hashes.o
obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o
ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),)

$(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list
CFLAGS_blacklist_hashes.o := -I $(obj)

quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@
cmd_check_and_copy_blacklist_hash_list = \
$(if $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST), \
$(AWK) -f $(srctree)/$(src)/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \
cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@
{ cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST); echo $(comma) NULL; } > $@, \
echo NULL > $@)

$(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE
$(call if_changed,check_and_copy_blacklist_hash_list)
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o
else
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o
endif

targets += blacklist_hash_list

quiet_cmd_extract_certs = CERT $@
Expand Down
1 change: 0 additions & 1 deletion certs/blacklist_hashes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

const char __initconst *const blacklist_hashes[] = {
#include "blacklist_hash_list"
, NULL
};
6 changes: 0 additions & 6 deletions certs/blacklist_nohashes.c

This file was deleted.

0 comments on commit 31f6d95

Please sign in to comment.