Fix linter errors

This commit is contained in:
Bryan McNulty
2025-04-30 00:59:53 -05:00
committed by Erik Geiser
parent ee7e2146f9
commit 3a9cc94321
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -352,7 +352,6 @@ func addKeyToKeytab(kt *keytab.Keytab, username string, domain string, key strin
// ParseAESKey decodes the supplied hex Kerberos AES key and determines the key type.
func ParseAESKey(key string) (keyBytes []byte, keyType int32, err error) {
keyBytes, err = hex.DecodeString(key)
if err != nil {
return nil, 0, fmt.Errorf("decode hex key: %w", err)
@@ -366,5 +365,6 @@ func ParseAESKey(key string) (keyBytes []byte, keyType int32, err error) {
default:
return nil, 0, fmt.Errorf("invalid AES128/AES256 key")
}
return
}
+1
View File
@@ -135,6 +135,7 @@ func DCERPCCredentials(ctx context.Context, creds *adauth.Credential, options *O
if err != nil {
return nil, fmt.Errorf("parse AES key: %w", err)
}
return credential.NewFromEncryptionKeyBytes(creds.LogonNameWithUpperCaseDomain(), int(keyType), key), nil
case creds.NTHash != "":
options.debug("Authenticating with NT hash")