提交 d1acb9b4 编写于 作者: R Richard Levitte

Further change pq_compat.h to generate the flag macros PQ_64BIT_IS_INTEGER

and PQ_64BIT_IS_BIGNUM with the values 0 (for false) and 1 (for true),
depending on which is true.  Use those flags everywhere else to provide
the correct implementation for handling certain operations in q PQ_64BIT.
上级 acd1c4b5
...@@ -74,6 +74,9 @@ ...@@ -74,6 +74,9 @@
#if (defined(THIRTY_TWO_BIT) && !defined(BN_LLONG)) || defined(SIXTEEN_BIT) || defined(EIGHT_BIT) #if (defined(THIRTY_TWO_BIT) && !defined(BN_LLONG)) || defined(SIXTEEN_BIT) || defined(EIGHT_BIT)
#define PQ_64BIT_IS_INTEGER 0
#define PQ_64BIT_IS_BIGNUM 1
#define PQ_64BIT BIGNUM #define PQ_64BIT BIGNUM
#define PQ_64BIT_CTX BN_CTX #define PQ_64BIT_CTX BN_CTX
...@@ -102,6 +105,9 @@ ...@@ -102,6 +105,9 @@
#else #else
#define PQ_64BIT_IS_INTEGER 1
#define PQ_64BIT_IS_BIGNUM 0
#if defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG) #if defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
#define PQ_64BIT BN_ULONG #define PQ_64BIT BN_ULONG
#elif defined(THIRTY_TWO_BIT) #elif defined(THIRTY_TWO_BIT)
......
...@@ -199,7 +199,7 @@ pqueue_find(pqueue_s *pq, PQ_64BIT priority) ...@@ -199,7 +199,7 @@ pqueue_find(pqueue_s *pq, PQ_64BIT priority)
return found; return found;
} }
#if !(defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)) #if PQ_64BIT_IS_INTEGER
void void
pqueue_print(pqueue_s *pq) pqueue_print(pqueue_s *pq)
{ {
......
...@@ -135,7 +135,7 @@ static int dtls1_record_needs_buffering(SSL *s, SSL3_RECORD *rr, ...@@ -135,7 +135,7 @@ static int dtls1_record_needs_buffering(SSL *s, SSL3_RECORD *rr,
static int dtls1_buffer_record(SSL *s, record_pqueue *q, static int dtls1_buffer_record(SSL *s, record_pqueue *q,
PQ_64BIT priority); PQ_64BIT priority);
static int dtls1_process_record(SSL *s); static int dtls1_process_record(SSL *s);
#if !(defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)) #if PQ_64BIT_IS_INTEGER
static PQ_64BIT bytes_to_long_long(unsigned char *bytes, PQ_64BIT *num); static PQ_64BIT bytes_to_long_long(unsigned char *bytes, PQ_64BIT *num);
#endif #endif
static void dtls1_clear_timeouts(SSL *s); static void dtls1_clear_timeouts(SSL *s);
...@@ -1453,7 +1453,7 @@ err: ...@@ -1453,7 +1453,7 @@ err:
static int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap, static int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap,
PQ_64BIT *seq_num) PQ_64BIT *seq_num)
{ {
#if !(defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)) #if PQ_64BIT_IS_INTEGER
PQ_64BIT mask = 0x0000000000000001L; PQ_64BIT mask = 0x0000000000000001L;
#endif #endif
PQ_64BIT rcd_num, tmp; PQ_64BIT rcd_num, tmp;
...@@ -1483,7 +1483,7 @@ static int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap, ...@@ -1483,7 +1483,7 @@ static int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap,
return 0; /* stale, outside the window */ return 0; /* stale, outside the window */
} }
#if (defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)) #if PQ_64BIT_IS_BIGNUM
{ {
int offset; int offset;
pq_64bit_sub(&tmp, &(bitmap->max_seq_num), &rcd_num); pq_64bit_sub(&tmp, &(bitmap->max_seq_num), &rcd_num);
...@@ -1736,7 +1736,7 @@ dtls1_reset_seq_numbers(SSL *s, int rw) ...@@ -1736,7 +1736,7 @@ dtls1_reset_seq_numbers(SSL *s, int rw)
memset(seq, 0x00, seq_bytes); memset(seq, 0x00, seq_bytes);
} }
#if !(defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)) #if PQ_64BIT_IS_INTEGER
static PQ_64BIT static PQ_64BIT
bytes_to_long_long(unsigned char *bytes, PQ_64BIT *num) bytes_to_long_long(unsigned char *bytes, PQ_64BIT *num)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册