From aa2f6e9b633fd7dca7c82c4ad1f51b1142413ecd Mon Sep 17 00:00:00 2001 From: Dmitry Kasatkin Date: Thu, 2 Feb 2012 10:12:34 +0200 Subject: [PATCH] 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 --- src/evmctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evmctl.c b/src/evmctl.c index 04955e0..c3048af 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -108,7 +108,7 @@ enum digest_algo { struct pubkey_hdr { 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 nmpi; char mpi[0]; @@ -116,7 +116,7 @@ struct pubkey_hdr { struct signature_hdr { uint8_t version; /* signature format version */ - time_t timestamp; /* signature made */ + uint32_t timestamp; /* signature made */ uint8_t algo; uint8_t hash; 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 */ hdr->version = 1; - time(&hdr->timestamp); + hdr->timestamp = time(NULL); hdr->algo = PUBKEY_ALGO_RSA; hdr->hash = DIGEST_ALGO_SHA1; -- 2.7.4