Commit d124111e authored by yids's avatar yids

pl_decrypt and text.c fix

parent 2c26fd3f
......@@ -84,7 +84,7 @@ int main() {
printf("\n encrypted message: \n %s \n END encrypted message \n", rcv_ctx->msg->msg );
switch(pl_receive_message(sender_ctx)) {
switch(pl_receive_message(rcv_ctx)) {
case 0:
printf("RCV: OK! \n");
printf(" Message! \n to: %u from: %u \n the decrypted message: %s \n", rcv_ctx->msg->address, compressed_point_to_addr(rcv_ctx->msg->sender_public_key), rcv_ctx->msg->msg);
......
......@@ -190,7 +190,7 @@ pl_decrypt(struct pl_ctx * ctx, struct pl_pagermessage * msg, char plain[PLAIN_
memset(temp_encrypted, '\0', crypto_box_BOXZEROBYTES);
memcpy(temp_encrypted, msg->msg, CRYPTED_MSG_SIZE);
rc = crypto_box_open(temp_plain, temp_encrypted, CRYPTED_MSG_SIZE, ctx->msg->nonce, ctx->msg->sender_public_key, ctx->kp->secret_key);
rc = crypto_box_open(temp_plain, temp_encrypted, CRYPTED_MSG_SIZE, msg->nonce, msg->sender_public_key, ctx->kp->secret_key);
if( rc != 0 ) {
return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment