-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(auth) Fix bug #1515 PLAIN and LOGIN always returning failure if "…
…allow any" turned off. (#1551)
- Loading branch information
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
smtpserver/Rnwood.SmtpServer.Tests/Extensions/Auth/PlainMechanismProcessorTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the.NET Foundation under one or more agreements. | ||
// The.NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Rnwood.SmtpServer.Extensions.Auth; | ||
using Xunit; | ||
|
||
namespace Rnwood.SmtpServer.Tests.Extensions.Auth | ||
{ | ||
public class PlainMechanismProcessorTests | ||
{ | ||
|
||
[Fact] | ||
public void ValidateCredentials_Correct() | ||
{ | ||
var creds = new PlainAuthenticationCredentials("a", "b"); | ||
bool result = creds.ValidateResponse("b"); | ||
|
||
Assert.True(result); | ||
} | ||
|
||
[Fact] | ||
public void ValidateCredentials_Incorrect() | ||
{ | ||
var creds = new PlainAuthenticationCredentials("a", "b"); | ||
bool result = creds.ValidateResponse("c"); | ||
|
||
Assert.False(result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.