File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2828using System . Linq ;
2929using System . Security . Policy ;
3030using System . Text ;
31+ using System . Text . RegularExpressions ;
3132using System . Threading ;
3233using System . Web . Services . Configuration ;
3334
@@ -139,13 +140,15 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe
139140 if ( sanDict [ "dns" ] . Count ( ) > 0 )
140141 {
141142 string dnsSan = sanDict [ "dns" ] [ 0 ] ;
142- matchedDomains = validDomains . Where ( d => dnsSan . EndsWith ( $ ".{ d . DomainName } ", StringComparison . OrdinalIgnoreCase ) ) . ToList ( ) ;
143+ matchedDomains = validDomains . Where ( d => dnsSan . Equals ( d . DomainName , StringComparison . OrdinalIgnoreCase )
144+ || dnsSan . EndsWith ( $ ".{ d . DomainName } ", StringComparison . OrdinalIgnoreCase ) ) . ToList ( ) ;
143145 commonName = dnsSan ;
144146 }
145147 }
146148 else
147149 {
148- matchedDomains = validDomains . Where ( d => commonName . EndsWith ( $ ".{ d . DomainName } ", StringComparison . OrdinalIgnoreCase ) ) . ToList ( ) ;
150+ matchedDomains = validDomains . Where ( d => commonName . Equals ( d . DomainName , StringComparison . OrdinalIgnoreCase )
151+ || commonName . EndsWith ( $ ".{ d . DomainName } ", StringComparison . OrdinalIgnoreCase ) ) . ToList ( ) ;
149152 }
150153
151154 if ( matchedDomains == null || matchedDomains . Count == 0 )
You can’t perform that action at this time.
0 commit comments