mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-13 10:15:43 +00:00
PPP: add a new LWIP_USE_EXTERNAL_MBEDTLS PPP option
PPP users can now choose to use an external mbed TLS copy instead of using our internal old version (but released under a BSDish license) PolarSSL copy.
This commit is contained in:
parent
9f3aff0cdf
commit
5df4f70a96
@ -339,6 +339,13 @@
|
|||||||
#define LWIP_USE_EXTERNAL_POLARSSL 0
|
#define LWIP_USE_EXTERNAL_POLARSSL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library
|
||||||
|
*/
|
||||||
|
#ifndef LWIP_USE_EXTERNAL_MBEDTLS
|
||||||
|
#define LWIP_USE_EXTERNAL_MBEDTLS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PPP Timeouts
|
* PPP Timeouts
|
||||||
*/
|
*/
|
||||||
@ -538,7 +545,7 @@
|
|||||||
/*
|
/*
|
||||||
* Build triggers for embedded PolarSSL
|
* Build triggers for embedded PolarSSL
|
||||||
*/
|
*/
|
||||||
#if !LWIP_USE_EXTERNAL_POLARSSL
|
#if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS
|
||||||
|
|
||||||
/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */
|
/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */
|
||||||
#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM
|
#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM
|
||||||
@ -562,7 +569,7 @@
|
|||||||
|
|
||||||
#endif /* MSCHAP_SUPPORT */
|
#endif /* MSCHAP_SUPPORT */
|
||||||
|
|
||||||
#endif /* !LWIP_USE_EXTERNAL_POLARSSL */
|
#endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */
|
||||||
|
|
||||||
/* Default value if unset */
|
/* Default value if unset */
|
||||||
#ifndef LWIP_INCLUDED_POLARSSL_MD4
|
#ifndef LWIP_INCLUDED_POLARSSL_MD4
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
/*
|
/*
|
||||||
* Map hashes and ciphers functions to PolarSSL
|
* Map hashes and ciphers functions to PolarSSL
|
||||||
*/
|
*/
|
||||||
|
#if !LWIP_USE_EXTERNAL_MBEDTLS
|
||||||
|
|
||||||
#include "netif/ppp/polarssl/md4.h"
|
#include "netif/ppp/polarssl/md4.h"
|
||||||
#define lwip_md4_context md4_context
|
#define lwip_md4_context md4_context
|
||||||
#define lwip_md4_starts md4_starts
|
#define lwip_md4_starts md4_starts
|
||||||
@ -75,6 +77,38 @@
|
|||||||
#define lwip_arc4_setup arc4_setup
|
#define lwip_arc4_setup arc4_setup
|
||||||
#define lwip_arc4_crypt arc4_crypt
|
#define lwip_arc4_crypt arc4_crypt
|
||||||
|
|
||||||
|
#endif /* !LWIP_USE_EXTERNAL_MBEDTLS */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Map hashes and ciphers functions to mbed TLS
|
||||||
|
*/
|
||||||
|
#if LWIP_USE_EXTERNAL_MBEDTLS
|
||||||
|
|
||||||
|
#define lwip_md4_context mbedtls_md4_context
|
||||||
|
#define lwip_md4_starts mbedtls_md4_starts
|
||||||
|
#define lwip_md4_update mbedtls_md4_update
|
||||||
|
#define lwip_md4_finish mbedtls_md4_finish
|
||||||
|
|
||||||
|
#define lwip_md5_context mbedtls_md5_context
|
||||||
|
#define lwip_md5_starts mbedtls_md5_starts
|
||||||
|
#define lwip_md5_update mbedtls_md5_update
|
||||||
|
#define lwip_md5_finish mbedtls_md5_finish
|
||||||
|
|
||||||
|
#define lwip_sha1_context mbedtls_sha1_context
|
||||||
|
#define lwip_sha1_starts mbedtls_sha1_starts
|
||||||
|
#define lwip_sha1_update mbedtls_sha1_update
|
||||||
|
#define lwip_sha1_finish mbedtls_sha1_finish
|
||||||
|
|
||||||
|
#define lwip_des_context mbedtls_des_context
|
||||||
|
#define lwip_des_setkey_enc mbedtls_des_setkey_enc
|
||||||
|
#define lwip_des_crypt_ecb mbedtls_des_crypt_ecb
|
||||||
|
|
||||||
|
#define lwip_arc4_context mbedtls_arc4_context
|
||||||
|
#define lwip_arc4_setup mbedtls_arc4_setup
|
||||||
|
#define lwip_arc4_crypt(context, buffer, length) mbedtls_arc4_crypt(context, length, buffer, buffer)
|
||||||
|
|
||||||
|
#endif /* LWIP_USE_EXTERNAL_MBEDTLS */
|
||||||
|
|
||||||
void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key);
|
void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key);
|
||||||
|
|
||||||
#endif /* PPPCRYPT_H */
|
#endif /* PPPCRYPT_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user