Skip to content

Commit

Permalink
Fix build error.
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-shang committed Feb 18, 2021
1 parent dae88e2 commit 1cabb7d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions crypto/blake2/blake2.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void blake2b_transform(
size_t num_bytes, int is_final_block) {
// https://tools.ietf.org/html/rfc7693#section-3.2
uint64_t v[16];
OPENSSL_STATIC_ASSERT(sizeof(v) == sizeof(b2b->h) + sizeof(kIV), "");
OPENSSL_STATIC_ASSERT(sizeof(v) == sizeof(b2b->h) + sizeof(kIV), _);
OPENSSL_memcpy(v, b2b->h, sizeof(b2b->h));
OPENSSL_memcpy(&v[8], kIV, sizeof(kIV));

Expand Down Expand Up @@ -99,7 +99,7 @@ static void blake2b_transform(
void BLAKE2B256_Init(BLAKE2B_CTX *b2b) {
OPENSSL_memset(b2b, 0, sizeof(BLAKE2B_CTX));

OPENSSL_STATIC_ASSERT(sizeof(kIV) == sizeof(b2b->h), "");
OPENSSL_STATIC_ASSERT(sizeof(kIV) == sizeof(b2b->h), _);
OPENSSL_memcpy(&b2b->h, kIV, sizeof(kIV));

// https://tools.ietf.org/html/rfc7693#section-2.5
Expand Down Expand Up @@ -145,7 +145,7 @@ void BLAKE2B256_Final(uint8_t out[BLAKE2B256_DIGEST_LENGTH], BLAKE2B_CTX *b2b) {
sizeof(b2b->block.bytes) - b2b->block_used);
blake2b_transform(b2b, b2b->block.words, b2b->block_used,
/*is_final_block=*/1);
OPENSSL_STATIC_ASSERT(BLAKE2B256_DIGEST_LENGTH <= sizeof(b2b->h), "");
OPENSSL_STATIC_ASSERT(BLAKE2B256_DIGEST_LENGTH <= sizeof(b2b->h), _);
memcpy(out, b2b->h, BLAKE2B256_DIGEST_LENGTH);
}

Expand Down
4 changes: 2 additions & 2 deletions crypto/cipher_extra/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ union chacha20_poly1305_seal_data {
#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM)

OPENSSL_STATIC_ASSERT(sizeof(union chacha20_poly1305_open_data) == 48,
"wrong chacha20_poly1305_open_data size");
_wrong_chacha20_poly1305_open_data_size);
OPENSSL_STATIC_ASSERT(sizeof(union chacha20_poly1305_seal_data) == 48 + 8 + 8,
"wrong chacha20_poly1305_seal_data size");
_wrong_chacha20_poly1305_seal_data_size);

OPENSSL_INLINE int chacha20_poly1305_asm_capable(void) {
const int sse41_capable = (OPENSSL_ia32cap_P[1] & (1 << 19)) != 0;
Expand Down
2 changes: 1 addition & 1 deletion crypto/fipsmodule/rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static void rand_get_seed(struct rand_thread_state *state,
BORINGSSL_FIPS_abort();
}

OPENSSL_STATIC_ASSERT(sizeof(entropy) % CRNGT_BLOCK_SIZE == 0, "");
OPENSSL_STATIC_ASSERT(sizeof(entropy) % CRNGT_BLOCK_SIZE == 0, _);
for (size_t i = CRNGT_BLOCK_SIZE; i < sizeof(entropy);
i += CRNGT_BLOCK_SIZE) {
if (CRYPTO_memcmp(entropy + i - CRNGT_BLOCK_SIZE, entropy + i,
Expand Down
2 changes: 1 addition & 1 deletion crypto/poly1305/poly1305.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct poly1305_state_st {

OPENSSL_STATIC_ASSERT(
sizeof(struct poly1305_state_st) + 63 <= sizeof(poly1305_state),
"poly1305_state isn't large enough to hold aligned poly1305_state_st");
_poly1305_state_isn_t_large_enough_to_hold_aligned_poly1305_state_st);

static inline struct poly1305_state_st *poly1305_aligned_state(
poly1305_state *state) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/poly1305/poly1305_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ typedef struct poly1305_state_internal_t {

OPENSSL_STATIC_ASSERT(
sizeof(struct poly1305_state_internal_t) + 63 <= sizeof(poly1305_state),
"poly1305_state isn't large enough to hold aligned poly1305_state_internal_t");
_poly1305_state_isn_t_large_enough_to_hold_aligned_poly1305_state_internal_t);

static inline poly1305_state_internal *poly1305_aligned_state(
poly1305_state *state) {
Expand Down
1 change: 0 additions & 1 deletion include/openssl/asn1.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,6 @@ BSSL_NAMESPACE_END
#define ASN1_R_AUX_ERROR 101
#define ASN1_R_BAD_GET_ASN1_OBJECT_CALL 102
#define ASN1_R_BAD_OBJECT_HEADER 103
#define ASN1_R_BAD_TEMPLATE 200
#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 104
#define ASN1_R_BN_LIB 105
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
Expand Down

0 comments on commit 1cabb7d

Please sign in to comment.