image: Add facility to write unsigned images

Change image_write_signed to image_write, and conditionally write the
signature if one is present.

This will allow us to write unsigned images when detaching a sig from an
image.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-06-12 10:19:08 +08:00
parent a8f1453a53
commit be7559abfe
3 changed files with 23 additions and 12 deletions

View file

@ -80,7 +80,7 @@ struct image *image_load(const char *filename);
int image_pecoff_parse(struct image *image);
int image_find_regions(struct image *image);
int image_hash_sha256(struct image *image, uint8_t digest[]);
int image_write_signed(struct image *image, const char *filename);
int image_write(struct image *image, const char *filename);
int image_write_detached(struct image *image, const char *filename);
#endif /* IMAGE_H */