Skip to content

Commit

Permalink
Update Negotiate Flags (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
n00tmeg authored Jun 12, 2024
1 parent c285877 commit cccbfef
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/net/ntlm/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,36 @@ module NTLM

SSP_SIGN = "NTLMSSP\0"

# See [2.2.2.5 NEGOTIATE](https://msdn.microsoft.com/en-us/library/cc236650.aspx)
FLAGS = {
:UNICODE => 0x00000001,
:OEM => 0x00000002,
:REQUEST_TARGET => 0x00000004,
:MBZ9 => 0x00000008,
:SIGN => 0x00000010,
:SEAL => 0x00000020,
:NEG_DATAGRAM => 0x00000040,
:NETWARE => 0x00000100,
:NEG_LM_KEY => 0x00000080,
:NTLM => 0x00000200,
:NEG_NT_ONLY => 0x00000400,
:MBZ7 => 0x00000800,
:NEG_ANONYMOUS => 0x00000800,
:DOMAIN_SUPPLIED => 0x00001000,
:WORKSTATION_SUPPLIED => 0x00002000,
:LOCAL_CALL => 0x00004000,
:ALWAYS_SIGN => 0x00008000,
:TARGET_TYPE_DOMAIN => 0x00010000,
:TARGET_TYPE_SERVER => 0x00020000,
:NTLM2_KEY => 0x00080000,
:NEG_IDENTIFY => 0x00100000,
:NON_NT_SESSION_KEY => 0x00400000,
:TARGET_INFO => 0x00800000,
:NEG_VERSION => 0x02000000,
:KEY128 => 0x20000000,
:KEY_EXCHANGE => 0x40000000,
:KEY56 => 0x80000000
# Undocumented flags:
:MBZ9 => 0x00000008,
:NETWARE => 0x00000100,
:NEG_NT_ONLY => 0x00000400,
:MBZ7 => 0x00000800, # alias for :NEG_ANONYMOUS
:LOCAL_CALL => 0x00004000,
}.freeze

FLAG_KEYS = FLAGS.keys.sort{|a, b| FLAGS[a] <=> FLAGS[b] }
Expand Down

0 comments on commit cccbfef

Please sign in to comment.