diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2013-05-11 00:29:40 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-05-11 00:29:40 +0100 |
commit | 14d20271c1672ec938275deda20448e6c6ee7336 (patch) | |
tree | 63f2c768d63c25abc8f0bb896a6c88df369bd614 /gst/librfb/d3des.h | |
parent | 0fc4af84980c7b76c67357f99ac2e2c5edbdbc5d (diff) | |
download | gstreamer-plugins-bad-14d20271c1672ec938275deda20448e6c6ee7336.tar.gz |
rfbsrc: make authentication handshake safe for multiple instances
Move DES key into context struct.
Diffstat (limited to 'gst/librfb/d3des.h')
-rw-r--r-- | gst/librfb/d3des.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/librfb/d3des.h b/gst/librfb/d3des.h index 7988eef35..1106fc367 100644 --- a/gst/librfb/d3des.h +++ b/gst/librfb/d3des.h @@ -22,7 +22,12 @@ #define EN0 0 /* MODE == encrypt */ #define DE1 1 /* MODE == decrypt */ -extern void deskey (unsigned char *, int); +/* init to 0 */ +typedef struct { + unsigned long KnL[32]; +} DESContext; + +extern void deskey (DESContext * ctx, unsigned char *, int); /* hexkey[8] MODE * Sets the internal key register according to the hexadecimal @@ -30,20 +35,20 @@ extern void deskey (unsigned char *, int); * for encryption or decryption according to MODE. */ -extern void usekey (unsigned long *); +extern void usekey (DESContext * ctx, unsigned long *); /* cookedkey[32] * Loads the internal key register with the data in cookedkey. */ -extern void cpkey (unsigned long *); +extern void cpkey (DESContext * ctx, unsigned long *); /* cookedkey[32] * Copies the contents of the internal key register into the storage * located at &cookedkey[0]. */ -extern void des (unsigned char *, unsigned char *); +extern void des (DESContext * ctx, unsigned char *, unsigned char *); /* from[8] to[8] * Encrypts/Decrypts (according to the key currently loaded in the |