From c6270c739d48af98725cb5b92d2e5fb5f91b07a2 Mon Sep 17 00:00:00 2001 From: "login (envs.net)" Date: Fri, 21 Feb 2020 17:16:36 +0000 Subject: Replacing newlines and vertical tabs in messages with and Newlines and vertical tabs in messages are replaced with and to prevent transaction spoofing inside a message. --- ntcoin | 4 ++-- pcoin.cpp | 4 +++- tcoin.cpp | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ntcoin b/ntcoin index 26cacc9..ce114a7 100755 --- a/ntcoin +++ b/ntcoin @@ -192,7 +192,7 @@ else && (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin" "'`/usr/bin/realpath -s $2`'/tcoin") \ && (/bin/chmod 550 "'`/usr/bin/realpath -s $2`'/tcoin") \ && (/bin/chmod u+s "'`/usr/bin/realpath -s $2`'/tcoin") \ -&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin_defs.cpp'" "'`/usr/bin/realpath -s $2`'/tcoin_defs.cpp'")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_tcoin" +&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin_defs.cpp" "'`/usr/bin/realpath -s $2`'/tcoin_defs.cpp")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_tcoin" /bin/chmod 540 "`/usr/bin/realpath -s $1`/tcoin/bin/compile_tcoin" /bin/echo '#!/bin/bash '`which nano`' "'`/bin/pwd`'/tcoin.cpp"' > "`/usr/bin/realpath -s $1`/tcoin/bin/edit_tcoin" @@ -214,7 +214,7 @@ else && (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin" "'`/usr/bin/realpath -s $2`'/pcoin") \ && (/bin/chmod 550 "'`/usr/bin/realpath -s $2`'/pcoin") \ && (/bin/chmod u+s "'`/usr/bin/realpath -s $2`'/pcoin") \ -&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin_defs.cpp'" "'`/usr/bin/realpath -s $2`'/pcoin_defs.cpp'")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_pcoin" +&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin_defs.cpp" "'`/usr/bin/realpath -s $2`'/pcoin_defs.cpp")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_pcoin" /bin/chmod 540 "`/usr/bin/realpath -s $1`/tcoin/bin/compile_pcoin" /bin/echo '#!/bin/bash '`which nano`' "'`/bin/pwd`'/pcoin.cpp"' > "`/usr/bin/realpath -s $1`/tcoin/bin/edit_pcoin" diff --git a/pcoin.cpp b/pcoin.cpp index 337fc08..9e00b21 100644 --- a/pcoin.cpp +++ b/pcoin.cpp @@ -678,7 +678,9 @@ int send_message(const char* sender_username, const char* receiver_username, con for(int i=0; message[i]!='\0'; ++i) { if(message[i] == '\n') - fout << "\u23CE "; //return-key symbol, or return symbol, or enter symbol; space for spacing + fout << ""; //return-key pressed + else if(message[i] == '\v') + fout << ""; //vertical-tab symbol entered else fout << message[i]; } diff --git a/tcoin.cpp b/tcoin.cpp index 163323a..f9abffb 100644 --- a/tcoin.cpp +++ b/tcoin.cpp @@ -961,7 +961,9 @@ int send_message(const char* sender_username, const char* receiver_username, con for(int i=0; message[i]!='\0'; ++i) { if(message[i] == '\n') - fout << "\u23CE "; //return-key symbol, or return symbol, or enter symbol; space for spacing + fout << ""; //return-key pressed + else if(message[i] == '\v') + fout << ""; //vertical-tab symbol entered else fout << message[i]; } -- cgit