1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for asymmetric cryptographic keys
4#
5
6obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys.o
7
8asymmetric_keys-y := \
9	asymmetric_type.o \
10	restrict.o \
11	signature.o
12
13obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o
14
15#
16# X.509 Certificate handling
17#
18obj-$(CONFIG_X509_CERTIFICATE_PARSER) += x509_key_parser.o
19x509_key_parser-y := \
20	x509.asn1.o \
21	x509_akid.asn1.o \
22	x509_cert_parser.o \
23	x509_loader.o \
24	x509_public_key.o
25x509_key_parser-$(CONFIG_FIPS_SIGNATURE_SELFTEST) += selftest.o
26
27$(obj)/x509_cert_parser.o: \
28	$(obj)/x509.asn1.h \
29	$(obj)/x509_akid.asn1.h
30
31$(obj)/x509.asn1.o: $(obj)/x509.asn1.c $(obj)/x509.asn1.h
32$(obj)/x509_akid.asn1.o: $(obj)/x509_akid.asn1.c $(obj)/x509_akid.asn1.h
33
34#
35# PKCS#8 private key handling
36#
37obj-$(CONFIG_PKCS8_PRIVATE_KEY_PARSER) += pkcs8_key_parser.o
38pkcs8_key_parser-y := \
39	pkcs8.asn1.o \
40	pkcs8_parser.o
41
42$(obj)/pkcs8_parser.o: $(obj)/pkcs8.asn1.h
43$(obj)/pkcs8-asn1.o: $(obj)/pkcs8.asn1.c $(obj)/pkcs8.asn1.h
44
45clean-files	+= pkcs8.asn1.c pkcs8.asn1.h
46
47#
48# PKCS#7 message handling
49#
50obj-$(CONFIG_PKCS7_MESSAGE_PARSER) += pkcs7_message.o
51pkcs7_message-y := \
52	pkcs7.asn1.o \
53	pkcs7_parser.o \
54	pkcs7_trust.o \
55	pkcs7_verify.o
56
57$(obj)/pkcs7_parser.o: $(obj)/pkcs7.asn1.h
58$(obj)/pkcs7.asn1.o: $(obj)/pkcs7.asn1.c $(obj)/pkcs7.asn1.h
59
60#
61# PKCS#7 parser testing key
62#
63obj-$(CONFIG_PKCS7_TEST_KEY) += pkcs7_test_key.o
64pkcs7_test_key-y := \
65	pkcs7_key_type.o
66
67#
68# Signed PE binary-wrapped key handling
69#
70obj-$(CONFIG_SIGNED_PE_FILE_VERIFICATION) += verify_signed_pefile.o
71
72verify_signed_pefile-y := \
73	verify_pefile.o \
74	mscode_parser.o \
75	mscode.asn1.o
76
77$(obj)/mscode_parser.o: $(obj)/mscode.asn1.h $(obj)/mscode.asn1.h
78$(obj)/mscode.asn1.o: $(obj)/mscode.asn1.c $(obj)/mscode.asn1.h
79