1
0
Fork 0
Commit Graph

34 Commits

Author SHA1 Message Date
Alexander Andreev b9b82a0e26
Return a number of bytes read or sent. 2024-03-24 17:55:39 +04:00
Alexander Andreev 6990664f2f
In net_send() remove a const modifier from buf_len. In net_recv() a const modifier was added to a pointer to buf. 2024-03-24 16:50:49 +04:00
Alexander Andreev ba3a87ab4f
An unneeded include of sys/socket.h was removed. It is implicitely included in netinet/in.h. 2024-03-24 16:41:22 +04:00
Alexander Andreev 43d5bdfe80
In net_send() check if an raddr struct is set. 2024-03-24 16:35:04 +04:00
Alexander Andreev e5c6f23cfb
A buffer was removed from a struct net_t. Use external buffer for data receiving. net_sendto -> net_send and net_recvfrom -> net_recv. 2024-03-24 16:31:10 +04:00
Alexander Andreev 842659e879
Remove useless comments. 2024-03-24 14:08:13 +04:00
Alexander Andreev b04fbeb34e
Let's uncomment a code for audio and put an encryption in it. 2024-03-24 06:05:01 +04:00
Alexander Andreev 0c61d4e433
Changed a crypt_hello_get_nonce func because now a half of a nonce is placed after a pub key and before a signature. 2024-03-24 05:56:30 +04:00
Alexander Andreev 944a81a8bf
Let's swap a signature and a half of a nonce. And sign both a pub key and the half of a nonce. 2024-03-24 05:52:19 +04:00
Alexander Andreev 1afd678fd4
Let's put some pointer safety. Like checks for NULL and actually freeing them in case of errors. 2024-03-24 05:35:39 +04:00
Alexander Andreev 16e0149802
Replace '< 0' with '== -1'. For the sake of optimisation! xD 2024-03-24 05:32:46 +04:00
Alexander Andreev e4b388f554
An include messup was cleaned. 2024-03-24 05:06:13 +04:00
Alexander Andreev 3b68835c9c
Oh, because of goto used some var can never be presented, so lets move them right before the first use of a goto. 2024-03-24 04:56:02 +04:00
Alexander Andreev 98581204e9
Well, actually, let a crypt_hello_get_nonce func return just a "unsigned char *" without a const modifier. 2024-03-24 04:54:59 +04:00
Alexander Andreev 8df5a6344e
Another change of main to show an example of key exchange and data encryption. 2024-03-24 04:41:08 +04:00
Alexander Andreev acc016f10b
crypt_session_encrypt() and crypt_session_decrypt() was implemented. 2024-03-24 04:38:32 +04:00
Alexander Andreev 3ec30111e2
Removed an absolutely clueless const modifier from a bool argument that was introduced during a usual late night programming session. :) 2024-03-24 02:23:57 +04:00
Alexander Andreev 0cdca672a0
Now hello has a half of a nonce is being generated. A crypt_hello_get_nonce() func was introduced to make a full-length nonce. 2024-03-24 02:18:27 +04:00
Alexander Andreev 61b1992828
Put just a touch of pointer magick in a crypt module. Also put const modifiers here and there. 2024-03-23 05:52:03 +04:00
Alexander Andreev 2786fb9c87
An unused stdlib.h include was removed from net.c. 2024-03-23 04:22:36 +04:00
Alexander Andreev 0d47261c51
Current state of main. 2024-03-23 04:22:01 +04:00
Alexander Andreev a875891088
A crypt module had many changes. *_destroy() funcs were added to securely erase the keys. A set of new defines were introduced to mask the ones from a libsodium. Funcs for load and store the keys in a FILE. Added a crypt_hello() func. 2024-03-23 04:21:41 +04:00
Alexander Andreev b5d92489b8
In an audio module: 1) removed a commented out block of code; 2) uint8_t -> unsigned char; 3) size_t -> int; 4) make audio_read() return a number of encoded bytes or -1 on an error. 2024-03-23 04:17:19 +04:00
Alexander Andreev 0c7995d5fc
Ignore files ending with _key. 2024-03-23 04:14:53 +04:00
Alexander Andreev fb9e62fc8b
crypt_store_*_key funcs was implemented. Also a test code in a main func comes along. 2024-03-22 04:16:43 +04:00
Alexander Andreev 026d8376e7
IN Makefile a clean target added. 2024-03-22 04:15:44 +04:00
Alexander Andreev e6c94b64a0
First try to implement a network module. 2024-03-22 03:50:58 +04:00
Alexander Andreev 051d18ba40
In crypt.c/.h a var/arg naming was changed as well. 2024-03-22 03:32:40 +04:00
Alexander Andreev e075a99a28
In audio.c/.h arg/var naming style was changed. 2024-03-22 03:30:12 +04:00
Alexander Andreev b233d8bc43
Fixed an ifndef in crypt.h. 2024-03-22 03:24:01 +04:00
Alexander Andreev 20c99d0540
Last main.c. 2024-03-21 17:51:03 +04:00
Alexander Andreev 35750274d1
A current state of a crypt module. 2024-03-21 17:50:55 +04:00
Alexander Andreev f13e7e20fd
Completed an audio module using a blocking I/O. 2024-03-21 17:50:20 +04:00
Alexander Andreev 64176055d0
An initial commit. :) 2024-03-21 04:10:02 +04:00