Changeset 59675 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Feb 15, 2016 10:39:32 AM (9 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/Makefile.kmk
r59665 r59675 271 271 Pem_sha384=$(PATH_SUB_CURRENT)/tstRTCrX509-sha384.pem \ 272 272 Pem_sha512=$(PATH_SUB_CURRENT)/tstRTCrX509-sha512.pem \ 273 Pem_cert1=$(PATH_SUB_CURRENT)/tstRTCrX509-cert1.pem \ 273 274 \ 274 CertDer_md4=$(PATH_SUB_CURRENT)/tstRTCrX509-md4-cert.der \ 275 CertDer_md5=$(PATH_SUB_CURRENT)/tstRTCrX509-md5-cert.der \ 276 CertDer_sha1=$(PATH_SUB_CURRENT)/tstRTCrX509-sha1-cert.der \ 277 CertDer_sha224=$(PATH_SUB_CURRENT)/tstRTCrX509-sha224-cert.der \ 278 CertDer_sha256=$(PATH_SUB_CURRENT)/tstRTCrX509-sha256-cert.der \ 279 CertDer_sha384=$(PATH_SUB_CURRENT)/tstRTCrX509-sha384-cert.der \ 280 CertDer_sha512=$(PATH_SUB_CURRENT)/tstRTCrX509-sha512-cert.der \ 275 Der_md4=$(PATH_SUB_CURRENT)/tstRTCrX509-md4-cert.der \ 276 Der_md5=$(PATH_SUB_CURRENT)/tstRTCrX509-md5-cert.der \ 277 Der_sha1=$(PATH_SUB_CURRENT)/tstRTCrX509-sha1-cert.der \ 278 Der_sha224=$(PATH_SUB_CURRENT)/tstRTCrX509-sha224-cert.der \ 279 Der_sha256=$(PATH_SUB_CURRENT)/tstRTCrX509-sha256-cert.der \ 280 Der_sha384=$(PATH_SUB_CURRENT)/tstRTCrX509-sha384-cert.der \ 281 Der_sha512=$(PATH_SUB_CURRENT)/tstRTCrX509-sha512-cert.der \ 282 Der_cert1=$(PATH_SUB_CURRENT)/tstRTCrX509-cert1.der \ 281 283 $(NO_SUCH_VARIABLE) 282 284 $$(tstRTCrX509-1_0_OUTDIR)/tstRTCrX509-1.h: \ -
trunk/src/VBox/Runtime/testcase/tstRTCrX509-1.cpp
r59668 r59675 48 48 const char *pszFile; 49 49 bool fMaybeNotInOpenSSL; 50 bool fSelfSigned; 50 51 51 52 char const *pchPem; … … 56 57 } g_aFiles[] = 57 58 { 58 #define MY_CERT_ENTRY(a_fMaybeNotInOpenSSL, a_ Name) \59 { #a_Name, a_fMaybeNotInOpenSSL, \59 #define MY_CERT_ENTRY(a_fMaybeNotInOpenSSL, a_fSelfSigned, a_Name) \ 60 { #a_Name, a_fMaybeNotInOpenSSL, a_fSelfSigned, \ 60 61 (const char *)RT_CONCAT(g_abPem_, a_Name), RT_CONCAT(g_cbPem_, a_Name), \ 61 RT_CONCAT(g_abCertDer_, a_Name), RT_CONCAT(g_cbCertDer_, a_Name) } 62 MY_CERT_ENTRY(true, md4), 63 MY_CERT_ENTRY(false, md5), 64 MY_CERT_ENTRY(false, sha1), 65 /// @todo fix this: MY_CERT_ENTRY(false, sha224), 66 MY_CERT_ENTRY(false, sha256), 67 MY_CERT_ENTRY(false, sha384), 68 MY_CERT_ENTRY(false, sha512), 62 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 /// @todo fix this: 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), 69 71 }; 70 72 … … 140 142 141 143 /* 142 * Check that our self signed check works , since all of them are self signed.144 * Check that our self signed check works. 143 145 */ 144 RTTESTI_CHECK(RTCrX509Certificate_IsSelfSigned(&Cert0) );145 RTTESTI_CHECK(RTCrX509Certificate_IsSelfSigned(&Cert1) );146 RTTESTI_CHECK(RTCrX509Certificate_IsSelfSigned(&Cert2) );146 RTTESTI_CHECK(RTCrX509Certificate_IsSelfSigned(&Cert0) == g_aFiles[i].fSelfSigned); 147 RTTESTI_CHECK(RTCrX509Certificate_IsSelfSigned(&Cert1) == g_aFiles[i].fSelfSigned); 148 RTTESTI_CHECK(RTCrX509Certificate_IsSelfSigned(&Cert2) == g_aFiles[i].fSelfSigned); 147 149 148 /* 149 * Verify the certificate signature (self signed). 150 */ 151 for (j = 0; j < RT_ELEMENTS(paCerts); j++) 150 if (g_aFiles[i].fSelfSigned) 152 151 { 153 rc = RTCrX509Certificate_VerifySignatureSelfSigned(paCerts[j], NULL /*pErrInfo*/); 154 if ( RT_FAILURE(rc) 155 && ( rc != VERR_CR_PKIX_OSSL_CIPHER_ALGO_NOT_KNOWN_EVP 156 || !g_aFiles[i].fMaybeNotInOpenSSL) ) 157 RTTestIFailed("RTCrX509Certificate_VerifySignatureSelfSigned failed for %s (#%u), variation %u: %Rrc", 158 g_aFiles[i].pszFile, i, j, rc); 152 /* 153 * Verify the certificate signature (self signed). 154 */ 155 for (j = 0; j < RT_ELEMENTS(paCerts); j++) 156 { 157 rc = RTCrX509Certificate_VerifySignatureSelfSigned(paCerts[j], NULL /*pErrInfo*/); 158 if ( RT_FAILURE(rc) 159 && ( rc != VERR_CR_PKIX_OSSL_CIPHER_ALGO_NOT_KNOWN_EVP 160 || !g_aFiles[i].fMaybeNotInOpenSSL) ) 161 RTTestIFailed("RTCrX509Certificate_VerifySignatureSelfSigned failed for %s (#%u), variation %u: %Rrc", 162 g_aFiles[i].pszFile, i, j, rc); 163 } 159 164 } 160 161 165 } 162 166
Note:
See TracChangeset
for help on using the changeset viewer.