blob: b729824df3c8bad30297c66f3cc1339b333d6575 [file] [log] [blame]
AKASHI Takahirocbb10072019-11-13 09:44:58 +09001# SPDX-License-Identifier: GPL-2.0+
2#
3# Makefile for asymmetric cryptographic keys
4#
5
Simon Glass86adc2e2024-09-29 19:49:53 -06006obj-$(CONFIG_$(XPL_)ASYMMETRIC_KEY_TYPE) += asymmetric_keys.o
AKASHI Takahirocbb10072019-11-13 09:44:58 +09007
8asymmetric_keys-y := asymmetric_type.o
9
Tom Rinif5bea562024-10-14 13:34:06 -060010obj-$(CONFIG_$(XPL_)ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key_helper.o
11obj-$(CONFIG_$(XPL_)ASYMMETRIC_PUBLIC_KEY_LEGACY) += public_key.o
AKASHI Takahiro42142842019-11-13 09:44:59 +090012
13#
14# RSA public key parser
15#
Tom Rinif5bea562024-10-14 13:34:06 -060016obj-$(CONFIG_$(XPL_)RSA_PUBLIC_KEY_PARSER_LEGACY) += rsa_public_key.o
AKASHI Takahiro42142842019-11-13 09:44:59 +090017rsa_public_key-y := \
18 rsapubkey.asn1.o \
19 rsa_helper.o
20
21$(obj)/rsapubkey.asn1.o: $(obj)/rsapubkey.asn1.c $(obj)/rsapubkey.asn1.h
Simon Glass0e84d962024-09-29 19:49:50 -060022ifdef CONFIG_XPL_BUILD
Philippe Reynesef064692022-03-28 22:56:57 +020023CFLAGS_rsapubkey.asn1.o += -I$(obj)
24endif
25
AKASHI Takahiro42142842019-11-13 09:44:59 +090026$(obj)/rsa_helper.o: $(obj)/rsapubkey.asn1.h
Simon Glass0e84d962024-09-29 19:49:50 -060027ifdef CONFIG_XPL_BUILD
Philippe Reynesef064692022-03-28 22:56:57 +020028CFLAGS_rsa_helper.o += -I$(obj)
29endif
AKASHI Takahiro591535c2019-11-13 09:45:00 +090030
31#
32# X.509 Certificate handling
33#
Simon Glass86adc2e2024-09-29 19:49:53 -060034obj-$(CONFIG_$(XPL_)X509_CERTIFICATE_PARSER) += x509_key_parser.o
Raymond Maof7b522f2024-10-03 14:50:31 -070035x509_key_parser-y := x509_helper.o
Tom Rinif5bea562024-10-14 13:34:06 -060036x509_key_parser-$(CONFIG_$(XPL_)X509_CERTIFICATE_PARSER_LEGACY) += \
AKASHI Takahiro591535c2019-11-13 09:45:00 +090037 x509.asn1.o \
38 x509_akid.asn1.o \
39 x509_cert_parser.o \
40 x509_public_key.o
41
42$(obj)/x509_cert_parser.o: \
43 $(obj)/x509.asn1.h \
44 $(obj)/x509_akid.asn1.h
45
46$(obj)/x509.asn1.o: $(obj)/x509.asn1.c $(obj)/x509.asn1.h
47$(obj)/x509_akid.asn1.o: $(obj)/x509_akid.asn1.c $(obj)/x509_akid.asn1.h
AKASHI Takahiro5ace6ff2019-11-13 09:45:01 +090048
49#
50# PKCS#7 message handling
51#
Simon Glass86adc2e2024-09-29 19:49:53 -060052obj-$(CONFIG_$(XPL_)PKCS7_MESSAGE_PARSER) += pkcs7_message.o
Raymond Maoc3dc1f82024-10-03 14:50:33 -070053pkcs7_message-y := pkcs7_helper.o
54pkcs7_message-$(CONFIG_$(SPL_)PKCS7_MESSAGE_PARSER_LEGACY) += \
AKASHI Takahiro5ace6ff2019-11-13 09:45:01 +090055 pkcs7.asn1.o \
56 pkcs7_parser.o
57
58$(obj)/pkcs7_parser.o: $(obj)/pkcs7.asn1.h
59$(obj)/pkcs7.asn1.o: $(obj)/pkcs7.asn1.c $(obj)/pkcs7.asn1.h
AKASHI Takahirofea4c842022-07-05 14:48:11 +090060
Tom Rinif5bea562024-10-14 13:34:06 -060061obj-$(CONFIG_$(XPL_)PKCS7_VERIFY) += pkcs7_verify.o
Raymond Maoc3dc1f82024-10-03 14:50:33 -070062
AKASHI Takahirofea4c842022-07-05 14:48:11 +090063#
64# Signed PE binary-wrapped key handling
65#
Tom Rinif5bea562024-10-14 13:34:06 -060066obj-$(CONFIG_$(XPL_)MSCODE_PARSER_LEGACY) += mscode.o
AKASHI Takahirofea4c842022-07-05 14:48:11 +090067
68mscode-y := \
69 mscode_parser.o \
70 mscode.asn1.o
71
72$(obj)/mscode_parser.o: $(obj)/mscode.asn1.h $(obj)/mscode.asn1.h
73$(obj)/mscode.asn1.o: $(obj)/mscode.asn1.c $(obj)/mscode.asn1.h