AES_KEY k;
xc0 = pkt[3] & 0xc0;
+
//skip clear pkt
- if (xc0 == 0x00) {
+ if (xc0 == 0x00)
return;
- }
+
//skip reserved pkt
- if (xc0 == 0x40) {
+ if (xc0 == 0x40)
return;
- }
- if (xc0 == 0x80 || xc0 == 0xc0) { // encrypted
+
+ if (xc0 == 0x80 || xc0 == 0xc0) { // encrypted
ev_od = (xc0 & 0x40) >> 6; // 0 even, 1 odd
pkt[3] &= 0x3f; // consider it decrypted now
if (pkt[3] & 0x20) { // incomplete packet
n = len >> 3;
if (n == 0) { // decrypted==encrypted!
return; // this doesn't need more processing
- }
+ }
} else {
len = 184;
offset = 4;
#ifndef LIBAESDEC_H_
#define LIBAESDEC_H_
- #include "build.h"
-
- #if ENABLE_SSL
- void *aes_get_key_struct(void);
- void aes_free_key_struct(void *keys);
- void aes_set_control_words(void *keys, const unsigned char *even, const unsigned char *odd);
- void aes_set_even_control_word(void *keys, const unsigned char *even);
- void aes_set_odd_control_word(void *keys, const unsigned char *odd);
- void aes_decrypt_packet(void *keys, unsigned char *packet);
- #else
- // empty functions
- static inline void *aes_get_key_struct(void) { return 0; };
- static inline void aes_free_key_struct(void *keys) { return; };
- static inline void aes_set_control_words(void *keys, const unsigned char *even, const unsigned char *odd) { return; };
- static inline void aes_set_even_control_word(void *keys, const unsigned char *even) { return; };
- static inline void aes_set_odd_control_word(void *keys, const unsigned char *odd) { return; };
- static inline void aes_decrypt_packet(void *keys, unsigned char *packet) { return; };
- #endif
+#include "build.h"
+
+#if ENABLE_SSL
+
+void *aes_get_key_struct(void);
+void aes_free_key_struct(void *keys);
+void aes_set_control_words(void *keys, const unsigned char *even, const unsigned char *odd);
+void aes_set_even_control_word(void *keys, const unsigned char *even);
+void aes_set_odd_control_word(void *keys, const unsigned char *odd);
+void aes_decrypt_packet(void *keys, unsigned char *packet);
+
+#else
+
+// empty functions
+static inline void *aes_get_key_struct(void) { return 0; };
+static inline void aes_free_key_struct(void *keys) { return; };
+static inline void aes_set_control_words(void *keys, const unsigned char *even, const unsigned char *odd) { return; };
+static inline void aes_set_even_control_word(void *keys, const unsigned char *even) { return; };
+static inline void aes_set_odd_control_word(void *keys, const unsigned char *odd) { return; };
+static inline void aes_decrypt_packet(void *keys, unsigned char *packet) { return; };
+
+#endif
+
#endif /* LIBAESDEC_H_ */