Skip to content

Commit 806a491

Browse files
committed
correct rebase
1 parent 6e5cac2 commit 806a491

1 file changed

Lines changed: 1 addition & 48 deletions

File tree

examples/posix/wh_posix_server/wh_posix_server_cfg.c

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -515,52 +515,5 @@ int wh_PosixServer_ExampleNvmConfig(void* conf, const char* nvmInitFilePath)
515515
printf("NVM initialization completed successfully\n");
516516
}
517517

518-
/* Initialize crypto library and hardware */
519-
wolfCrypt_Init();
520-
521-
/* Context 3: Server Software Crypto */
522-
WC_RNG rng[1];
523-
uint8_t buffer[128] = {0};
524-
wc_InitRng_ex(rng, NULL, INVALID_DEVID);
525-
wc_RNG_GenerateBlock(rng, buffer, sizeof(buffer));
526-
wc_FreeRng(rng);
527-
wh_Utils_Hexdump("Context 3: Server SW RNG:\n", buffer, sizeof(buffer));
528-
529-
/* Context 4: Server Hardware Crypto */
530-
#define HW_DEV_ID 100
531-
memset(buffer, 0, sizeof(buffer));
532-
wc_CryptoCb_RegisterDevice(HW_DEV_ID, _hardwareCryptoCb, NULL);
533-
wc_InitRng_ex(rng, NULL, HW_DEV_ID);
534-
wc_RNG_GenerateBlock(rng, buffer, sizeof(buffer));
535-
wc_FreeRng(rng);
536-
wh_Utils_Hexdump("Context 4: Server HW RNG:\n", buffer, sizeof(buffer));
537-
538-
/* Context 5: Set default server crypto to use cryptocb */
539-
crypto->devId = HW_DEV_ID;
540-
printf("Context 5: Setting up default server crypto with devId=%d\n",
541-
crypto->devId);
542-
543-
rc = wc_InitRng_ex(crypto->rng, NULL, crypto->devId);
544-
if (rc != 0) {
545-
printf("Failed to wc_InitRng_ex: %d\n", rc);
546-
return rc;
547-
}
548-
549-
rc = wh_ServerTask(s_conf, keyFilePath, keyId, clientId);
550-
if (rc != 0) {
551-
printf("Failed to wh_ServerTask: %d\n", rc);
552-
return rc;
553-
}
554-
rc = wc_FreeRng(crypto->rng);
555-
if (rc != 0) {
556-
printf("Failed to wc_FreeRng: %d\n", rc);
557-
return rc;
558-
}
559-
rc = wolfCrypt_Cleanup();
560-
if (rc != 0) {
561-
printf("Failed to wolfCrypt_Cleanup: %d\n", rc);
562-
return rc;
563-
}
564-
565-
return rc;
518+
return WH_ERROR_OK;
566519
}

0 commit comments

Comments
 (0)