78 opts.permanent ) ) != 0 ) {
79 printf (
"Could not set image trust requirement: %s\n",
110 "<uri|image> <signature uri|image>" );
121 const char *image_name_uri;
122 const char *signature_name_uri;
132 image_name_uri = argv[
optind];
135 signature_name_uri = argv[
optind + 1 ];
139 goto err_acquire_image;
144 goto err_acquire_signature;
159 err_acquire_signature:
int image_set_trust(int require_trusted, int permanent)
Change image trust requirement.
struct arbelprm_rc_send_wqe rc
int imgverify(struct image *image, struct image *signature, const char *name)
Verify image using downloaded signature.
int printf(const char *fmt,...)
Write a formatted string to the console.
static struct option_descriptor imgtrust_opts[]
"imgtrust" option list
int optind
Current option index.
int allow
Allow trusted images.
int parse_timeout(char *text, unsigned long *value)
Parse timeout value (in ms)
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
int permanent
Make trust requirement permanent.
int keep
Keep signature after verification.
Parse command-line options.
int parse_string(char *text, char **value)
Parse string value.
static int imgverify_exec(int argc, char **argv)
The "imgverify" command.
struct command image_trust_commands [] __command
Image trust management commands.
int parse_flag(char *text __unused, int *flag)
Parse flag.
char * strerror(int errno)
Retrieve string representation of error number.
Command line option parsing.
Option does not take an argument.
static struct command_descriptor imgtrust_cmd
"imgtrust" command descriptor
static struct option_descriptor imgverify_opts[]
"imgverify" option list
const char * name
Name of the command.
void unregister_image(struct image *image)
Unregister executable image.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
Option requires an argument.
static int imgtrust_exec(int argc, char **argv)
The "imgtrust" command.
A command-line option descriptor.
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
unsigned long timeout
Download timeout.
static union @438 opts
"cert<xxx>" option list
u8 signature
CPU signature.
char * signer
Required signer common name.
#define NULL
NULL pointer (VOID *)
int imgacquire(const char *name_uri, unsigned long timeout, struct image **image)
Acquire an image.
static struct command_descriptor imgverify_cmd
"imgverify" command descriptor