Browse Source

Merge pull request #366 from wongsyrone/master

Add more mbed TLS cipher check
pull/367/head
Max Lv 9 years ago
parent
commit
bde0d26c7c
2 changed files with 140 additions and 3 deletions
  1. 92
      configure
  2. 51
      m4/mbedtls.m4

92
configure

@ -13218,8 +13218,8 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbedtls support Cipher Feedback mode or not" >&5
$as_echo_n "checking whether mbedtls support Cipher Feedback mode or not... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbedtls supports Cipher Feedback mode or not" >&5
$as_echo_n "checking whether mbedtls supports Cipher Feedback mode or not... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -13248,6 +13248,94 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbedtls supports the ARC4 stream cipher or not" >&5
$as_echo_n "checking whether mbedtls supports the ARC4 stream cipher or not... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <mbedtls/config.h>
int
main ()
{
#ifndef MBEDTLS_ARC4_C
#error the ARC4 stream cipher not supported by your mbed TLS.
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error $? "MBEDTLS_ARC4_C required" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbedtls supports the Blowfish block cipher or not" >&5
$as_echo_n "checking whether mbedtls supports the Blowfish block cipher or not... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <mbedtls/config.h>
int
main ()
{
#ifndef MBEDTLS_BLOWFISH_C
#error the Blowfish block cipher not supported by your mbed TLS.
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error $? "MBEDTLS_BLOWFISH_C required" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbedtls supports the Camellia block cipher or not" >&5
$as_echo_n "checking whether mbedtls supports the Camellia block cipher or not... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <mbedtls/config.h>
int
main ()
{
#ifndef MBEDTLS_CAMELLIA_C
#error the Camellia block cipher not supported by your mbed TLS.
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error $? "MBEDTLS_CAMELLIA_C required" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
$as_echo "#define USE_CRYPTO_MBEDTLS 1" >>confdefs.h
;;

51
m4/mbedtls.m4

@ -27,7 +27,7 @@ AC_DEFUN([ss_MBEDTLS],
[AC_MSG_ERROR([mbed TLS libraries not found.])]
)
AC_MSG_CHECKING([whether mbedtls support Cipher Feedback mode or not])
AC_MSG_CHECKING([whether mbedtls supports Cipher Feedback mode or not])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
@ -42,4 +42,53 @@ AC_DEFUN([ss_MBEDTLS],
[AC_MSG_RESULT([ok])],
[AC_MSG_ERROR([MBEDTLS_CIPHER_MODE_CFB required])]
)
AC_MSG_CHECKING([whether mbedtls supports the ARC4 stream cipher or not])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <mbedtls/config.h>
]],
[[
#ifndef MBEDTLS_ARC4_C
#error the ARC4 stream cipher not supported by your mbed TLS.
#endif
]]
)],
[AC_MSG_RESULT([ok])],
[AC_MSG_ERROR([MBEDTLS_ARC4_C required])]
)
AC_MSG_CHECKING([whether mbedtls supports the Blowfish block cipher or not])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <mbedtls/config.h>
]],
[[
#ifndef MBEDTLS_BLOWFISH_C
#error the Blowfish block cipher not supported by your mbed TLS.
#endif
]]
)],
[AC_MSG_RESULT([ok])],
[AC_MSG_ERROR([MBEDTLS_BLOWFISH_C required])]
)
AC_MSG_CHECKING([whether mbedtls supports the Camellia block cipher or not])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <mbedtls/config.h>
]],
[[
#ifndef MBEDTLS_CAMELLIA_C
#error the Camellia block cipher not supported by your mbed TLS.
#endif
]]
)],
[AC_MSG_RESULT([ok])],
[AC_MSG_ERROR([MBEDTLS_CAMELLIA_C required])]
)
])
Loading…
Cancel
Save