From 84add97ce9e094e9299db181d53ba8859f4a3e67 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 28 Jul 2016 22:51:50 +0100 Subject: [crypto] Add PEM image format Add PEM-encoded ASN.1 as an image format. We accept as PEM any image containing a line starting with a "-----BEGIN" boundary marker. We allow for PEM files containing multiple ASN.1 objects, such as a certificate chain produced by concatenating individual certificate files. Signed-off-by: Michael Brown --- src/include/ipxe/errfile.h | 1 + src/include/ipxe/pem.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/include/ipxe/pem.h (limited to 'src/include') diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h index 61e208a52..f28e58948 100644 --- a/src/include/ipxe/errfile.h +++ b/src/include/ipxe/errfile.h @@ -277,6 +277,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define ERRFILE_pnm ( ERRFILE_IMAGE | 0x00060000 ) #define ERRFILE_png ( ERRFILE_IMAGE | 0x00070000 ) #define ERRFILE_der ( ERRFILE_IMAGE | 0x00080000 ) +#define ERRFILE_pem ( ERRFILE_IMAGE | 0x00090000 ) #define ERRFILE_asn1 ( ERRFILE_OTHER | 0x00000000 ) #define ERRFILE_chap ( ERRFILE_OTHER | 0x00010000 ) diff --git a/src/include/ipxe/pem.h b/src/include/ipxe/pem.h new file mode 100644 index 000000000..1276f94ad --- /dev/null +++ b/src/include/ipxe/pem.h @@ -0,0 +1,22 @@ +#ifndef _IPXE_PEM_H +#define _IPXE_PEM_H + +/** @file + * + * PEM image format + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include + +/** Pre-encapsulation boundary marker */ +#define PEM_BEGIN "-----BEGIN" + +/** Post-encapsulation boundary marker */ +#define PEM_END "-----END" + +extern struct image_type pem_image_type __image_type ( PROBE_NORMAL ); + +#endif /* _IPXE_PEM_H */ -- cgit v1.2.3-55-g7522