summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown2012-03-20 14:32:20 +0100
committerMichael Brown2012-03-20 21:39:11 +0100
commit8685280cbddc6e2d050d5e94719cab5d4ba866fc (patch)
tree53a8892a384c29516558eaca59cc9038cb9072f4 /src/include/ipxe
parent[crypto] Use linker tables for RSA digestInfo prefixes (diff)
downloadipxe-8685280cbddc6e2d050d5e94719cab5d4ba866fc.tar.gz
ipxe-8685280cbddc6e2d050d5e94719cab5d4ba866fc.tar.xz
ipxe-8685280cbddc6e2d050d5e94719cab5d4ba866fc.zip
[build] Allow a client certificate to be specified at build time
Allow a client certificate and corresponding private key to be specified at build time using the syntax make CERT=/path/to/certificate KEY=/path/to/key The build process uses openssl to convert the files into DER format, and includes them within the client certificate store in clientcert.c. The build process will prompt for the private key password if applicable. Note that the private key is stored unencrypted, and so the resulting iPXE binary (and the temporary files created during the build process) should be treated as being equivalent to an unencrypted private key file. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/clientcert.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/include/ipxe/clientcert.h b/src/include/ipxe/clientcert.h
new file mode 100644
index 000000000..08f62eb73
--- /dev/null
+++ b/src/include/ipxe/clientcert.h
@@ -0,0 +1,43 @@
+#ifndef _IPXE_CLIENTCERT_H
+#define _IPXE_CLIENTCERT_H
+
+/** @file
+ *
+ * Client certificate store
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <stdint.h>
+
+/** A client certificate */
+struct client_certificate {
+ /** Data */
+ const void *data;
+ /** Length */
+ size_t len;
+};
+
+/** A client private key */
+struct client_private_key {
+ /** Data */
+ const void *data;
+ /** Length */
+ size_t len;
+};
+
+extern struct client_certificate client_certificate;
+extern struct client_private_key client_private_key;
+
+/**
+ * Check for presence of a client certificate
+ *
+ * @ret have_cert We have a client certificate and private key
+ */
+static inline int have_client_certificate ( void ) {
+ return ( ( client_certificate.len > 0 ) &&
+ ( client_private_key.len > 0 ) );
+}
+
+#endif /* _IPXE_CLIENTCERT_H */