Class Swift_Transport_Esmtp_Auth_NTLMAuthenticator
Inheritance | Swift_Transport_Esmtp_Auth_NTLMAuthenticator |
---|---|
Implements | Swift_Transport_Esmtp_Authenticator |
Handles NTLM authentication.
Public Methods
Method | Description | Defined By |
---|---|---|
authenticate() | Try to authenticate the user with $username and $password. | Swift_Transport_Esmtp_Auth_NTLMAuthenticator |
getAuthKeyword() | Get the name of the AUTH mechanism this Authenticator handles. | Swift_Transport_Esmtp_Auth_NTLMAuthenticator |
Protected Methods
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
DESCONST | 'KGS!@#$%' | Swift_Transport_Esmtp_Auth_NTLMAuthenticator | |
NTLMSIG | "NTLMSSP\x00" | Swift_Transport_Esmtp_Auth_NTLMAuthenticator |
Method Details
Try to authenticate the user with $username and $password.
public bool authenticate ( Swift_Transport_SmtpAgent $agent, $username, $password ) | ||
$agent | Swift_Transport_SmtpAgent | |
$username | string | |
$password | string |
Cast to byte java equivalent to (byte).
protected int castToByte ( $v ) | ||
$v | int |
Convert UTF-8 to UTF-16.
protected string convertTo16bit ( $input ) | ||
$input | string |
protected string createBlob ( $timestamp, $client, $targetInfo ) | ||
$timestamp | string | Epoch timestamp in microseconds |
$client | string | Random bytes |
$targetInfo | string |
Right padding with 0 to certain length.
protected string createByte ( $input, $bytes = 4, $isHex = true ) | ||
$input | string | |
$bytes | int | Length of bytes |
$isHex | bool | Did we provided hex value |
protected void createDesKey ( $key ) | ||
$key |
Create LMv1 response.
protected string createLMPassword ( $password, $challenge ) | ||
$password | string | |
$challenge | string |
Create LMv2 response.
protected string createLMv2Password ( $password, $username, $domain, $challenge, $client ) | ||
$password | string | |
$username | string | |
$domain | string | |
$challenge | string | NTLM Challenge |
$client | string | Random string |
Create our message 1.
protected string createMessage1 ( ) |
Create our message 3.
protected string createMessage3 ( $domain, $username, $workstation, $lmResponse, $ntlmResponse ) | ||
$domain | string | |
$username | string | |
$workstation | string | |
$lmResponse | string | |
$ntlmResponse | string |
Create NTLMv1 response.
protected string createNTLMPassword ( $password, $challenge ) | ||
$password | string | |
$challenge | string |
Create NTLMv2 response.
See also http://davenport.sourceforge.net/ntlm.html#theNtlmResponse.
protected string createNTLMv2Hash ( $password, $username, $domain, $challenge, $targetInfo, $timestamp, $client ) | ||
$password | string | |
$username | string | |
$domain | string | |
$challenge | string | Hex values |
$targetInfo | string | Hex values |
$timestamp | string | |
$client | string | Random bytes |
Create our security buffer depending on length and offset.
protected string createSecurityBuffer ( $value, $offset, $is16 = false ) | ||
$value | string | Value we want to put in |
$offset | int | Start of value |
$is16 | bool | Do we 16bit string or not? |
protected void debug ( $message ) | ||
$message | string |
DES Encryption.
protected string desEncrypt ( $value, $key ) | ||
$value | string | |
$key | string |
Get the name of the AUTH mechanism this Authenticator handles.
public string getAuthKeyword ( ) |
Convert a normal timestamp to a tenth of a microtime epoch time.
protected string getCorrectTimestamp ( $time ) | ||
$time | string |
Get domain and username from our username.
protected array getDomainAndUsername ( $name ) | ||
$name | string |
Create random bytes.
protected string getRandomBytes ( $length ) | ||
$length |
Hex2bin replacement for < PHP 5.4.
protected string hex2bin ( $hex ) | ||
$hex | string | |
return | string | Binary |
---|
MD4 Encryption.
See also http://php.net/manual/en/ref.hash.php.
protected string md4Encrypt ( $input ) | ||
$input | string |
MD5 Encryption.
protected string md5Encrypt ( $key, $msg ) | ||
$key | string | Encryption key |
$msg | string | Message to encrypt |
Fetch all details of our response (message 2).
protected array parseMessage2 ( $response ) | ||
$response | string | |
return | array | Our response parsed |
---|
Read our security buffer to fetch length and offset of our value.
protected array readSecurityBuffer ( $value ) | ||
$value | string | Securitybuffer in hex |
return | array | Array with length and offset |
---|
Read the blob information in from message2.
protected array readSubBlock ( $block ) | ||
$block |
Send our auth message and returns the response.
protected string sendMessage1 ( Swift_Transport_SmtpAgent $agent ) | ||
$agent | Swift_Transport_SmtpAgent | |
return | string | SMTP Response |
---|
Send our final message with all our data.
protected string sendMessage3 ( $response, $username, $password, $timestamp, $client, Swift_Transport_SmtpAgent $agent, $v2 = true ) | ||
$response | string | Message 1 response (message 2) |
$username | string | |
$password | string | |
$timestamp | string | |
$client | string | |
$agent | Swift_Transport_SmtpAgent | |
$v2 | bool | Use version2 of the protocol |
protected void si2bin ( $si, $bits = 32 ) | ||
$si | ||
$bits |
Java unsigned right bitwise $a >>> $b.
protected int uRShift ( $a, $b ) | ||
$a | int | |
$b | int |