Skip to content

Commit 6d03d14

Browse files
dcerpcauth: Prepare fix for ccache login
1 parent 8db0e02 commit 6d03d14

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

dcerpcauth/dcerpcauth.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import (
1616
"github.com/oiweiwei/go-msrpc/ssp/credential"
1717
"github.com/oiweiwei/go-msrpc/ssp/gssapi"
1818
"github.com/oiweiwei/go-msrpc/ssp/krb5"
19+
20+
"github.com/oiweiwei/gokrb5.fork/v9/credentials"
1921
"github.com/oiweiwei/gokrb5.fork/v9/iana/etypeID"
2022
)
2123

@@ -186,7 +188,12 @@ func DCERPCCredentials(ctx context.Context, creds *adauth.Credential, options *O
186188
case creds.CCache != "":
187189
options.debug("Authenticating with ccache")
188190

189-
return credential.NewFromPassword(creds.LogonNameWithUpperCaseDomain(), ""), nil
191+
ccache, err := credentials.LoadCCache(creds.CCache)
192+
if err != nil {
193+
return nil, fmt.Errorf("load CCache: %w", err)
194+
}
195+
196+
return credential.NewFromCCache(creds.LogonNameWithUpperCaseDomain(), ccache), nil
190197
default:
191198
return nil, fmt.Errorf("no credentials available")
192199
}

0 commit comments

Comments
 (0)