autoselecting which PolarSSL files to use support added

This commit is contained in:
Sylvain Rochet 2012-06-01 01:10:02 +02:00
parent 8bb4ea85b8
commit a17ea13453
7 changed files with 63 additions and 32 deletions

View File

@ -1722,6 +1722,10 @@
#ifndef MSCHAP_SUPPORT
#define MSCHAP_SUPPORT 0
#endif
#if MSCHAP_SUPPORT
#undef CHAP_SUPPORT
#define CHAP_SUPPORT 1 /* MSCHAP require CHAP support */
#endif /* MSCHAP_SUPPORT */
/**
* CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
@ -1751,6 +1755,57 @@
#define MD5_SUPPORT 0
#endif
/**
* PolarSSL library, used if necessary and not previously disabled
*
*
* lwIP contains some files fetched from the latest BSD release of
* the PolarSSL project for ciphers and encryption methods we need for lwIP
* PPP support.
*
* The PolarSSL files were cleaned to contain only the necessary struct
* fields and functions needed for lwIP.
*
* The PolarSSL API was not changed at all, so if you are already using
* PolarSSL you can choose to skip the compilation of the included PolarSSL
* library into lwIP:
*
* The following defines are available for flexibility:
*
* LWIP_INCLUDED_POLARSSL_MD4 ; Use lwIP internal PolarSSL for MD4
* LWIP_INCLUDED_POLARSSL_MD5 ; Use lwIP internal PolarSSL for MD5
* LWIP_INCLUDED_POLARSSL_SHA1 ; Use lwIP internal PolarSSL for SHA1
* LWIP_INCLUDED_POLARSSL_DES ; Use lwIP internal PolarSSL for DES
*
* If set (=1), the default if required by another enabled PPP feature unless
* explicitly set to 0, using included lwIP PolarSSL.
*
* If clear (=0), using external PolarSSL.
*
* Undefined if not needed.
*
* Beware of the stack requirements which can be a lot larger if you are not
* using our cleaned PolarSSL library.
*/
#if CHAP_SUPPORT || EAP_SUPPORT
#ifndef LWIP_INCLUDED_POLARSSL_MD5
#define LWIP_INCLUDED_POLARSSL_MD5 1 /* CHAP and EAP require MD5 support */
#endif /* LWIP_INCLUDED_POLARSSL_MD5 */
#endif /* CHAP_SUPPORT || EAP_SUPPORT */
#if MSCHAP_SUPPORT
#ifndef LWIP_INCLUDED_POLARSSL_MD4
#define LWIP_INCLUDED_POLARSSL_MD4 1 /* MSCHAP require MD4 support */
#endif /* LWIP_INCLUDED_POLARSSL_MD4 */
#ifndef LWIP_INCLUDED_POLARSSL_SHA1
#define LWIP_INCLUDED_POLARSSL_SHA1 1 /* MSCHAP require SHA1 support */
#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */
#ifndef LWIP_INCLUDED_POLARSSL_DES
#define LWIP_INCLUDED_POLARSSL_DES 1 /* MSCHAP require DES support */
#endif /* LWIP_INCLUDED_POLARSSL_DES */
#endif /* MSCHAP_SUPPORT */
/*
* Timeouts
*/

View File

@ -1,26 +0,0 @@
#ifndef CBCP_H
#define CBCP_H
typedef struct cbcp_state {
int us_unit; /* Interface unit number */
u_char us_id; /* Current id */
u_char us_allowed;
int us_type;
char *us_number; /* Telefone Number */
} cbcp_state;
extern cbcp_state cbcp[];
extern struct protent cbcp_protent;
#define CBCP_MINLEN 4
#define CBCP_REQ 1
#define CBCP_RESP 2
#define CBCP_ACK 3
#define CB_CONF_NO 1
#define CB_CONF_USER 2
#define CB_CONF_ADMIN 3
#define CB_CONF_LIST 4
#endif

View File

@ -73,7 +73,6 @@
*****************************************************************************/
#include "lwip/opt.h"
#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */
#include "polarssl/md5.h"

View File

@ -78,7 +78,6 @@
#define MAGIC_H
#include "lwip/opt.h"
#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */
/***********************

View File

@ -1,2 +0,0 @@
#define VERSION "2.4.5"
#define DATE "17 November 2009"

View File

@ -31,8 +31,7 @@
*/
#include "lwip/opt.h"
/* FIXME: dont include if not needed */
#if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not necessary */
#include "pppd.h"
#include "pppcrypt.h"
@ -62,3 +61,5 @@ void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) {
des_key[6] = pppcrypt_get_7bits(key, 42);
des_key[7] = pppcrypt_get_7bits(key, 49);
}
#endif /* PPP_SUPPORT && MSCHAP_SUPPORT */

View File

@ -30,9 +30,14 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "lwip/opt.h"
#if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */
#ifndef PPPCRYPT_H
#define PPPCRYPT_H
void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key);
#endif /* PPPCRYPT_H */
#endif /* PPP_SUPPORT && MSCHAP_SUPPORT */