Skip to content

Commit c9cfeb6

Browse files
committed
channel-bindings
1 parent 1840ba7 commit c9cfeb6

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

v3/channelbinding.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package gssapi
33

44
import "net"
55

6-
type gssAddressFamily int
6+
type GssAddressFamily int
77

88
const (
9-
GssAddrFamilyUNSPEC gssAddressFamily = 0
10-
GssAddrFamilyLOCAL gssAddressFamily = 1 << iota
9+
GssAddrFamilyUNSPEC GssAddressFamily = 0
10+
GssAddrFamilyLOCAL GssAddressFamily = 1 << iota
1111
GssAddrFamilyINET
1212
GssAddrFamilyIMPLINK
1313
GssAddrFamilyPUP

v3/provider.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ func NewProvider(name string) Provider {
4343
type QoP uint
4444

4545
type InitSecContextOptions struct {
46-
Credential Credential
47-
Mech GssMech
48-
Flags ContextFlag
49-
Lifetime time.Duration
46+
Credential Credential
47+
Mech GssMech
48+
Flags ContextFlag
49+
Lifetime time.Duration
50+
ChannelBinding *ChannelBinding
5051
}
5152

5253
type InitSecContextOption func(o *InitSecContextOptions)
@@ -75,6 +76,12 @@ func WithInitiatorLifetime(life time.Duration) InitSecContextOption {
7576
}
7677
}
7778

79+
func WithChannelBinding(cb *ChannelBinding) InitSecContextOption {
80+
return func(o *InitSecContextOptions) {
81+
o.ChannelBinding = cb
82+
}
83+
}
84+
7885
// Provider is the interface that defines the top level GSSAPI functions that
7986
// create name, credential and security contexts
8087
type Provider interface {
@@ -125,7 +132,7 @@ type Provider interface {
125132
//
126133
// A partially established context may allow the creation of protected messages.
127134
// Check the [SecContextInfo.ProtectionReady] flag by calling [SecContext.Inquire()].
128-
AcceptSecContext(cred Credential, inputToken []byte) (SecContext, []byte, error) // RFC 2743 § 2.2.2
135+
AcceptSecContext(cred Credential, inputToken []byte, cb *ChannelBinding) (SecContext, []byte, error) // RFC 2743 § 2.2.2
129136

130137
// ImportSecContext corresponds to the GSS_Import_sec_context function from RFC 2743 § 2.2.9
131138
// Parameters:

0 commit comments

Comments
 (0)