2015-07-22 01:00:41 +08:00
|
|
|
#ifndef H_RPMSIGNFILES
|
|
|
|
#define H_RPMSIGNFILES
|
|
|
|
|
2017-06-08 22:23:15 +08:00
|
|
|
#include <rpm/rpmtypes.h>
|
|
|
|
#include <rpm/rpmutil.h>
|
|
|
|
|
2015-07-22 01:00:41 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
Place file signatures into the signature header where they belong
The original file signing puts the file signatures into the main header
immutable region, invalidating all previous signatures and digests so
the package no longer appears to be what it was when it came out of the
assembly line. Which is bad. Doing that also requires recalculating
everything again which is just added complexity, and since it adds
stuff to different place from the rest of the signing, it requires yet
complexity to deal with that. Moving the file signatures into the
signature header solves all that and allows removing a big pile of
now unnecessary code.
Because this means retrofitting tags bass-ackwards into the signature
header, the tag definitions are backwards to everything else. Other
options would certainly be possible, but this makes things look more
normal on the signature header side. "Users" only ever see the
unchanged file signature tags as they have always been.
This also means the signature header can be MUCH bigger than ever before,
so bump up the limit (to 64MB, arbitrary something for now), and
permit string array types to be migrated from the signature header
on package read.
Caveats:
This loses the check for identical existing signatures to keep the
complexity down, it's hardly a critical thing and can be added back later.
While file signing could now be done separately to other signing, that
is not handled here.
2017-10-10 16:44:10 +08:00
|
|
|
* Sign file digests in header into signature header
|
|
|
|
* @param sigh package signature header
|
2015-07-22 01:00:41 +08:00
|
|
|
* @param h package header
|
|
|
|
* @param key signing key
|
2015-07-22 01:00:46 +08:00
|
|
|
* @param keypass signing key password
|
2015-07-22 01:00:41 +08:00
|
|
|
* @return RPMRC_OK on success
|
|
|
|
*/
|
2017-06-08 22:23:15 +08:00
|
|
|
RPM_GNUC_INTERNAL
|
Place file signatures into the signature header where they belong
The original file signing puts the file signatures into the main header
immutable region, invalidating all previous signatures and digests so
the package no longer appears to be what it was when it came out of the
assembly line. Which is bad. Doing that also requires recalculating
everything again which is just added complexity, and since it adds
stuff to different place from the rest of the signing, it requires yet
complexity to deal with that. Moving the file signatures into the
signature header solves all that and allows removing a big pile of
now unnecessary code.
Because this means retrofitting tags bass-ackwards into the signature
header, the tag definitions are backwards to everything else. Other
options would certainly be possible, but this makes things look more
normal on the signature header side. "Users" only ever see the
unchanged file signature tags as they have always been.
This also means the signature header can be MUCH bigger than ever before,
so bump up the limit (to 64MB, arbitrary something for now), and
permit string array types to be migrated from the signature header
on package read.
Caveats:
This loses the check for identical existing signatures to keep the
complexity down, it's hardly a critical thing and can be added back later.
While file signing could now be done separately to other signing, that
is not handled here.
2017-10-10 16:44:10 +08:00
|
|
|
rpmRC rpmSignFiles(Header sigh, Header h, const char *key, char *keypass);
|
2015-07-22 01:00:46 +08:00
|
|
|
|
2015-07-22 01:00:41 +08:00
|
|
|
#ifdef _cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* H_RPMSIGNFILES */
|