mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-29 18:11:33 +00:00
Always build with ECC support
This commit is contained in:
parent
18273e5f3b
commit
b03636f0cf
@ -13,6 +13,7 @@ libzrtp_include_HEADERS = \
|
|||||||
$(top_srcdir)/include/zrtp_config_user.h \
|
$(top_srcdir)/include/zrtp_config_user.h \
|
||||||
$(top_srcdir)/include/zrtp_config_unix.h \
|
$(top_srcdir)/include/zrtp_config_unix.h \
|
||||||
$(top_srcdir)/include/zrtp_crypto.h \
|
$(top_srcdir)/include/zrtp_crypto.h \
|
||||||
|
$(top_srcdir)/include/zrtp_ec.h \
|
||||||
$(top_srcdir)/include/zrtp_engine.h \
|
$(top_srcdir)/include/zrtp_engine.h \
|
||||||
$(top_srcdir)/include/zrtp_error.h \
|
$(top_srcdir)/include/zrtp_error.h \
|
||||||
$(top_srcdir)/include/zrtp_iface.h \
|
$(top_srcdir)/include/zrtp_iface.h \
|
||||||
@ -40,10 +41,6 @@ libzrtp_include_HEADERS = \
|
|||||||
$(top_srcdir)/third_party/bgaes/sha1.h \
|
$(top_srcdir)/third_party/bgaes/sha1.h \
|
||||||
$(top_srcdir)/third_party/bgaes/sha2.h
|
$(top_srcdir)/third_party/bgaes/sha2.h
|
||||||
|
|
||||||
if ZRTP_BUILD_ENTERPRISE
|
|
||||||
libzrtp_include_HEADERS += $(top_srcdir)/include/zrtp_ec.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
lib_LIBRARIES = libzrtp.a
|
lib_LIBRARIES = libzrtp.a
|
||||||
|
|
||||||
libzrtp_a_CPPFLAGS = \
|
libzrtp_a_CPPFLAGS = \
|
||||||
@ -58,6 +55,8 @@ libzrtp_a_SOURCES = $(top_srcdir)/src/zrtp.c \
|
|||||||
$(top_srcdir)/src/zrtp_crc.c \
|
$(top_srcdir)/src/zrtp_crc.c \
|
||||||
$(top_srcdir)/src/zrtp_crypto_aes.c \
|
$(top_srcdir)/src/zrtp_crypto_aes.c \
|
||||||
$(top_srcdir)/src/zrtp_crypto_atl.c \
|
$(top_srcdir)/src/zrtp_crypto_atl.c \
|
||||||
|
$(top_srcdir)/src/zrtp_crypto_ec.c \
|
||||||
|
$(top_srcdir)/src/zrtp_crypto_ecdh.c \
|
||||||
$(top_srcdir)/src/zrtp_crypto_hash.c \
|
$(top_srcdir)/src/zrtp_crypto_hash.c \
|
||||||
$(top_srcdir)/src/zrtp_crypto_pk.c \
|
$(top_srcdir)/src/zrtp_crypto_pk.c \
|
||||||
$(top_srcdir)/src/zrtp_crypto_sas.c \
|
$(top_srcdir)/src/zrtp_crypto_sas.c \
|
||||||
@ -87,10 +86,6 @@ libzrtp_a_SOURCES = $(top_srcdir)/src/zrtp.c \
|
|||||||
\
|
\
|
||||||
$(top_srcdir)/src/zrtp_iface_cache.c
|
$(top_srcdir)/src/zrtp_iface_cache.c
|
||||||
$(top_srcdir)/src/zrtp_engine_driven.c
|
$(top_srcdir)/src/zrtp_engine_driven.c
|
||||||
if ZRTP_BUILD_ENTERPRISE
|
|
||||||
libzrtp_a_SOURCES +=$(top_srcdir)/src/zrtp_crypto_ec.c \
|
|
||||||
$(top_srcdir)/src/zrtp_crypto_ecdh.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
check_PROGRAMS = cache_test
|
check_PROGRAMS = cache_test
|
||||||
|
|
||||||
|
@ -49,10 +49,6 @@ AC_PROG_CC
|
|||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
# Apply configure options
|
|
||||||
AC_ARG_ENABLE(enterprise, [ --enable-enterprise enable building of enterprise components).], enable_enterprise=$enableval,enable_enterprise="no")
|
|
||||||
AM_CONDITIONAL(ZRTP_BUILD_ENTERPRISE, [test "x$enable_enterprise" = "xyes"])
|
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([linux/version.h endian.h])
|
AC_CHECK_HEADERS([linux/version.h endian.h])
|
||||||
@ -85,13 +81,6 @@ AC_DEFINE(PRAGMA_PACK_PUSH,[#pragma pack(push, 1)],[Define pragma pack(push) for
|
|||||||
AC_DEFINE(PRAGMA_PACK_POP,[#pragma pack(pop)],[Define pragma pack(pop) for your platform])
|
AC_DEFINE(PRAGMA_PACK_POP,[#pragma pack(pop)],[Define pragma pack(pop) for your platform])
|
||||||
AC_DEFINE(INLINE,[static inline],[Define inline construction for your platform])
|
AC_DEFINE(INLINE,[static inline],[Define inline construction for your platform])
|
||||||
|
|
||||||
if test "x$enable_enterprise" = "xyes" ; then
|
|
||||||
AC_DEFINE(ENABLE_EC,1,Enterprise)
|
|
||||||
CFLAGS="$CFLAGS -DZRTP_ENABLE_EC=1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SUBST(ENABLE_EC)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Documentation
|
# Documentation
|
||||||
#
|
#
|
||||||
|
@ -35,9 +35,7 @@
|
|||||||
#include "zrtp_legal.h"
|
#include "zrtp_legal.h"
|
||||||
#include "zrtp_version.h"
|
#include "zrtp_version.h"
|
||||||
#include "zrtp_iface_cache.h"
|
#include "zrtp_iface_cache.h"
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
#include "zrtp_ec.h"
|
#include "zrtp_ec.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,8 +94,6 @@
|
|||||||
#define ZRTP_USE_BUILTIN_SCEHDULER 1
|
#define ZRTP_USE_BUILTIN_SCEHDULER 1
|
||||||
#undef ZRTP_USE_STACK_MINIM
|
#undef ZRTP_USE_STACK_MINIM
|
||||||
#define ZRTP_USE_STACK_MINIM 1
|
#define ZRTP_USE_STACK_MINIM 1
|
||||||
#undef ZRTP_ENABLE_EC
|
|
||||||
#define ZRTP_ENABLE_EC 0
|
|
||||||
#define ALIGNMENT_32BIT_REQUIRED
|
#define ALIGNMENT_32BIT_REQUIRED
|
||||||
|
|
||||||
#endif /* ZRTP_WIN_CONFIG_H__ */
|
#endif /* ZRTP_WIN_CONFIG_H__ */
|
||||||
|
@ -122,10 +122,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ZRTP_ENABLE_EC
|
|
||||||
#define ZRTP_ENABLE_EC 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ZRTP_DEBUG_WITH_PJSIP
|
#ifndef ZRTP_DEBUG_WITH_PJSIP
|
||||||
#define ZRTP_DEBUG_WITH_PJSIP 0
|
#define ZRTP_DEBUG_WITH_PJSIP 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,10 +15,7 @@
|
|||||||
#include "zrtp_error.h"
|
#include "zrtp_error.h"
|
||||||
#include "zrtp_engine.h"
|
#include "zrtp_engine.h"
|
||||||
#include "zrtp_config_user.h"
|
#include "zrtp_config_user.h"
|
||||||
|
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
#include "zrtp_ec.h"
|
#include "zrtp_ec.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
#include "zrtp_types.h"
|
#include "zrtp_types.h"
|
||||||
#include "zrtp_error.h"
|
#include "zrtp_error.h"
|
||||||
|
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
|
|
||||||
#define ZRTP_MAXECBITS 521
|
#define ZRTP_MAXECBITS 521
|
||||||
#define ZRTP_MAXECWORDS ((ZRTP_MAXECBITS+7)/8)
|
#define ZRTP_MAXECWORDS ((ZRTP_MAXECBITS+7)/8)
|
||||||
|
|
||||||
@ -80,6 +78,4 @@ int bnSquareMod_ (struct BigNum *rslt, struct BigNum *n1, struct BigNum *mod);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /*ZRTP_ENABLE_EC*/
|
|
||||||
|
|
||||||
#endif /* __ZRTP_CRYPTO_EC_H__ */
|
#endif /* __ZRTP_CRYPTO_EC_H__ */
|
||||||
|
@ -802,7 +802,6 @@ void zrtp_profile_defaults(zrtp_profile_t* profile, zrtp_global_t* zrtp)
|
|||||||
profile->auth_tag_lens[0] = ZRTP_ATL_HS32;
|
profile->auth_tag_lens[0] = ZRTP_ATL_HS32;
|
||||||
profile->hash_schemes[0] = ZRTP_HASH_SHA256;
|
profile->hash_schemes[0] = ZRTP_HASH_SHA256;
|
||||||
|
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
if (zrtp && (ZRTP_LICENSE_MODE_PASSIVE == zrtp->lic_mode)) {
|
if (zrtp && (ZRTP_LICENSE_MODE_PASSIVE == zrtp->lic_mode)) {
|
||||||
profile->pk_schemes[0] = ZRTP_PKTYPE_DH2048;
|
profile->pk_schemes[0] = ZRTP_PKTYPE_DH2048;
|
||||||
profile->pk_schemes[1] = ZRTP_PKTYPE_EC256P;
|
profile->pk_schemes[1] = ZRTP_PKTYPE_EC256P;
|
||||||
@ -813,16 +812,6 @@ void zrtp_profile_defaults(zrtp_profile_t* profile, zrtp_global_t* zrtp)
|
|||||||
profile->pk_schemes[2] = ZRTP_PKTYPE_DH2048;
|
profile->pk_schemes[2] = ZRTP_PKTYPE_DH2048;
|
||||||
}
|
}
|
||||||
profile->pk_schemes[3] = ZRTP_PKTYPE_MULT;
|
profile->pk_schemes[3] = ZRTP_PKTYPE_MULT;
|
||||||
#else
|
|
||||||
if (zrtp && (ZRTP_LICENSE_MODE_PASSIVE == zrtp->lic_mode)) {
|
|
||||||
profile->pk_schemes[0] = ZRTP_PKTYPE_DH2048;
|
|
||||||
profile->pk_schemes[1] = ZRTP_PKTYPE_DH3072;
|
|
||||||
} else {
|
|
||||||
profile->pk_schemes[0] = ZRTP_PKTYPE_DH3072;
|
|
||||||
profile->pk_schemes[1] = ZRTP_PKTYPE_DH2048;
|
|
||||||
}
|
|
||||||
profile->pk_schemes[2] = ZRTP_PKTYPE_MULT;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
#include "zrtp.h"
|
#include "zrtp.h"
|
||||||
|
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
|
|
||||||
/* Size of extra random data to approximate a uniform distribution mod n */
|
/* Size of extra random data to approximate a uniform distribution mod n */
|
||||||
#define UNIFORMBYTES 8
|
#define UNIFORMBYTES 8
|
||||||
|
|
||||||
@ -461,5 +459,3 @@ zrtp_status_t zrtp_ec_init_params( struct zrtp_ec_params *params, uint32_t bits
|
|||||||
|
|
||||||
return zrtp_status_ok;
|
return zrtp_status_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /*ZRTP_ENABLE_EC*/
|
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
#include "zrtp.h"
|
#include "zrtp.h"
|
||||||
|
|
||||||
|
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
|
|
||||||
#define _ZTU_ "zrtp ecdh"
|
#define _ZTU_ "zrtp ecdh"
|
||||||
|
|
||||||
static unsigned get_pbits(zrtp_pk_scheme_t *self)
|
static unsigned get_pbits(zrtp_pk_scheme_t *self)
|
||||||
@ -559,5 +557,3 @@ zrtp_status_t zrtp_defaults_ec_pkt(zrtp_global_t* zrtp)
|
|||||||
|
|
||||||
return zrtp_status_ok;
|
return zrtp_status_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /*ZRTP_ENABLE_EC*/
|
|
||||||
|
@ -214,9 +214,7 @@ static zrtp_status_t zrtp_dh_self_test(zrtp_pk_scheme_t *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
extern zrtp_status_t zrtp_defaults_ec_pkt(zrtp_global_t* zrtp);
|
extern zrtp_status_t zrtp_defaults_ec_pkt(zrtp_global_t* zrtp);
|
||||||
#endif
|
|
||||||
|
|
||||||
zrtp_status_t zrtp_defaults_pkt(zrtp_global_t* zrtp)
|
zrtp_status_t zrtp_defaults_pkt(zrtp_global_t* zrtp)
|
||||||
{
|
{
|
||||||
@ -329,11 +327,7 @@ zrtp_status_t zrtp_defaults_pkt(zrtp_global_t* zrtp)
|
|||||||
presh->base.id = ZRTP_PKTYPE_PRESH;
|
presh->base.id = ZRTP_PKTYPE_PRESH;
|
||||||
zrtp_comp_register(ZRTP_CC_PKT, presh, zrtp);
|
zrtp_comp_register(ZRTP_CC_PKT, presh, zrtp);
|
||||||
|
|
||||||
#if (defined(ZRTP_ENABLE_EC) && (ZRTP_ENABLE_EC == 1))
|
|
||||||
return zrtp_defaults_ec_pkt(zrtp);
|
return zrtp_defaults_ec_pkt(zrtp);
|
||||||
#else
|
|
||||||
return zrtp_status_ok;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user