tools:acrn-crashlog: Change the algorithm of generating event key

Acrnprobe is using SHA to generate ids for events. These ids are only used
to index events, not for cryptographic purpose.

This patch unify the generating algorithm of short and long ids to
SHA256.

Tracked-On: #1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This commit is contained in:
Liu, Xinwu
2018-09-11 16:48:47 +08:00
committed by lijinxia
parent b1ba12ae1b
commit 876cc68311
5 changed files with 71 additions and 155 deletions

View File

@@ -192,7 +192,8 @@ void hist_raise_uptime(char *lastuptime)
if (hours / uptime_hours >= loop_uptime_event) {
loop_uptime_event = (hours / uptime_hours) + 1;
key = generate_event_id(uptime->name, "");
key = generate_event_id((const char *)uptime->name,
NULL, KEY_SHORT);
if (key == NULL) {
LOGE("generate event id failed, error (%s)\n",
strerror(errno));
@@ -210,7 +211,7 @@ void hist_raise_infoerror(char *type)
{
char *key;
key = generate_event_id("ERROR", type);
key = generate_event_id("ERROR", (const char *)type, KEY_SHORT);
if (key == NULL) {
LOGE("generate event id failed, error (%s)\n",
strerror(errno));