fixing input keys

This commit is contained in:
atul.jha 2021-02-10 18:08:21 +01:00
parent 86cb8fb4a2
commit 20028faf44
5 changed files with 10 additions and 12 deletions

View File

@ -72,7 +72,7 @@ DIMASTATUS challenge_client(Node_info * Client)
mbedtls_pk_context priv_ctx; mbedtls_pk_context priv_ctx;
mbedtls_pk_init(&priv_ctx); mbedtls_pk_init(&priv_ctx);
ret = mbedtls_pk_parse_keyfile(&priv_ctx, "sslkeys/Alias_priv.pem", NULL); ret = mbedtls_pk_parse_keyfile(&priv_ctx, "keys/Alias_priv.pem", NULL);
if(ret < DIMASUCCESS) if(ret < DIMASUCCESS)
{ {
printf("DIMAPKFAILURE : Failed to load signing key -0x%04x\n", (unsigned int) -ret); printf("DIMAPKFAILURE : Failed to load signing key -0x%04x\n", (unsigned int) -ret);
@ -240,7 +240,7 @@ DIMASTATUS response_master(Node_info * Server, Resp_context * Rp, unsigned char
mbedtls_pk_context priv_ctx; mbedtls_pk_context priv_ctx;
mbedtls_pk_init(&priv_ctx); mbedtls_pk_init(&priv_ctx);
ret = mbedtls_pk_parse_keyfile(&priv_ctx, "sslkeys/Alias_priv.pem", NULL); ret = mbedtls_pk_parse_keyfile(&priv_ctx, "keys/Alias_priv.pem", NULL);
if(ret < DIMASUCCESS) if(ret < DIMASUCCESS)
{ {
printf("DIMAPKFAILURE : Failed to load signing key -0x%04x\n", (unsigned int) -ret); printf("DIMAPKFAILURE : Failed to load signing key -0x%04x\n", (unsigned int) -ret);

View File

@ -1,4 +0,0 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECF3jSVCzo8u2Vk/TPe6Qk+7ATSQS
kxWVH0QM4JlIqjxkcwffOP7CT9DQ1HxcTG2VaRvICjdU02ks106x5x/zfw==
-----END PUBLIC KEY-----

View File

@ -65,7 +65,7 @@
/* DEFAULT CONFIGURATIONS */ /* DEFAULT CONFIGURATIONS */
#define DEBUG 0 //print all values when 1 #define DEBUG 1 //print all values when 1
#define isRSA 0 #define isRSA 0
#define isECC 1 #define isECC 1
@ -108,7 +108,7 @@
#define SERVER_ADD "localhost" #define SERVER_ADD "10.42.0.13"
#define SERVER_PORT "11999" #define SERVER_PORT "11999"
#define PLAINTEXT "==Hello there!==" #define PLAINTEXT "==Hello there!=="
@ -117,7 +117,7 @@
#define CLIENT2_ID "03" #define CLIENT2_ID "03"
#define CLIENT3_ID "04" #define CLIENT3_ID "04"
#define DFL_ID MASTER_ID //change ID according to node #define DFL_ID CLIENT1_ID //change ID according to node
#define NODE_ID_SIZE 8 #define NODE_ID_SIZE 8
/////////////////////////////////////////////////// ///////////////////////////////////////////////////

View File

@ -65,7 +65,7 @@ int main()
Self.ID = DFL_ID; Self.ID = DFL_ID;
Self.status = DFL_CL_STAT; Self.status = DFL_CL_STAT;
printf("size of ID %ld\n", sizeof(Self.ID) ); printf("size of ID %ld\n", NODE_ID_SIZE );
//Verifier Node code //Verifier Node code
if(Self.ID == MASTER_ID) if(Self.ID == MASTER_ID)
@ -125,7 +125,7 @@ int main()
printf("Client connected ...\n"); printf("Client connected ...\n");
ret = mbedtls_net_recv(&fd_client, netBuff, sizeof(Self.ID)); ret = mbedtls_net_recv(&fd_client, netBuff, NODE_ID_SIZE);
if(ret < DIMASUCCESS) if(ret < DIMASUCCESS)
{ {
printf("DIMANETWORKFAILURE : Failed to recv ID -0x%04x\n", (unsigned int) -ret); printf("DIMANETWORKFAILURE : Failed to recv ID -0x%04x\n", (unsigned int) -ret);
@ -238,7 +238,7 @@ int main()
Server.fd = &fd_server; Server.fd = &fd_server;
sleep(1); sleep(1);
ret = mbedtls_net_send(Server.fd, Self.ID, sizeof(Self.ID)); ret = mbedtls_net_send(Server.fd, Self.ID, NODE_ID_SIZE);
if(ret < DIMASUCCESS) if(ret < DIMASUCCESS)
{ {
printf("DIMANETWORKFAILURE : Failed to send ID -0x%04x\n", (unsigned int) -ret); printf("DIMANETWORKFAILURE : Failed to send ID -0x%04x\n", (unsigned int) -ret);

View File

@ -32,3 +32,5 @@ clean:
#client - scp keys/Alias_pub.pem pi@10.42.0.13:/home/pi/GIT/openSSL-DICE/trial5/clientkeys/Client1_pub.pem
#server - scp keys/Alias_pub.pem pi@10.42.0.91:/home/pi/GIT/openSSL-DICE/trial5/clientkeys/Server_pub.pem