image: add functions to add and remove signatures

Rather than setting ->sigbuf directly, add two functions to handle image
signature addition and removal:

 image_add_signature(image, sig, sigsize);
 image_remove_signature(image);

And warn when a signature is to be overwritten.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-08-03 10:03:14 +08:00
parent 36e79114d2
commit d27647ba69
7 changed files with 56 additions and 12 deletions

View file

@ -92,6 +92,8 @@ struct image *image_load(const char *filename);
int image_find_regions(struct image *image);
int image_hash_sha256(struct image *image, uint8_t digest[]);
int image_add_signature(struct image *, void *sig, int size);
void image_remove_signature(struct image *image);
int image_write(struct image *image, const char *filename);
int image_write_detached(struct image *image, const char *filename);