Skip to content

Commit 44d78f3

Browse files
author
Theo Dumitrescu (from Dev Box)
committed
renamed DelegationInfo.ChannelBinding in DelegationInfo.ChannelBindingHash
1 parent 1e48486 commit 44d78f3

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

Kerberos.NET/Entities/Krb/DelegationInfo.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public DelegationInfo(RequestServiceTicket rst)
4545

4646
if (rst.ChannelBindings != null)
4747
{
48-
this.ChannelBinding = rst.ChannelBindings.ComputeBindingHash();
48+
this.ChannelBindingHash = rst.ChannelBindings.ComputeBindingHash();
4949
}
5050
}
5151

@@ -54,13 +54,13 @@ public ReadOnlyMemory<byte> Encode()
5454
using (var stream = new MemoryStream())
5555
using (var writer = new BinaryWriter(stream))
5656
{
57-
if (this.ChannelBinding.Length == 0)
57+
if (this.ChannelBindingHash.Length == 0)
5858
{
59-
this.ChannelBinding = new byte[ChannelBindingLength];
59+
this.ChannelBindingHash = new byte[ChannelBindingLength];
6060
}
6161

62-
writer.Write(this.ChannelBinding.Length);
63-
writer.Write(this.ChannelBinding.ToArray());
62+
writer.Write(this.ChannelBindingHash.Length);
63+
writer.Write(this.ChannelBindingHash.ToArray());
6464

6565
if (this.DelegationTicket != null)
6666
{
@@ -90,7 +90,7 @@ public DelegationInfo Decode(ReadOnlyMemory<byte> value)
9090
{
9191
this.Length = reader.ReadInt32();
9292

93-
this.ChannelBinding = reader.ReadBytes(this.Length);
93+
this.ChannelBindingHash = reader.ReadBytes(this.Length);
9494

9595
this.Flags = (GssContextEstablishmentFlag)reader.ReadBytes(4).AsLong(littleEndian: true);
9696

@@ -129,7 +129,7 @@ public DelegationInfo Decode(ReadOnlyMemory<byte> value)
129129

130130
public int Length { get; set; }
131131

132-
public ReadOnlyMemory<byte> ChannelBinding { get; set; }
132+
public ReadOnlyMemory<byte> ChannelBindingHash { get; set; }
133133

134134
public GssContextEstablishmentFlag Flags { get; set; }
135135

@@ -139,4 +139,4 @@ public DelegationInfo Decode(ReadOnlyMemory<byte> value)
139139

140140
public ReadOnlyMemory<byte> Extensions { get; set; }
141141
}
142-
}
142+
}

Kerberos.NET/Entities/Krb/KrbTgsReq.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private static KrbApReq CreateApReq(KrbKdcRep kdcRep, KrbEncryptionKey tgtSessio
215215
if (channelBindings != null)
216216
{
217217
var delegInfo = new DelegationInfo();
218-
delegInfo.ChannelBinding = channelBindings.ComputeBindingHash();
218+
delegInfo.ChannelBindingHash = channelBindings.ComputeBindingHash();
219219
authenticator.Checksum = KrbChecksum.EncodeDelegationChecksum(delegInfo);
220220
}
221221

Tests/Tests.Kerberos.NET/KrbApReq/ChannelBindingTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ public void DelegationInfo_ChannelBindings_Roundtrip()
112112

113113
var delegInfo = new DelegationInfo(rst);
114114

115-
Assert.AreEqual(16, delegInfo.ChannelBinding.Length);
116-
Assert.IsTrue(expectedHash.Span.SequenceEqual(delegInfo.ChannelBinding.Span));
115+
Assert.AreEqual(16, delegInfo.ChannelBindingHash.Length);
116+
Assert.IsTrue(expectedHash.Span.SequenceEqual(delegInfo.ChannelBindingHash.Span));
117117

118118
var encoded = delegInfo.Encode();
119119
var decoded = new DelegationInfo().Decode(encoded);
120120

121-
Assert.IsTrue(expectedHash.Span.SequenceEqual(decoded.ChannelBinding.Span));
121+
Assert.IsTrue(expectedHash.Span.SequenceEqual(decoded.ChannelBindingHash.Span));
122122
}
123123

124124
[TestMethod]
@@ -132,14 +132,14 @@ public void DelegationInfo_NoChannelBindings_ZeroPadded()
132132
var delegInfo = new DelegationInfo(rst);
133133

134134
// Should be zero-length before encoding
135-
Assert.AreEqual(0, delegInfo.ChannelBinding.Length);
135+
Assert.AreEqual(0, delegInfo.ChannelBindingHash.Length);
136136

137137
// After encoding/decoding it becomes 16 zero-bytes
138138
var encoded = delegInfo.Encode();
139139
var decoded = new DelegationInfo().Decode(encoded);
140140

141-
Assert.AreEqual(16, decoded.ChannelBinding.Length);
142-
Assert.IsTrue(decoded.ChannelBinding.Span.SequenceEqual(new byte[16]));
141+
Assert.AreEqual(16, decoded.ChannelBindingHash.Length);
142+
Assert.IsTrue(decoded.ChannelBindingHash.Span.SequenceEqual(new byte[16]));
143143
}
144144

145145
// -- Authenticator checksum encoding with channel bindings --

0 commit comments

Comments
 (0)