diff options
-rw-r--r-- | INSTALL.md | 11 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | core/net_crypto.c | 10 | ||||
-rw-r--r-- | testing/nTox.c | 11 |
4 files changed, 17 insertions, 17 deletions
@@ -6,7 +6,6 @@ | |||
6 | - [Homebrew](#homebrew) | 6 | - [Homebrew](#homebrew) |
7 | - [Non-Homebrew](#non-homebrew) | 7 | - [Non-Homebrew](#non-homebrew) |
8 | - [Windows](#windows) | 8 | - [Windows](#windows) |
9 | - [Usage](#usage) | ||
10 | 9 | ||
11 | <a name="installation" /> | 10 | <a name="installation" /> |
12 | ##Installation | 11 | ##Installation |
@@ -32,11 +31,14 @@ sudo checkinstall --install --pkgname libsodium --pkgversion 0.4.2 --nodoc | |||
32 | sudo ldconfig | 31 | sudo ldconfig |
33 | ``` | 32 | ``` |
34 | 33 | ||
35 | Then clone this repo and run: | 34 | Then clone this repo and generate makefile: |
36 | ```bash | 35 | ```bash |
36 | git clone git://github.com/irungentoo/ProjectTox-Core.git | ||
37 | cd ProjectTox-Core | ||
37 | mkdir build && cd build | 38 | mkdir build && cd build |
38 | cmake .. | 39 | cmake .. |
39 | ``` | 40 | ``` |
41 | Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. | ||
40 | 42 | ||
41 | Then you can build any of the [`/testing`](/testing) and [`/other`](/other) that are currently supported on your platform by running: | 43 | Then you can build any of the [`/testing`](/testing) and [`/other`](/other) that are currently supported on your platform by running: |
42 | ```bash | 44 | ```bash |
@@ -102,6 +104,7 @@ Navigate in `cmd` to this repo and run: | |||
102 | mkdir build && cd build | 104 | mkdir build && cd build |
103 | cmake -G "MinGW Makefiles" .. | 105 | cmake -G "MinGW Makefiles" .. |
104 | ``` | 106 | ``` |
107 | Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. | ||
105 | 108 | ||
106 | Then you can build any of the [`/testing`](/testing) and [`/other`](/other) that are currently supported on your platform by running: | 109 | Then you can build any of the [`/testing`](/testing) and [`/other`](/other) that are currently supported on your platform by running: |
107 | ```cmd | 110 | ```cmd |
@@ -117,7 +120,3 @@ Or you could just build everything that is supported on your platform by running | |||
117 | mingw32-make | 120 | mingw32-make |
118 | ``` | 121 | ``` |
119 | 122 | ||
120 | <a name="usage" /> | ||
121 | ## Usage | ||
122 | |||
123 | - [Start Guide](start_guide.md) | ||
@@ -41,7 +41,7 @@ For further information, check our [To-do list](https://github.com/irungentoo/Pr | |||
41 | The goal of this project is to create a configuration-free P2P skype | 41 | The goal of this project is to create a configuration-free P2P skype |
42 | replacement. Configuration-free means that the user will simply have to open the program and | 42 | replacement. Configuration-free means that the user will simply have to open the program and |
43 | without any account configuration will be capable of adding people to his | 43 | without any account configuration will be capable of adding people to his |
44 | friends list and start conversing with them. There are many so called skype replacements and all of them are either hard to | 44 | friends list and start conversing with them. There are many so-called skype replacements and all of them are either hard to |
45 | configure for the normal user or suffer from being way too centralized. | 45 | configure for the normal user or suffer from being way too centralized. |
46 | 46 | ||
47 | ### Documentation: | 47 | ### Documentation: |
diff --git a/core/net_crypto.c b/core/net_crypto.c index 83cb20a2..2dbaa87c 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c | |||
@@ -75,10 +75,9 @@ int encrypt_data(uint8_t *public_key, uint8_t *secret_key, uint8_t *nonce, | |||
75 | uint32_t i; | 75 | uint32_t i; |
76 | uint32_t check = 0; | 76 | uint32_t check = 0; |
77 | for(i = 0; i < crypto_box_BOXZEROBYTES; ++i) { | 77 | for(i = 0; i < crypto_box_BOXZEROBYTES; ++i) { |
78 | if (temp_encrypted[i] != 0) | 78 | check |= temp_encrypted[i] ^ 0; |
79 | check = 1; | ||
80 | } | 79 | } |
81 | if(check == 1) | 80 | if(check != 0) |
82 | return -1; | 81 | return -1; |
83 | 82 | ||
84 | /* unpad the encrypted message */ | 83 | /* unpad the encrypted message */ |
@@ -110,10 +109,9 @@ int decrypt_data(uint8_t *public_key, uint8_t *secret_key, uint8_t *nonce, | |||
110 | uint32_t i; | 109 | uint32_t i; |
111 | uint32_t check = 0; | 110 | uint32_t check = 0; |
112 | for(i = 0; i < crypto_box_ZEROBYTES; ++i) { | 111 | for(i = 0; i < crypto_box_ZEROBYTES; ++i) { |
113 | if (temp_plain[i] != 0) | 112 | check |= temp_plain[i] ^ 0; |
114 | check = 1; | ||
115 | } | 113 | } |
116 | if(check == 1) | 114 | if(check != 0) |
117 | return -1; | 115 | return -1; |
118 | 116 | ||
119 | /* unpad the plain message */ | 117 | /* unpad the plain message */ |
diff --git a/testing/nTox.c b/testing/nTox.c index f87a2a25..de75d2ff 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -133,6 +133,9 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
133 | } | 133 | } |
134 | else if (inpt_command == 'm') { //message command: /m friendnumber messsage | 134 | else if (inpt_command == 'm') { //message command: /m friendnumber messsage |
135 | size_t len = strlen(line); | 135 | size_t len = strlen(line); |
136 | if(len < 3) | ||
137 | return; | ||
138 | |||
136 | char numstring[len-3]; | 139 | char numstring[len-3]; |
137 | char message[len-3]; | 140 | char message[len-3]; |
138 | int i; | 141 | int i; |
@@ -141,13 +144,13 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
141 | numstring[i] = line[i+3]; | 144 | numstring[i] = line[i+3]; |
142 | } else { | 145 | } else { |
143 | int j; | 146 | int j; |
144 | for (j = (i+1); j < len; j++) | 147 | for (j = (i+1); j < (len+1); j++) |
145 | message[j-i-1] = line[j+3]; | 148 | message[j-i-1] = line[j+3]; |
146 | break; | 149 | break; |
147 | } | 150 | } |
148 | } | 151 | } |
149 | int num = atoi(numstring); | 152 | int num = atoi(numstring); |
150 | if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { | 153 | if (m_sendmessage(num, (uint8_t*) message, strlen(message) + 1) != 1) { |
151 | new_lines("[i] could not send message"); | 154 | new_lines("[i] could not send message"); |
152 | } else { | 155 | } else { |
153 | new_lines(format_message(message, -1)); | 156 | new_lines(format_message(message, -1)); |
@@ -162,7 +165,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
162 | name[i-3] = line[i]; | 165 | name[i-3] = line[i]; |
163 | } | 166 | } |
164 | name[i-3] = 0; | 167 | name[i-3] = 0; |
165 | setname(name, i); | 168 | setname(name, i - 2); |
166 | char numstring[100]; | 169 | char numstring[100]; |
167 | sprintf(numstring, "[i] changed nick to %s", (char*)name); | 170 | sprintf(numstring, "[i] changed nick to %s", (char*)name); |
168 | new_lines(numstring); | 171 | new_lines(numstring); |
@@ -179,7 +182,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | |||
179 | status[i-3] = line[i]; | 182 | status[i-3] = line[i]; |
180 | } | 183 | } |
181 | status[i-3] = 0; | 184 | status[i-3] = 0; |
182 | m_set_userstatus(status, strlen((char*)status)); | 185 | m_set_userstatus(status, strlen((char*)status) + 1); |
183 | char numstring[100]; | 186 | char numstring[100]; |
184 | sprintf(numstring, "[i] changed status to %s", (char*)status); | 187 | sprintf(numstring, "[i] changed status to %s", (char*)status); |
185 | new_lines(numstring); | 188 | new_lines(numstring); |