Skip to content

Commit

Permalink
Mark defined numbers as unsigned
Browse files Browse the repository at this point in the history
Oss-Fuzz complains that shifting an "int" left by 31 is problematic
This is fine in practice at least on the compiler used in common
distributions.
But let's try to address this undefined bheavior by making it clear to
the compiler that we want to treat these numbers as unsigned ints.

Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed Apr 27, 2023
1 parent b133254 commit 9492bfa
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions src/ntlm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@
#include "ntlm_common.h"

/* Negotiate Flags */
#define NTLMSSP_NEGOTIATE_56 (1 << 31)
#define NTLMSSP_NEGOTIATE_KEY_EXCH (1 << 30)
#define NTLMSSP_NEGOTIATE_128 (1 << 29)
#define UNUSED_R1 (1 << 28)
#define UNUSED_R2 (1 << 27)
#define UNUSED_R3 (1 << 26)
#define NTLMSSP_NEGOTIATE_VERSION (1 << 25)
#define UNUSED_R4 (1 << 24)
#define NTLMSSP_NEGOTIATE_TARGET_INFO (1 << 23)
#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY (1 << 22)
#define UNUSED_R5 /* Davenport: NEGOTIATE_ACCEPT */ (1 << 21)
#define NTLMSSP_NEGOTIATE_IDENTIFY (1 << 20)
#define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY (1 << 19)
#define UNUSED_R6 /* Davenport:TARGET_TYPE_SHARE */ (1 << 18)
#define NTLMSSP_TARGET_TYPE_SERVER (1 << 17)
#define NTLMSSP_TARGET_TYPE_DOMAIN (1 << 16)
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN (1 << 15)
#define UNUSED_R7 /* Davenport:LOCAL_CALL */ (1 << 14)
#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED (1 << 13)
#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED (1 << 12)
#define NTLMSSP_ANONYMOUS (1 << 11)
#define UNUSED_R8 (1 << 10)
#define NTLMSSP_NEGOTIATE_NTLM (1 << 9)
#define UNUSED_R9 (1 << 8)
#define NTLMSSP_NEGOTIATE_LM_KEY (1 << 7)
#define NTLMSSP_NEGOTIATE_DATAGRAM (1 << 6)
#define NTLMSSP_NEGOTIATE_SEAL (1 << 5)
#define NTLMSSP_NEGOTIATE_SIGN (1 << 4)
#define UNUSED_R10 (1 << 3)
#define NTLMSSP_REQUEST_TARGET (1 << 2)
#define NTLMSSP_NEGOTIATE_OEM (1 << 1)
#define NTLMSSP_NEGOTIATE_UNICODE (1 << 0)
#define NTLMSSP_NEGOTIATE_56 (1U << 31)
#define NTLMSSP_NEGOTIATE_KEY_EXCH (1U << 30)
#define NTLMSSP_NEGOTIATE_128 (1U << 29)
#define UNUSED_R1 (1U << 28)
#define UNUSED_R2 (1U << 27)
#define UNUSED_R3 (1U << 26)
#define NTLMSSP_NEGOTIATE_VERSION (1U << 25)
#define UNUSED_R4 (1U << 24)
#define NTLMSSP_NEGOTIATE_TARGET_INFO (1U << 23)
#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY (1U << 22)
#define UNUSED_R5 /* Davenport: NEGOTIATE_ACCEPT */ (1U << 21)
#define NTLMSSP_NEGOTIATE_IDENTIFY (1U << 20)
#define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY (1U << 19)
#define UNUSED_R6 /* Davenport:TARGET_TYPE_SHARE */ (1U << 18)
#define NTLMSSP_TARGET_TYPE_SERVER (1U << 17)
#define NTLMSSP_TARGET_TYPE_DOMAIN (1U << 16)
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN (1U << 15)
#define UNUSED_R7 /* Davenport:LOCAL_CALL */ (1U << 14)
#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED (1U << 13)
#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED (1U << 12)
#define NTLMSSP_ANONYMOUS (1U << 11)
#define UNUSED_R8 (1U << 10)
#define NTLMSSP_NEGOTIATE_NTLM (1U << 9)
#define UNUSED_R9 (1U << 8)
#define NTLMSSP_NEGOTIATE_LM_KEY (1U << 7)
#define NTLMSSP_NEGOTIATE_DATAGRAM (1U << 6)
#define NTLMSSP_NEGOTIATE_SEAL (1U << 5)
#define NTLMSSP_NEGOTIATE_SIGN (1U << 4)
#define UNUSED_R10 (1U << 3)
#define NTLMSSP_REQUEST_TARGET (1U << 2)
#define NTLMSSP_NEGOTIATE_OEM (1U << 1)
#define NTLMSSP_NEGOTIATE_UNICODE (1U << 0)

/* (2.2.2.10 VERSION) */
#define WINDOWS_MAJOR_VERSION_5 0x05
Expand Down

0 comments on commit 9492bfa

Please sign in to comment.