91 #define CERT_COMMAND_DESC( _struct, _options, _min_args, _max_args, \ 94 .cmd = COMMAND_DESC ( _struct, _options, _min_args, \ 95 _max_args, _usage ), \ 96 .payload = _payload, \ 114 unsigned int count = 0;
144 printf (
"Could not parse certificate: %s\n",
168 if ( (
rc = certcmd->
payload ( cert ) ) != 0 ) {
184 printf (
"\"%s\" : no such certificate\n",
opts.name );
struct arbelprm_rc_send_wqe rc
int printf(const char *fmt,...)
Write a formatted string to the console.
static struct x509_certificate * x509_get(struct x509_certificate *cert)
Get reference to X.509 certificate.
static int certstat_exec(int argc, char **argv)
The "certstat" command.
int optind
Current option index.
static int cert_exec(int argc, char **argv, struct cert_command_descriptor *certcmd)
Execute "cert<xxx>" command.
static int certstore_exec(int argc, char **argv)
The "certstore" command.
int(* payload)(struct x509_certificate *cert)
Payload.
uint32_t next
Next descriptor address.
static struct cert_command_descriptor certfree_cmd
"certfree" command descriptor
int x509_check_name(struct x509_certificate *cert, const char *name)
Check X.509 certificate name.
struct list_head list
List of links.
static struct cert_command_descriptor certstore_cmd
"certstore" command descriptor
int keep
Keep certificate file after parsing.
#define ENOENT
No such file or directory.
#define list_next_entry(pos, head, member)
Get the container of the next entry in a list.
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
void certstore_del(struct x509_certificate *cert)
Remove certificate from store.
struct option_descriptor certstat[1]
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
Parse command-line options.
int parse_string(char *text, char **value)
Parse string value.
struct option_descriptor certfree[1]
static int certstore_payload(struct x509_certificate *cert)
"certstore" payload
#define CERT_COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage, _payload)
Construct "cert<xxx>" command descriptor.
uint16_t count
Number of entries.
A "cert<xxx>" command descriptor.
int parse_flag(char *text __unused, int *flag)
Parse flag.
char * strerror(int errno)
Retrieve string representation of error number.
size_t len
Length of raw file image.
Command line option parsing.
Option does not take an argument.
static int certstat_payload(struct x509_certificate *cert)
"certstat" payload
struct command_descriptor cmd
Command descriptor.
const char * name
Name of the command.
struct command certmgmt_commands [] __command
Certificate management commands.
void unregister_image(struct image *image)
Unregister executable image.
char * name
Certificate subject name.
struct option_descriptor certstore[2]
Certificate store.
static void x509_put(struct x509_certificate *cert)
Drop reference to X.509 certificate.
static struct cert_command_descriptor certstat_cmd
"certstat" command descriptor
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
Option requires an argument.
A command-line option descriptor.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct x509_link store
Link in certificate store.
uint16_t offset
Offset to command line.
int image_x509(struct image *image, size_t offset, struct x509_certificate **cert)
Extract X.509 certificate object from image.
static int certfree_payload(struct x509_certificate *cert)
"certfree" payload
static union @438 opts
"cert<xxx>" option list
#define NULL
NULL pointer (VOID *)
Certificate was added explicitly at run time.
int imgacquire(const char *name_uri, unsigned long timeout, struct image **image)
Acquire an image.
static int certfree_exec(int argc, char **argv)
The "certfree" command.