rh-lab-q / remote-dependency-solving

GNU General Public License v3.0
10 stars 1 forks source link

Crypt communication between client and server #73

Open phracek opened 9 years ago

phracek commented 9 years ago

All communication between client and server has to be crypted. I suggest at least sha128 hash alghorithm.

jridky commented 9 years ago

in src/common/network_util.c is prepared function secure_write (in rest of code is already used). In this function implement encryption algorithm. Decryption has to be implemented in functions sock_recv and sock_solv_recv! (something like return decrypte(buffer))

jridky commented 9 years ago

Some help from Jan Kalina:

Pro zabezpeceni komunikace heslem (zajisteni autentizace, integrity a duvernosti) je mozne pouzit SASL. (pokud nechceme SSL nebo TLS)

Oficialni stranka GNU implementace SASLu: http://www.gnu.org/software/gsasl/

Vcelku podrobny popis i priklad pouziti klienta: http://www.gnu.org/software/gsasl/doxygen/

Priklad serveru: https://github.com/markpizz/gsasl/blob/master/examples/smtp-server.c

Obecne priklady viz github: https://github.com/markpizz/gsasl/tree/master/examples

Funguje to takto:

(nic jako odhlaseni/prehlaseni neni - pri rozpojeni komunikace proste klient i server jen uvolni SASL server/klienta)

Pri vytvareni serveru i klienta je nutno stejne nastavit pouzivany SASL mechanismus (napr. DIGEST-MD5) i variantu (auth-conf). Ruzne mechanismy se take lisi tim kdo zacina - jestli klient nebo server.

Bohuzel je problem najit podporovany mechanismus, ktery by umel sifrovani a nebyl deprecated. (jako DIGEST-MD5) V Elytronu to resime implementaci vlastnich SASL mechanismu DIGEST-SHA512 atd - mame ale jen pro javu.

"Moderni" SCRAM mechanismus samotne sifrovani neumi, umi jen zprostredkovat bezpecne vyjednani komunikacniho klice. (-PLUS varianta = tvz. channel binding)

Jina moznost co jsem ted nasel jen TLS a SSL, ale oboji pouzivy asymetrickou kryptografii, kterou nechcete...

http://www.gnutls.org/manual/html_node/Simple-Datagram-TLS-client-example.html

Jeste je tu GSSAPI (ten podporuje gsasl), ktery vyzaduje Kerberos server, coz pro toto ale asi taky neni idealni.

Kdyz se na to ted divam tak je orisek vymyslet to nejak bez SSL, TLS a deprecated SASL mechanismu...