Skip to content

Commit

Permalink
checkKerberosTicketEncryption fix (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
clin-ms authored Dec 2, 2022
1 parent 75a7597 commit 0d684ae
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions AzFilesHybrid/AzFilesHybrid.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3408,19 +3408,26 @@ function Debug-KerberosTicketEncryption
$klistResult = klist.exe get $spnValue

$kerberosTicketEncryptionClient = @()
foreach($line in $klistResult){
if(!$line.Contains("KerbTicket Encryption Type"))
{
continue
}
if (!($kerberosTicketEncryptionClient.Contains("AES256")) -and $line.Contains("AES-256"))
{
$kerberosTicketEncryptionClient += "AES256"
}
if (!($kerberosTicketEncryptionClient.Contains("RC4HMAC")) -and $line.Contains("RC4-HMAC"))

$lastLine = ""
foreach($currLine in $klistResult){

if($lastLine.Contains($spnValue))
{
$kerberosTicketEncryptionClient += "RC4HMAC"
if($currLine.Contains("AES-256"))
{
$kerberosTicketEncryptionClient += "AES256"
break
}

if($currLine.Contains("RC4-HMAC"))
{
$kerberosTicketEncryptionClient += "RC4HMAC"
break
}

}
$lastLine = $currLine
}

if ($kerberosTicketEncryptionClient.Count -eq 0)
Expand Down

0 comments on commit 0d684ae

Please sign in to comment.