]> git.tuebingen.mpg.de Git - paraslash.git/commit
Make rc4 encryption/decryption more explicit.
authorAndre Noll <maan@systemlinux.org>
Sun, 14 Jun 2009 20:50:11 +0000 (22:50 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 14 Jun 2009 20:50:11 +0000 (22:50 +0200)
commita9126f461792a84c760162ecb25100f1593d427d
tree019b6fbd4090c09ff7a002dde3736fc62872640a
parent20ad4f0f93da79e2ec0a9699dff58b9922556438
Make rc4 encryption/decryption more explicit.

The old code used a rather fancy way to (de)activate encryption on
a per fd basis: In net.c there was an array of rc4 keys, indexed by fd.
This is rather wastful because the array size is determined by the
highest fd for which encryption is activated.

It's also hard to comprehend and it's easy to get strange results if
one forgets to deactivate the encryption after the fd is closed.

This patch introduces a new structure, rc4_context, which consists of
an fd and the needed rc4 keys. Users explicitly call the new rc4 variants
of the receving/sending functions which take a pointer to a struct
rc4_context instead of a file descriptor but are otherwise identical.

Keep crypt simple!
23 files changed:
afs.c
afs.cmd
afs.h
aft.c
attribute.c
audiod.c
blob.c
client.c
client.h
client_common.c
command.c
command.h [new file with mode: 0644]
command_util.sh
crypt.c
crypt.h
grab_client.c
net.c
net.h
server.c
server.cmd
server.h
user_list.c
user_list.h