|
3 | 3 |
|
4 | 4 | using System.Security.Cryptography.Encryption.RC2.Tests;
|
5 | 5 | using System.Text;
|
| 6 | +using Microsoft.DotNet.XUnitExtensions; |
6 | 7 | using Test.Cryptography;
|
7 | 8 | using Xunit;
|
8 | 9 |
|
@@ -122,9 +123,17 @@ public static void ReadWriteDiminishedDPPrivatePkcs1()
|
122 | 123 | TestData.DiminishedDPParameters);
|
123 | 124 | }
|
124 | 125 |
|
125 |
| - [ConditionalFact(typeof(ImportExport), nameof(ImportExport.Supports16384))] |
| 126 | + [ConditionalFact] |
| 127 | + [OuterLoop("RSA 16384 takes considerable time.")] |
126 | 128 | public static void ReadWritePublicPkcs1()
|
127 | 129 | {
|
| 130 | + // Do not move this to the [ConditionalFact], otherwise the platform will check if RSA 16384 is supported |
| 131 | + // during test discovery for innerloop, and the check itself is expensive. |
| 132 | + if (!ImportExport.Supports16384) |
| 133 | + { |
| 134 | + throw new SkipTestException("Platform does not support RSA 16384."); |
| 135 | + } |
| 136 | + |
128 | 137 | ReadWriteBase64PublicPkcs1(
|
129 | 138 | @"
|
130 | 139 | MIIICgKCCAEAmyxwX6kQNx+LSMao1StC1p5rKCEwcBjzI136An3B/BjthgezAOuu
|
@@ -198,9 +207,18 @@ public static void ReadWriteSubjectPublicKeyInfo_DiminishedDPKey()
|
198 | 207 | TestData.DiminishedDPParameters);
|
199 | 208 | }
|
200 | 209 |
|
201 |
| - [ConditionalFact(typeof(ImportExport), nameof(ImportExport.Supports16384))] |
| 210 | + |
| 211 | + [ConditionalFact] |
| 212 | + [OuterLoop("RSA 16384 takes considerable time.")] |
202 | 213 | public static void ReadWriteRsa16384SubjectPublicKeyInfo()
|
203 | 214 | {
|
| 215 | + // Do not move this to the [ConditionalFact], otherwise the platform will check if RSA 16384 is supported |
| 216 | + // during test discovery for innerloop, and the check itself is expensive. |
| 217 | + if (!ImportExport.Supports16384) |
| 218 | + { |
| 219 | + throw new SkipTestException("Platform does not support RSA 16384."); |
| 220 | + } |
| 221 | + |
204 | 222 | ReadWriteBase64SubjectPublicKeyInfo(
|
205 | 223 | @"
|
206 | 224 | MIIIIjANBgkqhkiG9w0BAQEFAAOCCA8AMIIICgKCCAEAmyxwX6kQNx+LSMao1StC
|
@@ -250,9 +268,17 @@ public static void ReadWriteRsa16384SubjectPublicKeyInfo()
|
250 | 268 | TestData.RSA16384Params);
|
251 | 269 | }
|
252 | 270 |
|
253 |
| - [ConditionalFact(typeof(ImportExport), nameof(ImportExport.Supports16384))] |
| 271 | + [ConditionalFact] |
| 272 | + [OuterLoop("RSA 16384 takes considerable time.")] |
254 | 273 | public static void ReadWrite16384Pkcs8()
|
255 | 274 | {
|
| 275 | + // Do not move this to the [ConditionalFact], otherwise the platform will check if RSA 16384 is supported |
| 276 | + // during test discovery for innerloop, and the check itself is expensive. |
| 277 | + if (!ImportExport.Supports16384) |
| 278 | + { |
| 279 | + throw new SkipTestException("Platform does not support RSA 16384"); |
| 280 | + } |
| 281 | + |
256 | 282 | ReadWriteBase64Pkcs8(
|
257 | 283 | @"
|
258 | 284 | MIIkQgIBADANBgkqhkiG9w0BAQEFAASCJCwwgiQoAgEAAoIIAQCbLHBfqRA3H4tI
|
@@ -525,9 +551,17 @@ public static void ReadEncryptedRsa1032()
|
525 | 551 | TestData.RSA1032Parameters);
|
526 | 552 | }
|
527 | 553 |
|
528 |
| - [ConditionalFact(typeof(ImportExport), nameof(ImportExport.Supports16384))] |
| 554 | + [ConditionalFact] |
| 555 | + [OuterLoop("RSA 16384 takes considerable time.")] |
529 | 556 | public static void ReadEncryptedRsa16384()
|
530 | 557 | {
|
| 558 | + // Do not move this to the [ConditionalFact], otherwise the platform will check if RSA 16384 is supported |
| 559 | + // during test discovery for innerloop, and the check itself is expensive. |
| 560 | + if (!ImportExport.Supports16384) |
| 561 | + { |
| 562 | + throw new SkipTestException("Platform does not support RSA 16384"); |
| 563 | + } |
| 564 | + |
531 | 565 | // PBES2: PBKDF2 + des (single DES, not 3DES).
|
532 | 566 | const string base64 = @"
|
533 | 567 | MIIkizA9BgkqhkiG9w0BBQ0wMDAbBgkqhkiG9w0BBQwwDgQI63upT8JPNNcCAggA
|
|
0 commit comments