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 ba99235..1212411 100755 Binary files a/trial4/out/main and b/trial4/out/main differ