From d203d6dbff1a7047bb9257110498eaf465426d50 Mon Sep 17 00:00:00 2001 From: "atul.jha" Date: Wed, 13 Jan 2021 12:31:43 +0100 Subject: [PATCH] fixed IDENTITY --- trial4/KeyGen.c | 5 ++--- trial4/ROMprotocol.c | 1 + trial4/makefile | 2 +- trial4/out/main | Bin 23064 -> 23064 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trial4/KeyGen.c b/trial4/KeyGen.c index c287564..75894b8 100644 --- a/trial4/KeyGen.c +++ b/trial4/KeyGen.c @@ -320,8 +320,7 @@ DIMASTATUS WritePrivKey(KeyDrv_context * KD_ctx, mbedtls_pk_context * pkey_ctx) unsigned char dest_file[50]; unsigned char * outbuf = calloc(1,sizeof(unsigned char)*KEY_BUF_SIZE); - - if(strcmp(KD_ctx -> phrase, IDENTITY)) + if(strcmp(KD_ctx -> phrase, IDENTITY) == 0) { if(DEBUG) { @@ -340,7 +339,7 @@ DIMASTATUS WritePrivKey(KeyDrv_context * KD_ctx, mbedtls_pk_context * pkey_ctx) strcpy(dest_file,"keys/"); } -printf("%s,%s\n",KD_ctx->phrase,IDENTITY ); + strcat(dest_file, KD_ctx->phrase); strcat(dest_file, "_priv"); diff --git a/trial4/ROMprotocol.c b/trial4/ROMprotocol.c index 39f4b26..eb31ad4 100644 --- a/trial4/ROMprotocol.c +++ b/trial4/ROMprotocol.c @@ -33,6 +33,7 @@ DIMASTATUS ROMprotocol() //Calculate DIMA RTM hash + //////////////TODO//////////////// //this should be calculated on the DIMA bin and remain static. //how to do that? //hardcoding junk value for now diff --git a/trial4/makefile b/trial4/makefile index e080dbe..3631e7e 100644 --- a/trial4/makefile +++ b/trial4/makefile @@ -15,7 +15,7 @@ all: main.c ROMprotocol.c KeyGen.c ${CC} -o $(ODIR)/main main.c KeyGen.c ROMprotocol.c -lm -lmbedcrypto -lmbedtls -lmbedx509 debug: - ${CC} -g -o $(ODIR)/dbg-main main.c KeyGen.c ROMprotocol.c-lm -lmbedcrypto -lmbedtls -lmbedx509 + ${CC} -gdwarf-2 -g3 -o $(ODIR)/dbg-main main.c KeyGen.c ROMprotocol.c -lm -lmbedcrypto -lmbedtls -lmbedx509 trial: ${CC} -g -o $(ODIR)/trial ECCtrial.c -lm -lmbedcrypto -lmbedtls -lmbedx509 diff --git a/trial4/out/main b/trial4/out/main index ba99235be63efcbf5115e2763fdc60b50e038f1c..12124116308a6361aee72f0d4eae2183a03751d5 100755 GIT binary patch delta 42 zcmV+_0M-APv;mm30kDJu6wd1!ffdXr6wjA(@q4Hau4^=9^|P1)tsDV$vqm4%I+x87 ArT_o{ delta 42 zcmV+_0M-APv;mm30kDJu6zX&WJ)Hoi;{|9E$C%}S3|siMDzlgZtsDV#vqm4%I)aiB A*Z=?k