@@ -69,15 +69,15 @@ int whTest_CertServerCfg(whServerConfig* serverCfg)
6969
7070 /* Add trusted root certificate for chain A */
7171 WH_DEBUG_PRINT ("Adding trusted root certificate for chain A...\n" );
72- WH_TEST_RETURN_ON_FAIL (
73- wh_Server_CertAddTrusted ( server , rootCertA , ROOT_A_CERT ,
74- ROOT_A_CERT_len , WH_NVM_FLAGS_IMMUTABLE ));
72+ WH_TEST_RETURN_ON_FAIL (wh_Server_CertAddTrusted (
73+ server , rootCertA , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL , 0 ,
74+ ROOT_A_CERT , ROOT_A_CERT_len ));
7575
7676 /* Add trusted root certificate for chain B */
7777 WH_DEBUG_PRINT ("Adding trusted root certificate for chain B...\n" );
78- WH_TEST_RETURN_ON_FAIL (
79- wh_Server_CertAddTrusted ( server , rootCertB , ROOT_B_CERT ,
80- ROOT_B_CERT_len , WH_NVM_FLAGS_IMMUTABLE ));
78+ WH_TEST_RETURN_ON_FAIL (wh_Server_CertAddTrusted (
79+ server , rootCertB , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL , 0 ,
80+ ROOT_B_CERT , ROOT_B_CERT_len ));
8181
8282 /* Verify valid single cert (intermediate) */
8383 WH_DEBUG_PRINT (
@@ -159,14 +159,14 @@ int whTest_CertClient(whClientContext* client)
159159 /* Add root certificates to NVM */
160160 WH_DEBUG_PRINT ("Adding root certificate A to NVM...\n" );
161161 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrusted (
162- client , rootCertA_id , ROOT_A_CERT , ROOT_A_CERT_len ,
163- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
162+ client , rootCertA_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
163+ 0 , ROOT_A_CERT , ROOT_A_CERT_len , & out_rc ));
164164 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
165165
166166 WH_DEBUG_PRINT ("Adding root certificate B to NVM...\n" );
167167 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrusted (
168- client , rootCertB_id , ROOT_B_CERT , ROOT_B_CERT_len ,
169- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
168+ client , rootCertB_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
169+ 0 , ROOT_B_CERT , ROOT_B_CERT_len , & out_rc ));
170170 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
171171
172172 /* Verify valid single cert (intermediate) */
@@ -277,14 +277,14 @@ int whTest_CertClientAcert(whClientContext* client)
277277 /* Add trusted certificate to NVM */
278278 WH_DEBUG_PRINT ("Adding trusted certificate to NVM...\n" );
279279 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrusted (
280- client , trustedCertId , caCert_der , caCert_der_len ,
281- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
280+ client , trustedCertId , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
281+ 0 , caCert_der , caCert_der_len , & out_rc ));
282282 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
283283
284284 WH_DEBUG_PRINT ("Adding root certificate B to NVM...\n" );
285285 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrusted (
286- client , rootCertB_id , ROOT_B_CERT , ROOT_B_CERT_len ,
287- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
286+ client , rootCertB_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
287+ 0 , ROOT_B_CERT , ROOT_B_CERT_len , & out_rc ));
288288 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
289289
290290 /* Verify attribute certificate */
@@ -344,14 +344,14 @@ int whTest_CertClientDma_ClientServerTestInternal(whClientContext* client)
344344 /* Add root certificates to NVM */
345345 WH_DEBUG_PRINT ("Adding root certificate A to NVM...\n" );
346346 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrustedDma (
347- client , rootCertA_id , ROOT_A_CERT , ROOT_A_CERT_len ,
348- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
347+ client , rootCertA_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
348+ 0 , ROOT_A_CERT , ROOT_A_CERT_len , & out_rc ));
349349 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
350350
351351 WH_DEBUG_PRINT ("Adding root certificate B to NVM...\n" );
352352 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrustedDma (
353- client , rootCertB_id , ROOT_B_CERT , ROOT_B_CERT_len ,
354- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
353+ client , rootCertB_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
354+ 0 , ROOT_B_CERT , ROOT_B_CERT_len , & out_rc ));
355355 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
356356
357357 /* Verify valid single cert (intermediate) */
@@ -464,14 +464,14 @@ int whTest_CertClientAcertDma_ClientServerTestInternal(whClientContext* client)
464464 /* Add trusted certificate to NVM */
465465 WH_DEBUG_PRINT ("Adding trusted certificate to NVM...\n" );
466466 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrustedDma (
467- client , trustedCertId , caCert_der , caCert_der_len ,
468- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
467+ client , trustedCertId , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
468+ 0 , caCert_der , caCert_der_len , & out_rc ));
469469 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
470470
471471 WH_DEBUG_PRINT ("Adding root certificate B to NVM...\n" );
472472 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrustedDma (
473- client , rootCertB_id , ROOT_B_CERT , ROOT_B_CERT_len ,
474- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
473+ client , rootCertB_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE , NULL ,
474+ 0 , ROOT_B_CERT , ROOT_B_CERT_len , & out_rc ));
475475 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
476476
477477 /* Verify attribute certificate */
@@ -521,15 +521,16 @@ static int whTest_CertNonExportable(whClientContext* client)
521521 /* Add exportable certificate */
522522 WH_DEBUG_PRINT ("Adding exportable certificate...\n" );
523523 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrusted (
524- client , exportable_cert_id , ROOT_A_CERT , ROOT_A_CERT_len ,
525- WH_NVM_FLAGS_IMMUTABLE , & out_rc ));
524+ client , exportable_cert_id , WH_NVM_ACCESS_ANY , WH_NVM_FLAGS_IMMUTABLE ,
525+ NULL , 0 , ROOT_A_CERT , ROOT_A_CERT_len , & out_rc ));
526526 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
527527
528528 /* Add non-exportable certificate */
529529 WH_DEBUG_PRINT ("Adding non-exportable certificate...\n" );
530530 WH_TEST_RETURN_ON_FAIL (wh_Client_CertAddTrusted (
531- client , nonexportable_cert_id , ROOT_B_CERT , ROOT_B_CERT_len ,
532- WH_NVM_FLAGS_IMMUTABLE | WH_NVM_FLAGS_NONEXPORTABLE , & out_rc ));
531+ client , nonexportable_cert_id , WH_NVM_ACCESS_ANY ,
532+ WH_NVM_FLAGS_IMMUTABLE | WH_NVM_FLAGS_NONEXPORTABLE , NULL , 0 ,
533+ ROOT_B_CERT , ROOT_B_CERT_len , & out_rc ));
533534 WH_TEST_ASSERT_RETURN (out_rc == WH_ERROR_OK );
534535
535536 /* Test reading exportable certificate - should succeed */
0 commit comments