experiemnt
This commit is contained in:
parent
e219b86907
commit
6c32d16c72
@ -59,22 +59,25 @@ void main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
mbedtls_sha256_context * sha_ctx;
|
mbedtls_sha256_context sha_ctx;
|
||||||
mbedtls_sha256_init(sha_ctx);
|
mbedtls_sha256_init(&sha_ctx);
|
||||||
|
|
||||||
|
|
||||||
mbedtls_sha256_starts_ret(sha_ctx,0);
|
mbedtls_sha256_starts_ret(&sha_ctx,0);
|
||||||
mbedtls_sha256_update_ret(sha_ctx, UDS_ID, 32);
|
mbedtls_sha256_update_ret(&sha_ctx, UDS_ID, 32);
|
||||||
mbedtls_sha256_update_ret(sha_ctx, FW_ID, 32);
|
mbedtls_sha256_update_ret(&sha_ctx, FW_ID, 32);
|
||||||
mbedtls_sha256_finish_ret(sha_ctx,CD_ID);
|
mbedtls_sha256_finish_ret(&sha_ctx,CD_ID);
|
||||||
|
|
||||||
mbedtls_sha256_free(sha_ctx);
|
mbedtls_sha256_free(&sha_ctx);
|
||||||
|
free(UDS_ID);
|
||||||
|
free(FW_ID);
|
||||||
|
|
||||||
for(int i = 0; i < 32; i++)
|
for(int i = 0; i < 32; i++)
|
||||||
printf("%hhx",CD_ID[i]);
|
printf("%hhx",CD_ID[i]);
|
||||||
printf(" : CDI digest\n");
|
printf(" : CDI digest\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf("SUCCESSUL EXIT\n");
|
printf("SUCCESSUL EXIT\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -136,6 +136,7 @@ int _calcCDID(uint8_t * CDID)
|
|||||||
|
|
||||||
free(UDS_ID);
|
free(UDS_ID);
|
||||||
free(FW_ID);
|
free(FW_ID);
|
||||||
|
mbedtls_sha256_free(sha_ctx);
|
||||||
return RIOTSUCCESS;
|
return RIOTSUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user