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)
165
165
166
166
private bool Matches ( RsaSecurityKey key )
167
167
{
168
- if ( key == null )
168
+ if ( key == null || RSAKeyValue == null )
169
169
return false ;
170
170
171
171
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
334
334
MatchesKey = true ,
335
335
} ) ;
336
336
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
+
337
345
return theoryData ;
338
346
}
339
347
}
You can’t perform that action at this time.
0 commit comments