Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/crypto/bio/fd.c b/crypto/bio/fd.c
- index 4e9eeacf..a40d36fc 100644
- --- a/crypto/bio/fd.c
- +++ b/crypto/bio/fd.c
- @@ -190,6 +190,7 @@ static long fd_ctrl(BIO *b, int cmd, long num, void *ptr) {
- switch (cmd) {
- case BIO_CTRL_RESET:
- num = 0;
- + FALLTHRU;
- case BIO_C_FILE_SEEK:
- ret = 0;
- if (b->init) {
- diff --git a/crypto/bio/file.c b/crypto/bio/file.c
- index 3580cd1c..9cdde5cf 100644
- --- a/crypto/bio/file.c
- +++ b/crypto/bio/file.c
- @@ -184,6 +184,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) {
- switch (cmd) {
- case BIO_CTRL_RESET:
- num = 0;
- + FALLTHRU;
- case BIO_C_FILE_SEEK:
- ret = (long)fseek(fp, num, 0);
- break;
- diff --git a/crypto/bn/mul.c b/crypto/bn/mul.c
- index fdf2c692..8db21753 100644
- --- a/crypto/bn/mul.c
- +++ b/crypto/bn/mul.c
- @@ -230,11 +230,13 @@ static BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a,
- if (--dl <= 0) {
- break;
- }
- + FALLTHRU;
- case 2:
- r[2] = a[2];
- if (--dl <= 0) {
- break;
- }
- + FALLTHRU;
- case 3:
- r[3] = a[3];
- if (--dl <= 0) {
- diff --git a/crypto/cipher/e_rc2.c b/crypto/cipher/e_rc2.c
- index e1b4301e..ca8e9604 100644
- --- a/crypto/cipher/e_rc2.c
- +++ b/crypto/cipher/e_rc2.c
- @@ -75,18 +75,25 @@
- switch (n) { \
- case 8: \
- (l2) = ((uint32_t)(*(--(c)))) << 24L; \
- + FALLTHRU; \
- case 7: \
- (l2) |= ((uint32_t)(*(--(c)))) << 16L; \
- + FALLTHRU; \
- case 6: \
- (l2) |= ((uint32_t)(*(--(c)))) << 8L; \
- + FALLTHRU; \
- case 5: \
- (l2) |= ((uint32_t)(*(--(c)))); \
- + FALLTHRU; \
- case 4: \
- (l1) = ((uint32_t)(*(--(c)))) << 24L; \
- + FALLTHRU; \
- case 3: \
- (l1) |= ((uint32_t)(*(--(c)))) << 16L; \
- + FALLTHRU; \
- case 2: \
- (l1) |= ((uint32_t)(*(--(c)))) << 8L; \
- + FALLTHRU; \
- case 1: \
- (l1) |= ((uint32_t)(*(--(c)))); \
- } \
- @@ -106,18 +113,25 @@
- switch (n) { \
- case 8: \
- *(--(c)) = (uint8_t)(((l2) >> 24L) & 0xff); \
- + FALLTHRU; \
- case 7: \
- *(--(c)) = (uint8_t)(((l2) >> 16L) & 0xff); \
- + FALLTHRU; \
- case 6: \
- *(--(c)) = (uint8_t)(((l2) >> 8L) & 0xff); \
- + FALLTHRU; \
- case 5: \
- *(--(c)) = (uint8_t)(((l2)) & 0xff); \
- + FALLTHRU; \
- case 4: \
- *(--(c)) = (uint8_t)(((l1) >> 24L) & 0xff); \
- + FALLTHRU; \
- case 3: \
- *(--(c)) = (uint8_t)(((l1) >> 16L) & 0xff); \
- + FALLTHRU; \
- case 2: \
- *(--(c)) = (uint8_t)(((l1) >> 8L) & 0xff); \
- + FALLTHRU; \
- case 1: \
- *(--(c)) = (uint8_t)(((l1)) & 0xff); \
- } \
- diff --git a/crypto/des/internal.h b/crypto/des/internal.h
- index 21eb9335..70e7e24a 100644
- --- a/crypto/des/internal.h
- +++ b/crypto/des/internal.h
- @@ -88,18 +88,25 @@ extern "C" {
- switch (n) { \
- case 8: \
- (l2) = ((uint32_t)(*(--(c)))) << 24L; \
- + FALLTHRU; \
- case 7: \
- (l2) |= ((uint32_t)(*(--(c)))) << 16L; \
- + FALLTHRU; \
- case 6: \
- (l2) |= ((uint32_t)(*(--(c)))) << 8L; \
- + FALLTHRU; \
- case 5: \
- (l2) |= ((uint32_t)(*(--(c)))); \
- + FALLTHRU; \
- case 4: \
- (l1) = ((uint32_t)(*(--(c)))) << 24L; \
- + FALLTHRU; \
- case 3: \
- (l1) |= ((uint32_t)(*(--(c)))) << 16L; \
- + FALLTHRU; \
- case 2: \
- (l1) |= ((uint32_t)(*(--(c)))) << 8L; \
- + FALLTHRU; \
- case 1: \
- (l1) |= ((uint32_t)(*(--(c)))); \
- } \
- @@ -112,18 +119,25 @@ extern "C" {
- switch (n) { \
- case 8: \
- *(--(c)) = (unsigned char)(((l2) >> 24L) & 0xff); \
- + FALLTHRU; \
- case 7: \
- *(--(c)) = (unsigned char)(((l2) >> 16L) & 0xff); \
- + FALLTHRU; \
- case 6: \
- *(--(c)) = (unsigned char)(((l2) >> 8L) & 0xff); \
- + FALLTHRU; \
- case 5: \
- *(--(c)) = (unsigned char)(((l2)) & 0xff); \
- + FALLTHRU; \
- case 4: \
- *(--(c)) = (unsigned char)(((l1) >> 24L) & 0xff); \
- + FALLTHRU; \
- case 3: \
- *(--(c)) = (unsigned char)(((l1) >> 16L) & 0xff); \
- + FALLTHRU; \
- case 2: \
- *(--(c)) = (unsigned char)(((l1) >> 8L) & 0xff); \
- + FALLTHRU; \
- case 1: \
- *(--(c)) = (unsigned char)(((l1)) & 0xff); \
- } \
- diff --git a/include/openssl/base.h b/include/openssl/base.h
- index 3f47521d..33ab4f97 100644
- --- a/include/openssl/base.h
- +++ b/include/openssl/base.h
- @@ -75,6 +75,17 @@
- extern "C" {
- #endif
- +// Have a generic fall-through for different versions of C++
- +#if defined(__cplusplus) && __cplusplus >= 201402L // C++14, C++17 and above
- +#define FALLTHRU [[fallthrough]]
- +#elif defined(__cplusplus) && __cplusplus >= 201103L && __GNUC__ >= 7 // C++11 gcc 7
- +#define FALLTHRU [[gnu::fallthrough]]
- +#elif __GNUC__ >= 7 // gcc 7
- +#define FALLTHRU __attribute__ ((fallthrough))
- +#else // C++11 on gcc 6, and all other cases
- +#define FALLTHRU
- +#endif
- +
- #if defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64)
- #define OPENSSL_64_BIT
- diff --git a/ssl/tls13_both.c b/ssl/tls13_both.c
- index 91cae9ad..b2ffe056 100644
- --- a/ssl/tls13_both.c
- +++ b/ssl/tls13_both.c
- @@ -54,7 +54,7 @@ int tls13_handshake(SSL_HANDSHAKE *hs) {
- }
- ssl->method->expect_flight(ssl);
- hs->wait = ssl_hs_read_message;
- - /* Fall-through. */
- + FALLTHRU;
- }
- case ssl_hs_read_message: {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement