PHP Class Swift_Transport_Esmtp_Auth_NTLMAuthenticator

Author: Ward Peeters ([email protected])
Inheritance: implements Swift_Transport_Esmtp_Authenticator
Afficher le fichier Open project: swiftmailer/swiftmailer

Méthodes publiques

Méthode Description
authenticate ( Swift_Transport_SmtpAgent $agent, string $username, string $password ) : boolean Try to authenticate the user with $username and $password.
getAuthKeyword ( ) : string Get the name of the AUTH mechanism this Authenticator handles.

Méthodes protégées

Méthode Description
castToByte ( integer $v ) : integer Cast to byte java equivalent to (byte).
convertTo16bit ( string $input ) : string Convert UTF-8 to UTF-16.
createBlob ( string $timestamp, string $client, string $targetInfo ) : string
createByte ( string $input, integer $bytes = 4, boolean $isHex = true ) : string Right padding with 0 to certain length.
createDesKey ( $key )
createLMPassword ( string $password, string $challenge ) : string Create LMv1 response.
createLMv2Password ( string $password, string $username, string $domain, string $challenge, string $client ) : string Create LMv2 response.
createMessage1 ( ) : string Create our message 1.
createMessage3 ( string $domain, string $username, string $workstation, string $lmResponse, string $ntlmResponse ) : string Create our message 3.
createNTLMPassword ( string $password, string $challenge ) : string Create NTLMv1 response.
createNTLMv2Hash ( string $password, string $username, string $domain, string $challenge, string $targetInfo, string $timestamp, string $client ) : string Create NTLMv2 response.
createSecurityBuffer ( string $value, integer $offset, boolean $is16 = false ) : string Create our security buffer depending on length and offset.
debug ( string $message )
desEncrypt ( string $value, string $key ) : string DES Encryption.
getCorrectTimestamp ( string $time ) : string Convert a normal timestamp to a tenth of a microtime epoch time.
getDomainAndUsername ( string $name ) : array Get domain and username from our username.
getRandomBytes ( $length ) : string Create random bytes.
md4Encrypt ( string $input ) : string MD4 Encryption.
md5Encrypt ( string $key, string $msg ) : string MD5 Encryption.
parseMessage2 ( string $response ) : array Fetch all details of our response (message 2).
readSecurityBuffer ( string $value ) : array Read our security buffer to fetch length and offset of our value.
readSubBlock ( $block ) : array Read the blob information in from message2.
sendMessage1 ( Swift_Transport_SmtpAgent $agent ) : string Send our auth message and returns the response.
sendMessage3 ( string $response, string $username, string $password, string $timestamp, string $client, Swift_Transport_SmtpAgent $agent, boolean $v2 = true ) : string Send our final message with all our data.
si2bin ( $si, $bits = 32 )
uRShift ( integer $a, integer $b ) : integer Java unsigned right bitwise $a >>> $b.

Method Details

authenticate() public méthode

Try to authenticate the user with $username and $password.
public authenticate ( Swift_Transport_SmtpAgent $agent, string $username, string $password ) : boolean
$agent Swift_Transport_SmtpAgent
$username string
$password string
Résultat boolean

castToByte() protected méthode

Cast to byte java equivalent to (byte).
protected castToByte ( integer $v ) : integer
$v integer
Résultat integer

convertTo16bit() protected méthode

Convert UTF-8 to UTF-16.
protected convertTo16bit ( string $input ) : string
$input string
Résultat string

createBlob() protected méthode

protected createBlob ( string $timestamp, string $client, string $targetInfo ) : string
$timestamp string Epoch timestamp in microseconds
$client string Random bytes
$targetInfo string
Résultat string

createByte() protected méthode

Right padding with 0 to certain length.
protected createByte ( string $input, integer $bytes = 4, boolean $isHex = true ) : string
$input string
$bytes integer Length of bytes
$isHex boolean Did we provided hex value
Résultat string

createDesKey() protected méthode

protected createDesKey ( $key )

createLMPassword() protected méthode

Create LMv1 response.
protected createLMPassword ( string $password, string $challenge ) : string
$password string
$challenge string
Résultat string

