@@ -103,7 +103,8 @@ protected function __construct(EncodingConverterInterface $encoding_converter)
103103 * @param int $negotiate_flags The negotiation flags encoded in the message.
104104 * @param string $lm_challenge_response The calcualted LM response.
105105 * @param string $nt_challenge_response The calcualted NT response.
106- * @param string $nt_domain The domain name of the NT user authenticating.
106+ * @param string $target_name The "TargetName" (domain/server name) of the
107+ * NT user authenticating.
107108 * @param string $username The user's "username".
108109 * @param string $client_hostname The hostname of the client (the hostname
109110 * of the machine calling this code).
@@ -114,7 +115,7 @@ public function encodeBinaryMessageString(
114115 $ negotiate_flags ,
115116 $ lm_challenge_response ,
116117 $ nt_challenge_response ,
117- $ nt_domain ,
118+ $ target_name ,
118119 $ username ,
119120 $ client_hostname ,
120121 $ session_key
@@ -128,7 +129,7 @@ public function encodeBinaryMessageString(
128129
129130 // Convert our provided values to proper encoding
130131 $ username = $ this ->encoding_converter ->convert ($ username , $ expected_encoding );
131- $ nt_domain = $ this ->encoding_converter ->convert (strtoupper ($ nt_domain ), $ expected_encoding );
132+ $ target_name = $ this ->encoding_converter ->convert (strtoupper ($ target_name ), $ expected_encoding );
132133 $ client_hostname = $ this ->encoding_converter ->convert (strtoupper ($ client_hostname ), $ expected_encoding );
133134 $ session_key = $ this ->encoding_converter ->convert (strtoupper ($ session_key ), $ expected_encoding );
134135
@@ -157,13 +158,13 @@ public function encodeBinaryMessageString(
157158 $ binary_string .= pack ('V ' , $ message_position ); // 32-bit unsigned little-endian, 1st value in the payload
158159 $ message_position += $ nt_response_length ;
159160
160- $ domain_name_length = strlen ($ nt_domain );
161+ $ target_name_length = strlen ($ target_name );
161162
162163 // Domain name fields: length; length; offset of the value from the beginning of the message
163- $ binary_string .= pack ('v ' , $ domain_name_length ); // 16-bit unsigned little-endian
164- $ binary_string .= pack ('v ' , $ domain_name_length ); // 16-bit unsigned little-endian
164+ $ binary_string .= pack ('v ' , $ target_name_length ); // 16-bit unsigned little-endian
165+ $ binary_string .= pack ('v ' , $ target_name_length ); // 16-bit unsigned little-endian
165166 $ binary_string .= pack ('V ' , $ message_position ); // 32-bit unsigned little-endian, 1st value in the payload
166- $ message_position += $ domain_name_length ;
167+ $ message_position += $ target_name_length ;
167168
168169 $ username_length = strlen ($ username );
169170
@@ -194,7 +195,7 @@ public function encodeBinaryMessageString(
194195 // Add our payload data
195196 $ binary_string .= $ lm_challenge_response ;
196197 $ binary_string .= $ nt_challenge_response ;
197- $ binary_string .= $ nt_domain ;
198+ $ binary_string .= $ target_name ;
198199 $ binary_string .= $ username ;
199200 $ binary_string .= $ client_hostname ;
200201 $ binary_string .= $ session_key ;
0 commit comments