* chore: bump follow-redirects to >=1.16.0 * chore: bump @xmldom/xmldom to >=0.8.12 * chore: bump serialize-javascript to >=7.0.5 * chore: bump picomatch to 2.3.2 / 4.0.4 * chore: bump flatted to >=3.4.2 * chore: bump undici to >=7.24.0 * chore: bump svgo to >=4.0.1 * chore: bump minimatch to 3.1.3 / 5.1.8 * build(deps): bump i18next-http-backend in /services/idp Bumps [i18next-http-backend](https://github.com/i18next/i18next-http-backend) from 2.7.3 to 3.0.5. - [Changelog](https://github.com/i18next/i18next-http-backend/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next-http-backend/compare/v2.7.3...v3.0.5) --- updated-dependencies: - dependency-name: i18next-http-backend dependency-version: 3.0.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump amd64/alpine from 3.23.3 to 3.23.4 in /ocis/docker Bumps amd64/alpine from 3.23.3 to 3.23.4. --- updated-dependencies: - dependency-name: amd64/alpine dependency-version: 3.23.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump actions/setup-node from 6.3.0 to 6.4.0 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.3.0 to 6.4.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/53b83947a5a98c8d113130e565377fae1a50d02f...48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump actions/setup-go from 6.3.0 to 6.4.0 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.3.0 to 6.4.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v6.3.0...4a3601121dd01d1626a1e23e37211e3254c1c06c) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump aquasecurity/trivy-action from 0.35.0 to 0.36.0 Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.35.0 to 0.36.0. - [Release notes](https://github.com/aquasecurity/trivy-action/releases) - [Commits](https://github.com/aquasecurity/trivy-action/compare/57a97c7e7821a5776cebc9bb87c984fa69cba8f1...ed142fd0673e97e23eac54620cfb913e5ce36c25) --- updated-dependencies: - dependency-name: aquasecurity/trivy-action dependency-version: 0.36.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump docker/build-push-action from 7.0.0 to 7.1.0 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 7.0.0 to 7.1.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/d08e5c354a6adb9ed34480a06d141179aa583294...bcafcacb16a39f128d818304e6c9c0c18556b85f) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump softprops/action-gh-release from 2.6.1 to 3.0.0 Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.6.1 to 3.0.0. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/153bb8e04406b158c6c84fc1615b65b24149a1fe...b4309332981a82ec1c5618f44dd2e27cc8bfbfda) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore: lock file regenerate * chore: bump Azure/go-ntlmssp to v0.1.1 --------- Signed-off-by: dependabot[bot] <support@github.com>
86 lines
1.8 KiB
Go
86 lines
1.8 KiB
Go
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
package ntlmssp
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/binary"
|
|
"fmt"
|
|
)
|
|
|
|
type challengeMessageFields struct {
|
|
messageHeader
|
|
TargetName varField
|
|
NegotiateFlags negotiateFlags
|
|
ServerChallenge [8]byte
|
|
_ [8]byte
|
|
TargetInfo varField
|
|
}
|
|
|
|
func (m challengeMessageFields) IsValid() bool {
|
|
return m.messageHeader.IsValid() && m.MessageType == 2
|
|
}
|
|
|
|
type challengeMessage struct {
|
|
challengeMessageFields
|
|
TargetName string
|
|
TargetInfo map[avID][]byte
|
|
TargetInfoRaw []byte
|
|
}
|
|
|
|
func (m *challengeMessage) UnmarshalBinary(data []byte) error {
|
|
r := bytes.NewReader(data)
|
|
err := binary.Read(r, binary.LittleEndian, &m.challengeMessageFields)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !m.IsValid() {
|
|
return fmt.Errorf("message is not a valid challenge message: %+v", m.messageHeader)
|
|
}
|
|
|
|
if m.challengeMessageFields.TargetName.Len > 0 {
|
|
m.TargetName, err = m.challengeMessageFields.TargetName.ReadStringFrom(data, m.NegotiateFlags.Has(negotiateFlagNTLMSSPNEGOTIATEUNICODE))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if m.challengeMessageFields.TargetInfo.Len > 0 {
|
|
d, err := m.challengeMessageFields.TargetInfo.ReadFrom(data)
|
|
m.TargetInfoRaw = d
|
|
if err != nil {
|
|
return err
|
|
}
|
|
m.TargetInfo = make(map[avID][]byte)
|
|
r := bytes.NewReader(d)
|
|
for {
|
|
var id avID
|
|
var l uint16
|
|
err = binary.Read(r, binary.LittleEndian, &id)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if id == avIDMsvAvEOL {
|
|
break
|
|
}
|
|
|
|
err = binary.Read(r, binary.LittleEndian, &l)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
value := make([]byte, l)
|
|
n, err := r.Read(value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if n != int(l) {
|
|
return fmt.Errorf("expected to read %d bytes, got only %d", l, n)
|
|
}
|
|
m.TargetInfo[id] = value
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|