forked from shadowsocksr-backup/shadowsocksr-libev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mbed TLS support for shadowsocks-libev
Notes: - Test cipher CFB support just in case (i.e. OpenWrt disabled it) - Added some inline notes, please feel free to modify or remove them. - Sorry for my bad English - If you want to compile for OpenWrt, please make sure this hunk[1] not exists. - Only tested on ARM mamba (Linksys WRT1900AC v1), it works. [1] https://github.com/openwrt-mirror/openwrt/blob/master/package/libs/mbedtls/patches/200-config.patch#L12-L20 Have fun! Signed-off-by: Syrone Wong <[email protected]>
- Loading branch information
1 parent
aaf7284
commit e81b205
Showing
13 changed files
with
515 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
dnl Check to find the mbed TLS headers/libraries | ||
|
||
AC_DEFUN([ss_MBEDTLS], | ||
[ | ||
AC_ARG_WITH(mbedtls, | ||
AS_HELP_STRING([--with-mbedtls=DIR], [mbed TLS base directory, or:]), | ||
[mbedtls="$withval" | ||
CFLAGS="$CFLAGS -I$withval/include" | ||
LDFLAGS="$LDFLAGS -L$withval/lib"] | ||
) | ||
AC_ARG_WITH(mbedtls-include, | ||
AS_HELP_STRING([--with-mbedtls-include=DIR], [mbed TLS headers directory (without trailing /mbedtls)]), | ||
[mbedtls_include="$withval" | ||
CFLAGS="$CFLAGS -I$withval"] | ||
) | ||
AC_ARG_WITH(mbedtls-lib, | ||
AS_HELP_STRING([--with-mbedtls-lib=DIR], [mbed TLS library directory]), | ||
[mbedtls_lib="$withval" | ||
LDFLAGS="$LDFLAGS -L$withval"] | ||
) | ||
AC_CHECK_LIB(mbedcrypto, mbedtls_cipher_setup, | ||
[LIBS="-lmbedcrypto $LIBS"], | ||
[AC_MSG_ERROR([mbed TLS libraries not found.])] | ||
) | ||
AC_MSG_CHECKING([whether mbedtls support Cipher Feedback mode or not]) | ||
AC_COMPILE_IFELSE( | ||
[AC_LANG_PROGRAM( | ||
[[ | ||
#include <mbedtls/config.h> | ||
]], | ||
[[ | ||
#ifndef MBEDTLS_CIPHER_MODE_CFB | ||
#error Cipher Feedback mode a.k.a CFB not supported by your mbed TLS. | ||
#endif | ||
]] | ||
)], | ||
[AC_MSG_RESULT([ok])], | ||
[AC_MSG_ERROR([MBEDTLS_CIPHER_MODE_CFB required])] | ||
) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.