Changed time_t timestamp type to uint32_t
time_t is actually long and is different on 32 and 64 bit architectures. Format of the signatures should not depend on the architecture and should be the same. Changed timestamp to uint32_t like in GPG. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
This commit is contained in:
parent
d98e4a9bed
commit
ae47101134
@ -108,7 +108,7 @@ enum digest_algo {
|
|||||||
|
|
||||||
struct pubkey_hdr {
|
struct pubkey_hdr {
|
||||||
uint8_t version; /* key format version */
|
uint8_t version; /* key format version */
|
||||||
time_t timestamp; /* key made, always 0 for now */
|
uint32_t timestamp; /* key made, always 0 for now */
|
||||||
uint8_t algo;
|
uint8_t algo;
|
||||||
uint8_t nmpi;
|
uint8_t nmpi;
|
||||||
char mpi[0];
|
char mpi[0];
|
||||||
@ -116,7 +116,7 @@ struct pubkey_hdr {
|
|||||||
|
|
||||||
struct signature_hdr {
|
struct signature_hdr {
|
||||||
uint8_t version; /* signature format version */
|
uint8_t version; /* signature format version */
|
||||||
time_t timestamp; /* signature made */
|
uint32_t timestamp; /* signature made */
|
||||||
uint8_t algo;
|
uint8_t algo;
|
||||||
uint8_t hash;
|
uint8_t hash;
|
||||||
uint8_t keyid[8];
|
uint8_t keyid[8];
|
||||||
@ -336,7 +336,7 @@ static int sign_hash(const unsigned char *hash, int size, const char *keyfile, u
|
|||||||
|
|
||||||
/* now create a new hash */
|
/* now create a new hash */
|
||||||
hdr->version = 1;
|
hdr->version = 1;
|
||||||
time(&hdr->timestamp);
|
hdr->timestamp = time(NULL);
|
||||||
hdr->algo = PUBKEY_ALGO_RSA;
|
hdr->algo = PUBKEY_ALGO_RSA;
|
||||||
hdr->hash = DIGEST_ALGO_SHA1;
|
hdr->hash = DIGEST_ALGO_SHA1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user