createLMv2Password() protected méthode

Create LMv2 response.
protected createLMv2Password ( string $password, string $username, string $domain, string $challenge, string $client ) : string
$password string
$username string
$domain string
$challenge string NTLM Challenge
$client string Random string
Résultat string

createMessage1() protected méthode

Create our message 1.
protected createMessage1 ( ) : string
Résultat string

createMessage3() protected méthode

Create our message 3.
protected createMessage3 ( string $domain, string $username, string $workstation, string $lmResponse, string $ntlmResponse ) : string
$domain string
$username string
$workstation string
$lmResponse string
$ntlmResponse string
Résultat string

createNTLMPassword() protected méthode

Create NTLMv1 response.
protected createNTLMPassword ( string $password, string $challenge ) : string
$password string
$challenge string
Résultat string

createNTLMv2Hash() protected méthode

Create NTLMv2 response.
See also: http://davenport.sourceforge.net/ntlm.html#theNtlmResponse
protected createNTLMv2Hash ( string $password, string $username, string $domain, string $challenge, string $targetInfo, string $timestamp, string $client ) : string
$password string
$username string
$domain string
$challenge string Hex values
$targetInfo string Hex values
$timestamp string
$client string Random bytes
Résultat string

createSecurityBuffer() protected méthode

Create our security buffer depending on length and offset.
protected createSecurityBuffer ( string $value, integer $offset, boolean $is16 = false ) : string
$value string Value we want to put in
$offset integer start of value
$is16 boolean Do we 16bit string or not?
Résultat string

debug() protected méthode

protected debug ( string $message )
$message string

desEncrypt() protected méthode

DES Encryption.
protected desEncrypt ( string $value, string $key ) : string
$value string An 8-byte string
$key string
Résultat string

getAuthKeyword() public méthode

Get the name of the AUTH mechanism this Authenticator handles.
public getAuthKeyword ( ) : string
Résultat string

getCorrectTimestamp() protected méthode

Convert a normal timestamp to a tenth of a microtime epoch time.
protected getCorrectTimestamp ( string $time ) : string
$time string
Résultat string

getDomainAndUsername() protected méthode

Get domain and username from our username.
protected getDomainAndUsername ( string $name ) : array
$name string
Résultat array

getRandomBytes() protected méthode

Create random bytes.
protected getRandomBytes ( $length ) : string
$length
Résultat string

md4Encrypt() protected méthode

MD4 Encryption.
See also: http://php.net/manual/en/ref.hash.php
protected md4Encrypt ( string $input ) : string
$input string
Résultat string

md5Encrypt() protected méthode

MD5 Encryption.
protected md5Encrypt ( string $key, string $msg ) : string
$key string Encryption key
$msg string Message to encrypt
Résultat string

parseMessage2() protected méthode

Fetch all details of our response (message 2).
protected parseMessage2 ( string $response ) : array
$response string
Résultat array our response parsed

readSecurityBuffer() protected méthode

Read our security buffer to fetch length and offset of our value.
protected readSecurityBuffer ( string $value ) : array
$value string Securitybuffer in hex
Résultat array array with length and offset

readSubBlock() protected méthode

Read the blob information in from message2.
protected readSubBlock ( $block ) : array
$block
Résultat array

sendMessage1() protected méthode

Send our auth message and returns the response.
protected sendMessage1 ( Swift_Transport_SmtpAgent $agent ) : string
$agent Swift_Transport_SmtpAgent
Résultat string SMTP Response

sendMessage3() protected méthode

Send our final message with all our data.
protected sendMessage3 ( string $response, string $username, string $password, string $timestamp, string $client, Swift_Transport_SmtpAgent $agent, boolean $v2 = true ) : string
$response string Message 1 response (message 2)
$username string
$password string
$timestamp string
$client string
$agent Swift_Transport_SmtpAgent
$v2 boolean Use version2 of the protocol
Résultat string

si2bin() protected méthode

protected si2bin ( $si, $bits = 32 )

uRShift() protected méthode

Java unsigned right bitwise $a >>> $b.
protected uRShift ( integer $a, integer $b ) : integer
$a integer
$b integer
Résultat integer