|
@@ -637,6 +637,34 @@ $(BIN)/embedded.o : override CC := env CCACHE_DISABLE=1 $(CC)
|
637
|
637
|
|
638
|
638
|
CFLAGS_embedded = -DEMBED_ALL="$(EMBED_ALL)"
|
639
|
639
|
|
|
640
|
+# List of trusted root certificates
|
|
641
|
+#
|
|
642
|
+TRUSTED_LIST := $(BIN)/.trusted.list
|
|
643
|
+ifeq ($(wildcard $(TRUSTED_LIST)),)
|
|
644
|
+TRUST_OLD := <invalid>
|
|
645
|
+else
|
|
646
|
+TRUST_OLD := $(shell cat $(TRUSTED_LIST))
|
|
647
|
+endif
|
|
648
|
+ifneq ($(TRUST_OLD),$(TRUST))
|
|
649
|
+$(shell $(ECHO) "$(TRUST)" > $(TRUSTED_LIST))
|
|
650
|
+endif
|
|
651
|
+
|
|
652
|
+$(TRUSTED_LIST) :
|
|
653
|
+
|
|
654
|
+VERYCLEANUP += $(TRUSTED_LIST)
|
|
655
|
+
|
|
656
|
+# Trusted root certificate fingerprints
|
|
657
|
+#
|
|
658
|
+TRUSTED_CERTS := $(subst $(COMMA), ,$(TRUST))
|
|
659
|
+TRUSTED_FPS := $(foreach CERT,$(TRUSTED_CERTS),\
|
|
660
|
+ 0x$(subst :,$(COMMA) 0x,$(lastword $(subst =, ,\
|
|
661
|
+ $(shell $(OPENSSL) x509 -in $(CERT) -noout -sha256 \
|
|
662
|
+ -fingerprint))))$(COMMA))
|
|
663
|
+
|
|
664
|
+$(BIN)/rootcert.o : $(TRUSTED_FILES) $(TRUSTED_LIST)
|
|
665
|
+
|
|
666
|
+CFLAGS_rootcert = $(if $(TRUSTED_FPS),-DTRUSTED="$(TRUSTED_FPS)")
|
|
667
|
+
|
640
|
668
|
# Generate error usage information
|
641
|
669
|
#
|
642
|
670
|
$(BIN)/%.einfo : $(BIN)/%.o
|