mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-01 13:34:31 +02:00
SimpleProtectedNegotiationTokenResponse: Bugfix: GetBytes threw exception when MechanismListMIC was not null
This commit is contained in:
parent
b3f0c3dfd0
commit
2b5be7b291
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
/* Copyright (C) 2017-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
*
|
||||
* You can redistribute this program and/or modify it under the terms of
|
||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||
|
@ -133,6 +133,14 @@ namespace SMBLibrary.Authentication.GSSAPI
|
|||
int responseTokenLength = 1 + responseTokenConstructionLengthFieldSize + 1 + responseTokenBytesLengthFieldSize + ResponseToken.Length;
|
||||
result += responseTokenLength;
|
||||
}
|
||||
if (MechanismListMIC != null)
|
||||
{
|
||||
int mechanismListMICBytesLengthFieldSize = DerEncodingHelper.GetLengthFieldSize(MechanismListMIC.Length);
|
||||
int mechanismListMICConstructionLength = 1 + mechanismListMICBytesLengthFieldSize + MechanismListMIC.Length;
|
||||
int mechanismListMICConstructionLengthFieldSize = DerEncodingHelper.GetLengthFieldSize(mechanismListMICConstructionLength);
|
||||
int responseTokenLength = 1 + mechanismListMICConstructionLengthFieldSize + 1 + mechanismListMICBytesLengthFieldSize + MechanismListMIC.Length;
|
||||
result += responseTokenLength;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue