Skip to content

Commit 182b592

Browse files
committed
removed check for 4 octets in GSSAPI Windows implementation on Windows XP 32-bit.
1 parent eb05557 commit 182b592

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

MongoDB.Driver/Communication/Security/Mechanisms/WindowsGssapiImplementation.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,17 @@ public byte[] BytesToSendToServer
160160

161161
public ISaslStep Transition(SaslConversation conversation, byte[] bytesReceivedFromServer)
162162
{
163-
if (bytesReceivedFromServer == null || bytesReceivedFromServer.Length != 32) //RFC specifies this must be 4 octets
163+
// Even though RFC says that clients should specifically check this and raise an error
164+
// if it isn't true, this breaks on Windows XP, so we are skipping the check for windows
165+
// XP, identified as Win32NT 5.1: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
166+
if (Environment.OSVersion.Platform != PlatformID.Win32NT ||
167+
Environment.OSVersion.Version.Major != 5 ||
168+
Environment.OSVersion.Version.Minor != 1)
164169
{
165-
throw new MongoSecurityException("Invalid server response.");
170+
if (bytesReceivedFromServer == null || bytesReceivedFromServer.Length != 32) //RFC specifies this must be 4 octets
171+
{
172+
throw new MongoSecurityException("Invalid server response.");
173+
}
166174
}
167175

168176
byte[] decryptedBytes;

0 commit comments

Comments
 (0)