Changeset 73705 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Aug 16, 2018 9:31:18 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 124384
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTCrX509-1.cpp
r73688 r73705 49 49 bool fMaybeNotInOpenSSL; 50 50 bool fSelfSigned; 51 int rcSuccessDigestQuality; 51 52 52 53 char const *pchPem; … … 57 58 } g_aFiles[] = 58 59 { 59 #define MY_CERT_ENTRY(a_fMaybeNotInOpenSSL, a_fSelfSigned, a_ Name) \60 { #a_Name, a_fMaybeNotInOpenSSL, a_fSelfSigned, \60 #define MY_CERT_ENTRY(a_fMaybeNotInOpenSSL, a_fSelfSigned, a_rcSuccessDigestQuality, a_Name) \ 61 { #a_Name, a_fMaybeNotInOpenSSL, a_fSelfSigned, a_rcSuccessDigestQuality, \ 61 62 (const char *)RT_CONCAT(g_abPem_, a_Name), RT_CONCAT(g_cbPem_, a_Name), \ 62 63 RT_CONCAT(g_abDer_, a_Name), RT_CONCAT(g_cbDer_, a_Name) } 63 MY_CERT_ENTRY(true, true, md4),64 MY_CERT_ENTRY(false, true, md5),65 MY_CERT_ENTRY(false, true, sha1),66 MY_CERT_ENTRY(false, true, sha224),67 MY_CERT_ENTRY(false, true, sha256),68 MY_CERT_ENTRY(false, true, sha384),69 MY_CERT_ENTRY(false, true, sha512),70 MY_CERT_ENTRY(false, false, cert1),64 MY_CERT_ENTRY(true, true, VINF_CR_DIGEST_SEVERELY_COMPROMISED, md4), 65 MY_CERT_ENTRY(false, true, VINF_CR_DIGEST_COMPROMISED, md5), 66 MY_CERT_ENTRY(false, true, VINF_CR_DIGEST_DEPRECATED, sha1), 67 MY_CERT_ENTRY(false, true, VINF_SUCCESS, sha224), 68 MY_CERT_ENTRY(false, true, VINF_SUCCESS, sha256), 69 MY_CERT_ENTRY(false, true, VINF_SUCCESS, sha384), 70 MY_CERT_ENTRY(false, true, VINF_SUCCESS, sha512), 71 MY_CERT_ENTRY(false, false, -1, cert1), 71 72 }; 72 73 … … 156 157 { 157 158 rc = RTCrX509Certificate_VerifySignatureSelfSigned(paCerts[j], NULL /*pErrInfo*/); 158 if ( RT_FAILURE(rc) 159 && ( ( rc != VERR_CR_PKIX_OSSL_CIPHER_ALGO_NOT_KNOWN_EVP 160 && rc != VERR_NOT_FOUND) 161 || !g_aFiles[i].fMaybeNotInOpenSSL) ) 159 if (RT_FAILURE(rc)) 162 160 RTTestIFailed("RTCrX509Certificate_VerifySignatureSelfSigned failed for %s (#%u), variation %u: %Rrc", 163 161 g_aFiles[i].pszFile, i, j, rc); 162 else if ( rc != g_aFiles[i].rcSuccessDigestQuality 163 && g_aFiles[i].rcSuccessDigestQuality != -1) 164 RTTestIFailed("RTCrX509Certificate_VerifySignatureSelfSigned returned %Rrc rather than %Rrc for %s (#%u), variation %u", 165 rc, g_aFiles[i].rcSuccessDigestQuality, g_aFiles[i].pszFile, i, j); 164 166 } 165 167 } -
trunk/src/VBox/Runtime/testcase/tstRTDigest-2.cpp
r69111 r73705 31 31 #include <iprt/crypto/digest.h> 32 32 #include <iprt/md2.h> 33 #include <iprt/md4.h> 33 34 #include <iprt/md5.h> 34 35 #include <iprt/sha.h> … … 78 79 * @param iTest The test number (for reporting). 79 80 * @param pTest The test. 81 * @param rcSuccessDigest The digest success informational status code. 80 82 */ 81 static bool testGenericCheckResult(RTCRDIGEST hDigest, uint32_t iTest, TESTRTDIGEST const *pTest )83 static bool testGenericCheckResult(RTCRDIGEST hDigest, uint32_t iTest, TESTRTDIGEST const *pTest, int rcSuccessDigest) 82 84 { 83 RTTESTI_CHECK_RC_RET(RTCrDigestFinal(hDigest, NULL, 0), VINF_SUCCESS, false);85 RTTESTI_CHECK_RC_RET(RTCrDigestFinal(hDigest, NULL, 0), rcSuccessDigest, false); 84 86 85 87 char szDigest[_4K * 2]; … … 106 108 * @param pszDigestName The name of the digest. 107 109 * @param enmDigestType The digest enum type value. 110 * @param rcSuccessDigest The digest success informational status code. 108 111 */ 109 112 static void testGeneric(const char *pszDigestObjId, TESTRTDIGEST const *paTests, size_t cTests, const char *pszDigestName, 110 RTDIGESTTYPE enmDigestType )113 RTDIGESTTYPE enmDigestType, int rcSuccessDigest) 111 114 { 112 115 /* … … 119 122 * The whole thing in one go. 120 123 */ 121 RTTESTI_CHECK_RC_RETV(RTCrDigestCreateByObjIdString(&hDigest, pszDigestObjId), VINF_SUCCESS);124 RTTESTI_CHECK_RC_RETV(RTCrDigestCreateByObjIdString(&hDigest, pszDigestObjId), rcSuccessDigest); 122 125 uint32_t const cbHash = RTCrDigestGetHashSize(hDigest); 123 126 RTTESTI_CHECK_RETV(cbHash > 0); 124 127 RTTESTI_CHECK_RETV(cbHash < _1K); 125 128 RTTESTI_CHECK_RC_RETV(RTCrDigestUpdate(hDigest, paTests[iTest].pvInput, paTests[iTest].cbInput), VINF_SUCCESS); 126 if (!testGenericCheckResult(hDigest, iTest, &paTests[iTest] ))129 if (!testGenericCheckResult(hDigest, iTest, &paTests[iTest], rcSuccessDigest)) 127 130 continue; /* skip the remaining tests if this failed. */ 128 131 … … 147 150 } 148 151 149 if (!testGenericCheckResult(hDigest, iTest, &paTests[iTest] ))152 if (!testGenericCheckResult(hDigest, iTest, &paTests[iTest], rcSuccessDigest)) 150 153 break; /* No need to test the other permutations if this fails. */ 151 154 } … … 157 160 * Do a quick benchmark. 158 161 */ 159 RTTESTI_CHECK_RC_RETV(RTCrDigestCreateByObjIdString(&hDigest, pszDigestObjId), VINF_SUCCESS);162 RTTESTI_CHECK_RC_RETV(RTCrDigestCreateByObjIdString(&hDigest, pszDigestObjId), rcSuccessDigest); 160 163 161 164 /* Warmup. */ … … 384 387 { &g_abRandom72KB[0x20c9], 9991, "bbba194efa81238e5b613e20e937144e", "MD2 8393 bytes @9991" }, 385 388 }; 386 testGeneric("1.2.840.113549.2.2", s_abTests, RT_ELEMENTS(s_abTests), "MD2", RTDIGESTTYPE_MD2); 389 testGeneric("1.2.840.113549.2.2", s_abTests, RT_ELEMENTS(s_abTests), "MD2", RTDIGESTTYPE_MD2, VINF_CR_DIGEST_DEPRECATED); 390 } 391 392 393 /** 394 * Tests MD4. 395 */ 396 static void testMd4(void) 397 { 398 RTTestISub("MD4"); 399 400 /* 401 * Some quick direct API tests. 402 */ 403 uint8_t abHash[RTMD4_HASH_SIZE]; 404 char szDigest[RTMD4_DIGEST_LEN + 1]; 405 const char *pszString; 406 407 pszString = ""; 408 RTMd4(pszString, strlen(pszString), abHash); 409 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 410 CHECK_STRING(szDigest, "31d6cfe0d16ae931b73c59d7e0c089c0"); 411 412 pszString = "The quick brown fox jumps over the lazy dog"; 413 RTMd4(pszString, strlen(pszString), abHash); 414 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 415 CHECK_STRING(szDigest, "1bee69a46ba811185c194762abaeae90"); 416 417 pszString = "a"; 418 RTMd4(pszString, strlen(pszString), abHash); 419 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 420 CHECK_STRING(szDigest, "bde52cb31de33e46245e05fbdbd6fb24"); 421 422 pszString = "abc"; 423 RTMd4(pszString, strlen(pszString), abHash); 424 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 425 CHECK_STRING(szDigest, "a448017aaf21d8525fc10ae87aa6729d"); 426 427 pszString = "message digest"; 428 RTMd4(pszString, strlen(pszString), abHash); 429 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 430 CHECK_STRING(szDigest, "d9130a8164549fe818874806e1c7014b"); 431 432 pszString = "abcdefghijklmnopqrstuvwxyz"; 433 RTMd4(pszString, strlen(pszString), abHash); 434 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 435 CHECK_STRING(szDigest, "d79e1c308aa5bbcdeea8ed63df412da9"); 436 437 pszString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 438 RTMd4(pszString, strlen(pszString), abHash); 439 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 440 CHECK_STRING(szDigest, "043f8582f241db351ce627e153e7f0e4"); 441 442 pszString = "12345678901234567890123456789012345678901234567890123456789012345678901234567890"; 443 RTMd4(pszString, strlen(pszString), abHash); 444 RTTESTI_CHECK_RC_RETV(RTMd4ToString(abHash, szDigest, sizeof(szDigest)), VINF_SUCCESS); 445 CHECK_STRING(szDigest, "e33b4ddc9c38f2199c3e7b164fcc0536"); 446 447 448 /* 449 * Generic API tests. 450 */ 451 static TESTRTDIGEST const s_abTests[] = 452 { 453 { &g_abRandom72KB[0], 0, "31d6cfe0d16ae931b73c59d7e0c089c0", "MD4 0 bytes" }, 454 { &g_abRandom72KB[0], 1, "0014d6b190d365d071ea01701055f180", "MD4 1 byte" }, 455 { &g_abRandom72KB[0], 2, "2be9806c2efb7648dc5c3ec5a502cf10", "MD4 2 bytes" }, 456 { &g_abRandom72KB[0], 3, "4d5268b74418be41d0f2ed6806048897", "MD4 3 bytes" }, 457 { &g_abRandom72KB[0], 4, "62f2e58f059dea40a92eba280f3062b4", "MD4 4 bytes" }, 458 { &g_abRandom72KB[0], 5, "b3f93386d95f56dd3e95b9bd03c6e944", "MD4 5 bytes" }, 459 { &g_abRandom72KB[0], 6, "21faedc10d9ec3943d047518b6fd5238", "MD4 6 bytes" }, 460 { &g_abRandom72KB[0], 7, "fba0c1028ffb0714cc44a9572713a900", "MD4 7 bytes" }, 461 { &g_abRandom72KB[0], 8, "1ba88ad5bc00076e753213a2e5b8ae15", "MD4 8 bytes" }, 462 { &g_abRandom72KB[0], 9, "e86ba9ff9cdd821dedc54fc7e752dda4", "MD4 9 bytes" }, 463 { &g_abRandom72KB[0], 10, "4ca3d69542505eaebd6a55dccb1d7413", "MD4 10 bytes" }, 464 { &g_abRandom72KB[0], 11, "3efc80988668aa176ec0cee9edd8122f", "MD4 11 bytes" }, 465 { &g_abRandom72KB[0], 12, "084cd1ce1d35e8e1908c9700f372790a", "MD4 12 bytes" }, 466 { &g_abRandom72KB[0], 13, "91114dc2de94a27707045f261ce616e0", "MD4 13 bytes" }, 467 { &g_abRandom72KB[0], 14, "637000da1e66c73d400baa653470bdb1", "MD4 14 bytes" }, 468 { &g_abRandom72KB[0], 15, "02af37485efd590a086dac3f30389592", "MD4 15 bytes" }, 469 { &g_abRandom72KB[0], 16, "2a6f6d15a99fc5a467f60bb78733780e", "MD4 16 bytes" }, 470 { &g_abRandom72KB[0], 17, "866b211da26762208316b930dacdeaaa", "MD4 17 bytes" }, 471 { &g_abRandom72KB[0], 18, "15ebc4114d9e5ca0cdff23f84531a64d", "MD4 18 bytes" }, 472 { &g_abRandom72KB[0], 19, "56927e67e2f6a99c8327c6ff14404d61", "MD4 19 bytes" }, 473 { &g_abRandom72KB[0], 20, "70fc8943ee6233e1f7a349a6dc68d0f6", "MD4 20 bytes" }, 474 { &g_abRandom72KB[0], 21, "4927cf2f4ec8ede18328abc0507cb1aa", "MD4 21 bytes" }, 475 { &g_abRandom72KB[0], 22, "dccda1a1c95d36c4ab6f593c3ab81b9e", "MD4 22 bytes" }, 476 { &g_abRandom72KB[0], 23, "9a45e0e9bfee3f362592ccc8aea9207c", "MD4 23 bytes" }, 477 { &g_abRandom72KB[0], 24, "0f4dee14ef3ec085ee80810066095600", "MD4 24 bytes" }, 478 { &g_abRandom72KB[0], 25, "986534cc3fd5c50a8be5c66b170bd67b", "MD4 25 bytes" }, 479 { &g_abRandom72KB[0], 26, "fb84beb50239e80d38631571fc02bd37", "MD4 26 bytes" }, 480 { &g_abRandom72KB[0], 27, "416675187789def281c48d402d3db6d8", "MD4 27 bytes" }, 481 { &g_abRandom72KB[0], 28, "a7e5379e670b33f3d9e3499955561cd8", "MD4 28 bytes" }, 482 { &g_abRandom72KB[0], 29, "5b3b41e2c4d91056c58280468952d755", "MD4 29 bytes" }, 483 { &g_abRandom72KB[0], 30, "8f0389eb6c9a5574341ec707b7496fdb", "MD4 30 bytes" }, 484 { &g_abRandom72KB[0], 31, "8fb16cc1fd5ea43d6ae52b852dbecf3f", "MD4 31 bytes" }, 485 { &g_abRandom72KB[0], 32, "c5ce62339fa63c3eb8386ee024e157ec", "MD4 32 bytes" }, 486 { &g_abRandom72KB[0], 33, "fc03d11586207fa12b505354f6ed8fa0", "MD4 33 bytes" }, 487 { &g_abRandom72KB[0], 34, "41923f367cd620969f1ee087295d0a40", "MD4 34 bytes" }, 488 { &g_abRandom72KB[0], 35, "07dbc9ad8d993e0c7a8febd2c506b87b", "MD4 35 bytes" }, 489 { &g_abRandom72KB[0], 36, "19d8e4f515748b03ad6b000ccce51101", "MD4 36 bytes" }, 490 { &g_abRandom72KB[0], 37, "54d2c85331ca4e7236629620268527c4", "MD4 37 bytes" }, 491 { &g_abRandom72KB[0], 38, "352148c6cc975c6b67704c52be5e280a", "MD4 38 bytes" }, 492 { &g_abRandom72KB[0], 39, "31c52890373437a2041a759fdd782ee2", "MD4 39 bytes" }, 493 { &g_abRandom72KB[0], 40, "1aebb166f3576845dc79b442885ea46c", "MD4 40 bytes" }, 494 { &g_abRandom72KB[0], 41, "0ca6c4388a7faa9304681261bc155676", "MD4 41 bytes" }, 495 { &g_abRandom72KB[0], 42, "69cd5768697348aceac47c2c119efb60", "MD4 42 bytes" }, 496 { &g_abRandom72KB[0], 43, "0912c29c5fd6daa187f4c22426854792", "MD4 43 bytes" }, 497 { &g_abRandom72KB[0], 44, "a7db92786a2703ff4b06cd3be31dabb7", "MD4 44 bytes" }, 498 { &g_abRandom72KB[0], 45, "d6584bb2131258613f779e26e72c6d72", "MD4 45 bytes" }, 499 { &g_abRandom72KB[0], 46, "19c49d89942e737d592618e45c413480", "MD4 46 bytes" }, 500 { &g_abRandom72KB[0], 47, "25034803d9d5b5add9969416147b9db4", "MD4 47 bytes" }, 501 { &g_abRandom72KB[0], 48, "ce20d232be7507c888591db5b3803086", "MD4 48 bytes" }, 502 { &g_abRandom72KB[0], 49, "fba1b3a38e353f06cac6a85d90f17733", "MD4 49 bytes" }, 503 { &g_abRandom72KB[0], 50, "9b72cd65b42e377c3d3660b07474c617", "MD4 50 bytes" }, 504 { &g_abRandom72KB[0], 51, "9c7177c712c4124cf1e7fe153fa2dbcb", "MD4 51 bytes" }, 505 { &g_abRandom72KB[0], 52, "6f3428a83cba0c3ee050ad43441c80ac", "MD4 52 bytes" }, 506 { &g_abRandom72KB[0], 53, "e4fff75da9a2797949101eeccd71cda9", "MD4 53 bytes" }, 507 { &g_abRandom72KB[0], 54, "840d32fc7b779ceb6b8d1b0b2cd0c9fc", "MD4 54 bytes" }, 508 { &g_abRandom72KB[0], 55, "0742c60033fe94ade3a0b1627e2daca1", "MD4 55 bytes" }, 509 { &g_abRandom72KB[0], 56, "6e258014688e63ad1a20ebe81d285141", "MD4 56 bytes" }, 510 { &g_abRandom72KB[0], 57, "f8c6d8879fcc3f99b10c680ca7b96566", "MD4 57 bytes" }, 511 { &g_abRandom72KB[0], 58, "5b0882e886b454247403184daaa5088f", "MD4 58 bytes" }, 512 { &g_abRandom72KB[0], 59, "0a2944704b29793e9b8e86950bc06eb7", "MD4 59 bytes" }, 513 { &g_abRandom72KB[0], 60, "84e03ff08c2fd101b157bb6799339dd8", "MD4 60 bytes" }, 514 { &g_abRandom72KB[0], 61, "66fc3200bd43dc88fbdf2ecfc86210c0", "MD4 61 bytes" }, 515 { &g_abRandom72KB[0], 62, "19ea83da725826d1fa4a2816eca5363d", "MD4 62 bytes" }, 516 { &g_abRandom72KB[0], 63, "a274d6f859c5e2a3aa055e2f25a5f695", "MD4 63 bytes" }, 517 { &g_abRandom72KB[0], 64, "dcd51f9400a8864157ef380eebbef60d", "MD4 64 bytes" }, 518 { &g_abRandom72KB[0], 65, "f8fe3a0be1c9ec0ee1a9f1a8bfe7701c", "MD4 65 bytes" }, 519 { &g_abRandom72KB[0], 66, "e20f96625019092cc70d706bbd113aec", "MD4 66 bytes" }, 520 { &g_abRandom72KB[0], 67, "16dd4f76d2d1845bfb9804516ce1a509", "MD4 67 bytes" }, 521 { &g_abRandom72KB[0], 68, "cc30a7b83a4a54e592435e1185ea4812", "MD4 68 bytes" }, 522 { &g_abRandom72KB[0], 69, "a64b84a86b0bf5b93604e2151d1dab05", "MD4 69 bytes" }, 523 { &g_abRandom72KB[0], 70, "523fb6da8d86b6d21d59e79150ec9749", "MD4 70 bytes" }, 524 { &g_abRandom72KB[0], 71, "ba92cad24dae5ff8b09e078c7b80df1d", "MD4 71 bytes" }, 525 { &g_abRandom72KB[0], 72, "510636391607ac06f1701b6420d90bf6", "MD4 72 bytes" }, 526 { &g_abRandom72KB[0], 73, "642f99a448cfebcb6502a3d51d84561e", "MD4 73 bytes" }, 527 { &g_abRandom72KB[0], 74, "0594cbfff1dcd956168f9780b4bf5fd7", "MD4 74 bytes" }, 528 { &g_abRandom72KB[0], 75, "bcd149fa1824199ce20723c455c6a799", "MD4 75 bytes" }, 529 { &g_abRandom72KB[0], 76, "2b31bf720e1adff2f9b3229ad680eea0", "MD4 76 bytes" }, 530 { &g_abRandom72KB[0], 77, "8498a6b10c06fd14f88fa4fbd957c1ec", "MD4 77 bytes" }, 531 { &g_abRandom72KB[0], 78, "03366c519d243d914e13024803ac6fdb", "MD4 78 bytes" }, 532 { &g_abRandom72KB[0], 79, "4795ab150f194b2e8e5c0f40f26f09eb", "MD4 79 bytes" }, 533 { &g_abRandom72KB[0], 80, "ca2b9808e7083ff0be1c0b5567861123", "MD4 80 bytes" }, 534 { &g_abRandom72KB[0], 81, "002a0aa238fc962ab76313413111fc34", "MD4 81 bytes" }, 535 { &g_abRandom72KB[0], 82, "289fb6a311a5603fe47c65c571ee3938", "MD4 82 bytes" }, 536 { &g_abRandom72KB[0], 83, "cacd59c0bc6fc31849c0f4552e3b253f", "MD4 83 bytes" }, 537 { &g_abRandom72KB[0], 84, "b6ebc1eb2ed472ab95696752aafeab24", "MD4 84 bytes" }, 538 { &g_abRandom72KB[0], 85, "98c289ef93f887fa9eeed86e655f5890", "MD4 85 bytes" }, 539 { &g_abRandom72KB[0], 86, "22c3bf5be2798a9ec04e1c459ff65544", "MD4 86 bytes" }, 540 { &g_abRandom72KB[0], 87, "43cd7e64a8d0b5a2ee4221786876bb0f", "MD4 87 bytes" }, 541 { &g_abRandom72KB[0], 88, "ec95c85bb82c26e17ef7083a6732c1e5", "MD4 88 bytes" }, 542 { &g_abRandom72KB[0], 89, "1b9a6299f80996cd9a01ffd4299d4b2a", "MD4 89 bytes" }, 543 { &g_abRandom72KB[0], 90, "9ad1ec0845c287fa2c3400946f3b74c4", "MD4 90 bytes" }, 544 { &g_abRandom72KB[0], 91, "eff2124cd403f523ddefce349d913d33", "MD4 91 bytes" }, 545 { &g_abRandom72KB[0], 92, "5253b33449b543eadc7de0061c35cdf0", "MD4 92 bytes" }, 546 { &g_abRandom72KB[0], 93, "170f9e4cda211d9e2c48a3636d29120e", "MD4 93 bytes" }, 547 { &g_abRandom72KB[0], 94, "7c738164e285ec838c2736eb1396db34", "MD4 94 bytes" }, 548 { &g_abRandom72KB[0], 95, "cfedfee3e1ac2414d9083a8ffcb1d6c6", "MD4 95 bytes" }, 549 { &g_abRandom72KB[0], 96, "41ff6a9f247ba6ba7cbc16bc19101b0a", "MD4 96 bytes" }, 550 { &g_abRandom72KB[0], 97, "871ba92280eb7a1d838376840bd3eedb", "MD4 97 bytes" }, 551 { &g_abRandom72KB[0], 98, "1663e51bcea3a86fb19ed2753c3234ba", "MD4 98 bytes" }, 552 { &g_abRandom72KB[0], 99, "70d79f6be8da0a5ac1e05f9a3f72385d", "MD4 99 bytes" }, 553 { &g_abRandom72KB[0], 100, "1b2eeec426c1e5d8b2459b9308eec29e", "MD4 100 bytes" }, 554 { &g_abRandom72KB[0], 101, "1d7eac9ef23954d8c2e9115ca8ae43c2", "MD4 101 bytes" }, 555 { &g_abRandom72KB[0], 102, "f1dd48951a67dddecfca3572a6d1e41b", "MD4 102 bytes" }, 556 { &g_abRandom72KB[0], 103, "97c4443adf9896437112a826d3041f08", "MD4 103 bytes" }, 557 { &g_abRandom72KB[0], 104, "8834a131a88b9cf837389cf9cbf00a16", "MD4 104 bytes" }, 558 { &g_abRandom72KB[0], 105, "54c072c5b32150a631d584212be70918", "MD4 105 bytes" }, 559 { &g_abRandom72KB[0], 106, "28312975c6f5eeab493208ae2fd36401", "MD4 106 bytes" }, 560 { &g_abRandom72KB[0], 107, "921f5392f4ebd739647db883067e33a9", "MD4 107 bytes" }, 561 { &g_abRandom72KB[0], 108, "f60480eb631d321f8fba8d6f8b302bd7", "MD4 108 bytes" }, 562 { &g_abRandom72KB[0], 109, "ba9ec7166e3b8764d7110b097b0183a8", "MD4 109 bytes" }, 563 { &g_abRandom72KB[0], 110, "319757aba1d89a4a0e675ab08408956b", "MD4 110 bytes" }, 564 { &g_abRandom72KB[0], 111, "9a85d1eb0fb988c0d83aad8353e7e29e", "MD4 111 bytes" }, 565 { &g_abRandom72KB[0], 112, "fac16e7a4c33a301a0f626c5d291e27e", "MD4 112 bytes" }, 566 { &g_abRandom72KB[0], 113, "654d8ebe888100f4c484d22b68af9185", "MD4 113 bytes" }, 567 { &g_abRandom72KB[0], 114, "766df4a0681e87523146cc2c5084bc5b", "MD4 114 bytes" }, 568 { &g_abRandom72KB[0], 115, "c73d46e4e0039821f29eb595e63a6445", "MD4 115 bytes" }, 569 { &g_abRandom72KB[0], 116, "ed3544002078b116451827c45b8ce782", "MD4 116 bytes" }, 570 { &g_abRandom72KB[0], 117, "0db043d6e4006523679ad807d1b8b25d", "MD4 117 bytes" }, 571 { &g_abRandom72KB[0], 118, "59fd1acab527423854deb0b5cc8aa7fd", "MD4 118 bytes" }, 572 { &g_abRandom72KB[0], 119, "ca5d2aa85a493741e4e6bce6f6d23e1d", "MD4 119 bytes" }, 573 { &g_abRandom72KB[0], 120, "47f646776ef01e3c8e4e38c0beae7333", "MD4 120 bytes" }, 574 { &g_abRandom72KB[0], 121, "1905c60dc8f51c3b7c326b5cad9f6fd2", "MD4 121 bytes" }, 575 { &g_abRandom72KB[0], 122, "ce435994d14df744b26d5dfc80b95398", "MD4 122 bytes" }, 576 { &g_abRandom72KB[0], 123, "e3c102dcf64d29f2c386413c0483c3a6", "MD4 123 bytes" }, 577 { &g_abRandom72KB[0], 124, "aa7ed5d353dc66b7f23639ac5cf18636", "MD4 124 bytes" }, 578 { &g_abRandom72KB[0], 125, "37f30e534f4661a989e9c9367ded7536", "MD4 125 bytes" }, 579 { &g_abRandom72KB[0], 126, "da722a846bcdd3b5b8acf5100b44a9b4", "MD4 126 bytes" }, 580 { &g_abRandom72KB[0], 127, "b93bc385e0c6d2b31213bbec50111359", "MD4 127 bytes" }, 581 { &g_abRandom72KB[0], 128, "762bbb84570d3fb82ea0cd2b468d1ac1", "MD4 128 bytes" }, 582 { &g_abRandom72KB[0], 129, "0f7b751552acc853f88684616d21a737", "MD4 129 bytes" }, 583 { &g_abRandom72KB[0], 1024, "3722350e9c6c7e7ddf39f112cdd6b454", "MD4 1024 bytes" }, 584 { &g_abRandom72KB[0], 73001, "ee4fec16230aff2fd3f9075d781de22d", "MD4 73001 bytes" }, 585 { &g_abRandom72KB[0], 73728, "120c5ba7971af1dcc004c2a54e0afb44", "MD4 73728 bytes" }, 586 { &g_abRandom72KB[0x20c9], 9991, "7d1e0e69dfec5dd0ae84aeecd53516bd", "MD4 8393 bytes @9991" }, 587 }; 588 testGeneric("1.2.840.113549.2.4", s_abTests, RT_ELEMENTS(s_abTests), "MD4", RTDIGESTTYPE_MD4, 589 VINF_CR_DIGEST_SEVERELY_COMPROMISED); 387 590 } 388 591 … … 583 786 { &g_abRandom72KB[0x20c9], 9991, "6461339c6615d23c704298a313e07cf5", "MD5 8393 bytes @9991" }, 584 787 }; 585 testGeneric("1.2.840.113549.2.5", s_abTests, RT_ELEMENTS(s_abTests), "MD5", RTDIGESTTYPE_MD5); 788 testGeneric("1.2.840.113549.2.5", s_abTests, RT_ELEMENTS(s_abTests), "MD5", RTDIGESTTYPE_MD5, 789 VINF_CR_DIGEST_COMPROMISED); 586 790 } 587 791 … … 762 966 { &g_abRandom72KB[0x20c9], 9991, "62001184bacacce3774566d916055d425a85eba5", "SHA-1 8393 bytes @9991" }, 763 967 }; 764 testGeneric("1.3.14.3.2.26", s_abTests, RT_ELEMENTS(s_abTests), "SHA-1", RTDIGESTTYPE_SHA1 );968 testGeneric("1.3.14.3.2.26", s_abTests, RT_ELEMENTS(s_abTests), "SHA-1", RTDIGESTTYPE_SHA1, VINF_CR_DIGEST_DEPRECATED); 765 969 } 766 970 … … 930 1134 { &g_abRandom72KB[0x20c9], 9991, "8bd4c6142e36f15385769ebdeb855dcdf542f72d067315472a52ff626946310e", "SHA-256 8393 bytes @9991" }, 931 1135 }; 932 testGeneric("2.16.840.1.101.3.4.2.1", s_abTests, RT_ELEMENTS(s_abTests), "SHA-256", RTDIGESTTYPE_SHA256 );1136 testGeneric("2.16.840.1.101.3.4.2.1", s_abTests, RT_ELEMENTS(s_abTests), "SHA-256", RTDIGESTTYPE_SHA256, VINF_SUCCESS); 933 1137 } 934 1138 … … 968 1172 "75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525", "SHA-224 abcdbc..." }, 969 1173 }; 970 testGeneric("2.16.840.1.101.3.4.2.4", s_abTests, RT_ELEMENTS(s_abTests), "SHA-224", RTDIGESTTYPE_SHA224 );1174 testGeneric("2.16.840.1.101.3.4.2.4", s_abTests, RT_ELEMENTS(s_abTests), "SHA-224", RTDIGESTTYPE_SHA224, VINF_SUCCESS); 971 1175 } 972 1176 … … 1136 1340 { &g_abRandom72KB[0x20c9], 9991, "d6ac7c68664df2e34dc6be233b33f8dad196348350b70a4c2c5a78eb54d6e297c819771313d798de7552b7a3cb85370aab25087e189f3be8560d49406ebb6280", "SHA-512 8393 bytes @9991" }, 1137 1341 }; 1138 testGeneric("2.16.840.1.101.3.4.2.3", s_abTests, RT_ELEMENTS(s_abTests), "SHA-512", RTDIGESTTYPE_SHA512 );1342 testGeneric("2.16.840.1.101.3.4.2.3", s_abTests, RT_ELEMENTS(s_abTests), "SHA-512", RTDIGESTTYPE_SHA512, VINF_SUCCESS); 1139 1343 } 1140 1344 … … 1174 1378 "23fec5bb94d60b23308192640b0c453335d664734fe40e7268674af9", "SHA-512/256 abcdef..." }, 1175 1379 }; 1176 testGeneric("2.16.840.1.101.3.4.2.5", s_abTests, RT_ELEMENTS(s_abTests), "SHA-512/224", RTDIGESTTYPE_SHA512T224 );1380 testGeneric("2.16.840.1.101.3.4.2.5", s_abTests, RT_ELEMENTS(s_abTests), "SHA-512/224", RTDIGESTTYPE_SHA512T224, VINF_SUCCESS); 1177 1381 } 1178 1382 #endif /* IPRT_WITHOUT_SHA512T224 */ … … 1212 1416 "3928e184fb8690f840da3988121d31be65cb9d3ef83ee6146feac861e19b563a", "SHA-512/256 abcdef..." }, 1213 1417 }; 1214 testGeneric("2.16.840.1.101.3.4.2.6", s_abTests, RT_ELEMENTS(s_abTests), "SHA-512/256", RTDIGESTTYPE_SHA512T256 );1418 testGeneric("2.16.840.1.101.3.4.2.6", s_abTests, RT_ELEMENTS(s_abTests), "SHA-512/256", RTDIGESTTYPE_SHA512T256, VINF_SUCCESS); 1215 1419 } 1216 1420 #endif /* !IPRT_WITHOUT_SHA512T256 */ … … 1249 1453 "09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039", "SHA-384 abcdef..." }, 1250 1454 }; 1251 testGeneric("2.16.840.1.101.3.4.2.2", s_abTests, RT_ELEMENTS(s_abTests), "SHA-384", RTDIGESTTYPE_SHA384 );1455 testGeneric("2.16.840.1.101.3.4.2.2", s_abTests, RT_ELEMENTS(s_abTests), "SHA-384", RTDIGESTTYPE_SHA384, VINF_SUCCESS); 1252 1456 } 1253 1457 … … 1262 1466 1263 1467 testMd2(); 1468 testMd4(); 1264 1469 testMd5(); 1265 1470 testSha1();
Note:
See TracChangeset
for help on using the changeset viewer.