File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/Microsoft.IdentityModel.Xml
test/Microsoft.IdentityModel.Xml.Tests Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ private bool Matches(X509SecurityKey key)
165165
166166 private bool Matches ( RsaSecurityKey key )
167167 {
168- if ( key == null )
168+ if ( key == null || RSAKeyValue == null )
169169 return false ;
170170
171171 if ( ! key . Parameters . Equals ( default ( RSAParameters ) ) )
Original file line number Diff line number Diff line change @@ -334,6 +334,14 @@ public static TheoryData<KeyInfoTheoryData> KeyInfoMatchesTheoryData
334334 MatchesKey = true ,
335335 } ) ;
336336
337+ theoryData . Add ( new KeyInfoTheoryData ( "NullRSAKeyValue" )
338+ {
339+ ExpectedException = ExpectedException . NoExceptionExpected ,
340+ KeyInfo = new KeyInfo ( ) , // This will have null RSAKeyValue
341+ SecurityKey = KeyingMaterial . RsaSecurityKey_2048_Public ,
342+ MatchesKey = false ,
343+ } ) ;
344+
337345 return theoryData ;
338346 }
339347 }
You can’t perform that action at this time.
0 commit comments