summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/clientcert.h
diff options
context:
space:
mode:
authorMichael Brown2014-03-28 16:45:10 +0100
committerMichael Brown2014-03-28 18:09:40 +0100
commitbc8ca6b8cea325e6507839e576d0d7eaa44e2af1 (patch)
treed74ee501d55b6dbaa5f5842c697e57295776b82e /src/include/ipxe/clientcert.h
parent[crypto] Add pubkey_match() to check for matching public/private key pairs (diff)
downloadipxe-bc8ca6b8cea325e6507839e576d0d7eaa44e2af1.tar.gz
ipxe-bc8ca6b8cea325e6507839e576d0d7eaa44e2af1.tar.xz
ipxe-bc8ca6b8cea325e6507839e576d0d7eaa44e2af1.zip
[crypto] Generalise X.509 cache to a full certificate store
Expand the concept of the X.509 cache to provide the functionality of a certificate store. Certificates in the store will be automatically used to complete certificate chains where applicable. The certificate store may be prepopulated at build time using the CERT=... build command line option. For example: make bin/ipxe.usb CERT=mycert1.crt,mycert2.crt Certificates within the certificate store are not implicitly trusted; the trust list is specified using TRUST=... as before. For example: make bin/ipxe.usb CERT=root.crt TRUST=root.crt This can be used to embed the full trusted root certificate within the iPXE binary, which is potentially useful in an HTTPS-only environment in which there is no HTTP server from which to automatically download cross-signed certificates or other certificate chain fragments. This usage of CERT= extends the existing use of CERT= to specify the client certificate. The client certificate is now identified automatically by checking for a match against the private key. For example: make bin/ipxe.usb CERT=root.crt,client.crt TRUST=root.crt KEY=client.key Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/clientcert.h')
-rw-r--r--src/include/ipxe/clientcert.h43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/include/ipxe/clientcert.h b/src/include/ipxe/clientcert.h
deleted file mode 100644
index 08f62eb73..000000000
--- a/src/include/ipxe/clientcert.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#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 */