set(EVENT2_MINIMUM 2.0.10)
set(OPENSSL_MINIMUM 0.9.4)
set(CYASSL_MINIMUM 3.0)
-set(POLARSSL_MINIMUM 1.3)
+set(POLARSSL_MINIMUM 1.2)
set(ZLIB_MINIMUM 1.2.3)
set(GTK_MINIMUM 3.4.0)
set(GLIB_MINIMUM 2.32.0)
AC_SUBST(OPENSSL_MINIMUM)
CYASSL_MINIMUM=3.0
AC_SUBST(CYASSL_MINIMUM)
-POLARSSL_MINIMUM=0x01030000 # 1.3
+POLARSSL_MINIMUM=0x01020000 # 1.2
AC_SUBST(POLARSSL_MINIMUM)
##
#include <polarssl/dhm.h>
#include <polarssl/error.h>
#include <polarssl/sha1.h>
+#include <polarssl/version.h>
#include "transmission.h"
#include "crypto-utils.h"
tr_sha1_ctx_t
tr_sha1_init (void)
{
- sha1_context * handle = tr_new (sha1_context, 1);
+ sha1_context * handle = tr_new0 (sha1_context, 1);
+
+#if POLARSSL_VERSION_NUMBER >= 0x01030800
+ sha1_init (handle);
+#endif
+
sha1_starts (handle);
return handle;
}
sha1_finish (handle, hash);
}
+#if POLARSSL_VERSION_NUMBER >= 0x01030800
+ sha1_free (handle);
+#endif
+
tr_free (handle);
return true;
}
tr_rc4_ctx_t
tr_rc4_new (void)
{
- return tr_new0 (arc4_context, 1);
+ arc4_context * handle = tr_new0 (arc4_context, 1);
+
+#if POLARSSL_VERSION_NUMBER >= 0x01030800
+ arc4_init (handle);
+#endif
+
+ return handle;
}
void
tr_rc4_free (tr_rc4_ctx_t handle)
{
+#if POLARSSL_VERSION_NUMBER >= 0x01030800
+ arc4_free (handle);
+#endif
+
tr_free (handle);
}
assert (prime_num != NULL);
assert (generator_num != NULL);
+#if POLARSSL_VERSION_NUMBER >= 0x01030800
dhm_init (handle);
+#endif
if (!check_result (mpi_read_binary (&handle->P, prime_num, prime_num_length)) ||
!check_result (mpi_read_binary (&handle->G, generator_num, generator_num_length)))