aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-05-13 17:47:13 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-05-14 02:06:17 +0100
commit1c7b2c0ed5d02d0d60179e0df0c49ef3f659fa77 (patch)
tree52805eb42218a21d4127faa2b154fe95a3b14a90 /crypto
parentc1a623c55ad4b9e184438653d55f7853ee48ba29 (diff)
downloadopenssl-1c7b2c0ed5d02d0d60179e0df0c49ef3f659fa77.tar.gz
use unit64_t for CPUID and timestamp code
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/cryptlib.c6
-rw-r--r--crypto/x509v3/v3_scts.c28
2 files changed, 11 insertions, 23 deletions
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index 3742ff2947..69883ab929 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -134,11 +134,7 @@ unsigned int *OPENSSL_ia32cap_loc(void)
# if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
# define OPENSSL_CPUID_SETUP
-# if defined(_WIN32)
-typedef unsigned __int64 IA32CAP;
-# else
-typedef unsigned long long IA32CAP;
-# endif
+typedef uint64_t IA32CAP;
void OPENSSL_cpuid_setup(void)
{
static int trigger = 0;
diff --git a/crypto/x509v3/v3_scts.c b/crypto/x509v3/v3_scts.c
index a9e1a9782f..e9ee66884c 100644
--- a/crypto/x509v3/v3_scts.c
+++ b/crypto/x509v3/v3_scts.c
@@ -71,22 +71,14 @@
#define n2s(c,s) ((s=(((unsigned int)(c[0]))<< 8)| \
(((unsigned int)(c[1])) )),c+=2)
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
-# define SCT_TIMESTAMP unsigned __int64
-#elif defined(__arch64__)
-# define SCT_TIMESTAMP unsigned long
-#else
-# define SCT_TIMESTAMP unsigned long long
-#endif
-
-#define n2l8(c,l) (l =((SCT_TIMESTAMP)(*((c)++)))<<56, \
- l|=((SCT_TIMESTAMP)(*((c)++)))<<48, \
- l|=((SCT_TIMESTAMP)(*((c)++)))<<40, \
- l|=((SCT_TIMESTAMP)(*((c)++)))<<32, \
- l|=((SCT_TIMESTAMP)(*((c)++)))<<24, \
- l|=((SCT_TIMESTAMP)(*((c)++)))<<16, \
- l|=((SCT_TIMESTAMP)(*((c)++)))<< 8, \
- l|=((SCT_TIMESTAMP)(*((c)++))))
+#define n2l8(c,l) (l =((uint64_t)(*((c)++)))<<56, \
+ l|=((uint64_t)(*((c)++)))<<48, \
+ l|=((uint64_t)(*((c)++)))<<40, \
+ l|=((uint64_t)(*((c)++)))<<32, \
+ l|=((uint64_t)(*((c)++)))<<24, \
+ l|=((uint64_t)(*((c)++)))<<16, \
+ l|=((uint64_t)(*((c)++)))<< 8, \
+ l|=((uint64_t)(*((c)++))))
typedef struct SCT_st {
/* The encoded SCT */
@@ -99,7 +91,7 @@ typedef struct SCT_st {
unsigned char version;
unsigned char *logid;
unsigned short logidlen;
- SCT_TIMESTAMP timestamp;
+ uint64_t timestamp;
unsigned char *ext;
unsigned short extlen;
unsigned char hash_alg;
@@ -149,7 +141,7 @@ static void tls12_signature_print(BIO *out, const unsigned char hash_alg,
BIO_printf(out, "%s", OBJ_nid2ln(nid));
}
-static void timestamp_print(BIO *out, SCT_TIMESTAMP timestamp)
+static void timestamp_print(BIO *out, uint64_t timestamp)
{
ASN1_GENERALIZEDTIME *gen;
char genstr[20];