aboutsummaryrefslogtreecommitdiff
path: root/networking/tls.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-01-18 17:20:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-01-18 17:20:27 +0100
commitb7e9ae6e9f8b1683774e2a69b943cec31c94f5a2 (patch)
tree4bf0f676a01bcb99a58b5987cb4cc9590a1c1d6b /networking/tls.h
parentc8ba23bcec94ecbc8ee82053d1b7e299cc839184 (diff)
downloadbusybox-b7e9ae6e9f8b1683774e2a69b943cec31c94f5a2.tar.gz
tls: added AES code and made it compile. not used yet
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tls.h')
-rw-r--r--networking/tls.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/networking/tls.h b/networking/tls.h
index 3a8a3d826..5a0cb67e9 100644
--- a/networking/tls.h
+++ b/networking/tls.h
@@ -3,17 +3,40 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+/* Interface glue between bbox code and minimally tweaked matrixssl
+ * code. All C files (matrixssl and bbox (ones which need TLS))
+ * include this file, and guaranteed to see a consistent API,
+ * defines, types, etc.
+ */
#include "libbb.h"
-/* config tweaks */
-#define HAVE_NATIVE_INT64 1
-#undef DISABLE_PSTM
+
+/* Config tweaks */
+#define HAVE_NATIVE_INT64
#undef USE_1024_KEY_SPEED_OPTIMIZATIONS
#undef USE_2048_KEY_SPEED_OPTIMIZATIONS
-//TODO: enable to use asm:
-//#if defined(__GNUC__) && defined(__i386__) -> #define PSTM_32BIT and PSTM_X86
-//#if defined(__GNUC__) && defined(__x86_64__) -> #define PSTM_64BIT and PSTM_X86_64
-//ARM and MIPS also have these
+#define USE_AES
+#undef USE_AES_CBC_EXTERNAL
+#undef USE_AES_CCM
+#undef USE_AES_GCM
+#undef USE_3DES
+#undef USE_ARC4
+#undef USE_IDEA
+#undef USE_RC2
+#undef USE_SEED
+/* pstm: multiprecision numbers */
+#undef DISABLE_PSTM
+#if defined(__GNUC__) && defined(__i386__)
+# define PSTM_32BIT
+# define PSTM_X86
+#endif
+//test this before enabling:
+//#if defined(__GNUC__) && defined(__x86_64__)
+//# define PSTM_64BIT
+//# define PSTM_X86_64
+//#endif
+//#if SOME_COND #define PSTM_MIPS, #define PSTM_32BIT
+//#if SOME_COND #define PSTM_ARM, #define PSTM_32BIT
#define PS_SUCCESS 0
@@ -65,9 +88,11 @@ void tls_get_random(void *buf, unsigned len);
#define memset_s(A,B,C,D) memset((A),(C),(D))
/* Constant time memory comparison */
#define memcmpct(s1, s2, len) memcmp((s1), (s2), (len))
-#undef min
+#undef min
#define min(x, y) ((x) < (y) ? (x) : (y))
#include "tls_pstm.h"
#include "tls_rsa.h"
+#include "tls_symmetric.h"
+#include "tls_aes.h"