|
iPXE
|
PEM-encoded ASN.1 data. More...
#include <stdlib.h>#include <errno.h>#include <assert.h>#include <ipxe/asn1.h>#include <ipxe/base64.h>#include <ipxe/image.h>#include <ipxe/pem.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static size_t | pem_next (const void *data, size_t len, size_t offset) |
| Locate next line. More... | |
| static int | pem_marker (const void *data, size_t len, size_t offset, const char *marker) |
| Locate boundary marker line. More... | |
| int | pem_asn1 (const void *data, size_t len, size_t offset, struct asn1_cursor **cursor) |
| Extract ASN.1 object from PEM data. More... | |
| static int | pem_image_probe (struct image *image) |
| Probe PEM image. More... | |
| static int | pem_image_asn1 (struct image *image, size_t offset, struct asn1_cursor **cursor) |
| Extract ASN.1 object from image. More... | |
| struct image_type pem_image_type | __image_type (PROBE_NORMAL) |
| PEM image type. More... | |
PEM-encoded ASN.1 data.
Definition in file pem.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Locate next line.
| data | PEM data |
| len | Length of PEM data |
| offset | Starting offset |
| next | Offset to next line |
Definition at line 48 of file pem.c.
References data, len, memchr(), and offset.
Referenced by pem_asn1(), and pem_marker().
Locate boundary marker line.
| data | PEM data |
| len | Length of PEM data |
| offset | Starting offset |
| marker | Boundary marker |
| offset | Offset to boundary marker line, or negative error |
Definition at line 67 of file pem.c.
References assert(), data, ENOENT, len, marker, memcmp(), offset, pem_next(), and strlen().
Referenced by pem_asn1(), and pem_image_probe().
| int pem_asn1 | ( | const void * | data, |
| size_t | len, | ||
| size_t | offset, | ||
| struct asn1_cursor ** | cursor | ||
| ) |
Extract ASN.1 object from PEM data.
| data | PEM data |
| len | Length of PEM data |
| offset | Offset within data |
| cursor | ASN.1 cursor to fill in |
| next | Offset to next object, or negative error |
The caller is responsible for eventually calling free() on the allocated ASN.1 cursor.
Definition at line 103 of file pem.c.
References assert(), base64_decode(), base64_decoded_max_len(), data, DBGC, end, ENOMEM, free, len, malloc(), memcpy(), NULL, offset, PEM_BEGIN, PEM_END, pem_marker(), pem_next(), rc, and strerror().
Referenced by efisig_asn1(), ipair_rx_pubkey(), and pem_image_asn1().
|
static |
Probe PEM image.
| image | PEM image |
| rc | Return status code |
Definition at line 191 of file pem.c.
References image::data, DBGC, image::len, image::name, offset, PEM_BEGIN, pem_marker(), rc, and strerror().
|
static |
Extract ASN.1 object from image.
| image | PEM image |
| offset | Offset within image |
| cursor | ASN.1 cursor to fill in |
| next | Offset to next image, or negative error |
The caller is responsible for eventually calling free() on the allocated ASN.1 cursor.
Definition at line 218 of file pem.c.
References image::data, DBGC, image::len, image::name, next, offset, pem_asn1(), rc, and strerror().
| struct image_type pem_image_type __image_type | ( | PROBE_NORMAL | ) |
PEM image type.
1.8.15