Class Swift_Transport_Esmtp_Auth_NTLMAuthenticator

InheritanceSwift_Transport_Esmtp_Auth_NTLMAuthenticator
ImplementsSwift_Transport_Esmtp_Authenticator

Handles NTLM authentication.

Public Methods

Hide inherited methods

MethodDescriptionDefined 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

Hide inherited methods

MethodDescriptionDefined By
castToByte() Cast to byte java equivalent to (byte). Swift_Transport_Esmtp_Auth_NTLMAuthenticator
convertTo16bit() Convert UTF-8 to UTF-16. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createBlob() Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createByte() Right padding with 0 to certain length. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createDesKey() Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createLMPassword() Create LMv1 response. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createLMv2Password() Create LMv2 response. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createMessage1() Create our message 1. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createMessage3() Create our message 3. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createNTLMPassword() Create NTLMv1 response. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createNTLMv2Hash() Create NTLMv2 response. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
createSecurityBuffer() Create our security buffer depending on length and offset. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
debug() Swift_Transport_Esmtp_Auth_NTLMAuthenticator
desEncrypt() DES Encryption. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
getCorrectTimestamp() Convert a normal timestamp to a tenth of a microtime epoch time. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
getDomainAndUsername() Get domain and username from our username. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
getRandomBytes() Create random bytes. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
hex2bin() Hex2bin replacement for < PHP 5.4. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
md4Encrypt() MD4 Encryption. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
md5Encrypt() MD5 Encryption. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
parseMessage2() Fetch all details of our response (message 2). Swift_Transport_Esmtp_Auth_NTLMAuthenticator
readSecurityBuffer() Read our security buffer to fetch length and offset of our value. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
readSubBlock() Read the blob information in from message2. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
sendMessage1() Send our auth message and returns the response. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
sendMessage3() Send our final message with all our data. Swift_Transport_Esmtp_Auth_NTLMAuthenticator
si2bin() Swift_Transport_Esmtp_Auth_NTLMAuthenticator
uRShift() Java unsigned right bitwise $a >>> $b. Swift_Transport_Esmtp_Auth_NTLMAuthenticator

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DESCONST 'KGS!@#$%' Swift_Transport_Esmtp_Auth_NTLMAuthenticator
NTLMSIG "NTLMSSP\x00" Swift_Transport_Esmtp_Auth_NTLMAuthenticator

Method Details

authenticate() public method

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
castToByte() protected method

Cast to byte java equivalent to (byte).

protected int castToByte ( $v )
$v int
convertTo16bit() protected method

Convert UTF-8 to UTF-16.

protected string convertTo16bit ( $input )
$input string
createBlob() protected method

protected string createBlob ( $timestamp, $client, $targetInfo )
$timestamp string

Epoch timestamp in microseconds

$client string

Random bytes

$targetInfo string
createByte() protected method

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

createDesKey() protected method

protected void createDesKey ( $key )
$key
createLMPassword() protected method

Create LMv1 response.

protected string createLMPassword ( $password, $challenge )
$password string
$challenge string
createLMv2Password() protected method

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

createMessage1() protected method

Create our message 1.

protected string createMessage1 ( )
createMessage3() protected method

Create our message 3.

protected string createMessage3 ( $domain, $username, $workstation, $lmResponse, $ntlmResponse )
$domain string
$username string
$workstation string
$lmResponse string
$ntlmResponse string
createNTLMPassword() protected method

Create NTLMv1 response.

protected string createNTLMPassword ( $password, $challenge )
$password string
$challenge string
createNTLMv2Hash() protected method
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

createSecurityBuffer() protected method

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?

debug() protected method

protected void debug ( $message )
$message string
desEncrypt() protected method

DES Encryption.

protected string desEncrypt ( $value, $key )
$value string
$key string
getAuthKeyword() public method

Get the name of the AUTH mechanism this Authenticator handles.

public string getAuthKeyword ( )
getCorrectTimestamp() protected method

Convert a normal timestamp to a tenth of a microtime epoch time.

protected string getCorrectTimestamp ( $time )
$time string
getDomainAndUsername() protected method

Get domain and username from our username.

protected array getDomainAndUsername ( $name )
$name string
getRandomBytes() protected method

Create random bytes.

protected string getRandomBytes ( $length )
$length
hex2bin() protected method

Hex2bin replacement for < PHP 5.4.

protected string hex2bin ( $hex )
$hex string
return string

Binary

md4Encrypt() protected method

MD4 Encryption.

See also http://php.net/manual/en/ref.hash.php.

protected string md4Encrypt ( $input )
$input string
md5Encrypt() protected method

MD5 Encryption.

protected string md5Encrypt ( $key, $msg )
$key string

Encryption key

$msg string

Message to encrypt

parseMessage2() protected method

Fetch all details of our response (message 2).

protected array parseMessage2 ( $response )
$response string
return array

Our response parsed

readSecurityBuffer() protected method

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

readSubBlock() protected method

Read the blob information in from message2.

protected array readSubBlock ( $block )
$block
sendMessage1() protected method

Send our auth message and returns the response.

protected string sendMessage1 ( Swift_Transport_SmtpAgent $agent )
$agent Swift_Transport_SmtpAgent
return string

SMTP Response

sendMessage3() protected method

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

si2bin() protected method

protected void si2bin ( $si, $bits 32 )
$si
$bits
uRShift() protected method

Java unsigned right bitwise $a >>> $b.

protected int uRShift ( $a, $b )
$a int
$b int