aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Makefile
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-09-21 18:30:46 -0400
committerRusty Russell <rusty@rustcorp.com.au>2012-10-07 23:20:18 -0400
commita77ad6ea0b0bb1f9d1f52ed494bd72a5fdde208e (patch)
tree96f3bcb637dc80c7a92611237ce4a9b3f6466387 /lib/Makefile
parent0b1568a4536ff287a87908d7fc35c05bd7736a53 (diff)
X.509: Implement simple static OID registry
Implement a simple static OID registry that allows the mapping of an encoded OID to an enum value for ease of use. The OID registry index enum appears in the: linux/oid_registry.h header file. A script generates the registry from lines in the header file that look like: <sp*>OID_foo,<sp*>/*<sp*>1.2.3.4<sp*>*/ The actual OID is taken to be represented by the numbers with interpolated dots in the comment. All other lines in the header are ignored. The registry is queries by calling: OID look_up_oid(const void *data, size_t datasize); This returns a number from the registry enum representing the OID if found or OID__NR if not. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/Makefile')
-rw-r--r--lib/Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 42d283edc4d3..b0428960939f 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -150,3 +150,19 @@ quiet_cmd_crc32 = GEN $@
150 150
151$(obj)/crc32table.h: $(obj)/gen_crc32table 151$(obj)/crc32table.h: $(obj)/gen_crc32table
152 $(call cmd,crc32) 152 $(call cmd,crc32)
153
154#
155# Build a fast OID lookip registry from include/linux/oid_registry.h
156#
157obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
158
159$(obj)/oid_registry.c: $(obj)/oid_registry_data.c
160
161$(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
162 $(src)/build_OID_registry
163 $(call cmd,build_OID_registry)
164
165quiet_cmd_build_OID_registry = GEN $@
166 cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
167
168clean-files += oid_registry_data.c