64 "<uri|image> <envelope uri|image>" );
75 const char *image_name_uri;
76 const char *envelope_name_uri;
78 struct image *envelope;
86 image_name_uri = argv[
optind];
89 envelope_name_uri = argv[
optind + 1 ];
93 goto err_acquire_image;
98 goto err_acquire_envelope;
113 err_acquire_envelope:
121 .
name =
"imgdecrypt",
struct arbelprm_rc_send_wqe rc
int printf(const char *fmt,...)
Write a formatted string to the console.
int optind
Current option index.
int keep
Keep envelope after decryption.
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.
unsigned long timeout
Download timeout.
Parse command-line options.
int parse_string(char *text, char **value)
Parse string value.
static int imgdecrypt_exec(int argc, char **argv)
The "imgdecrypt" command.
int imgdecrypt(struct image *image, struct image *envelope, const char *name)
Decrypt image using downloaded envelope.
static struct option_descriptor imgdecrypt_opts[]
"imgdecrypt" option list
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.
struct command image_crypt_commands [] __command
Image encryption management commands.
char * name
Decrypted image name.
const char * name
Name of the command.
void unregister_image(struct image *image)
Unregister executable image.
static struct command_descriptor imgdecrypt_cmd
"imgdecrypt" command descriptor
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
Option requires an argument.
A command-line option descriptor.
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
static union @438 opts
"cert<xxx>" option list
Image encryption management.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int imgacquire(const char *name_uri, unsigned long timeout, struct image **image)
Acquire an image.