X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmppe.h;h=2684a7f6fe85801b44eb978faa5a88567a040ba5;hp=98a89d3043e77463adc3140ee0ca48c47a661998;hb=HEAD;hpb=d706c95906d996534f13632a747af5dc617f306e diff --git a/pppd/mppe.h b/pppd/mppe.h index 98a89d3..376eb62 100644 --- a/pppd/mppe.h +++ b/pppd/mppe.h @@ -22,7 +22,7 @@ * 4. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras - * ". + * ". * * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY @@ -32,8 +32,15 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef __MPPE_H__ -#define __MPPE_H__ +#ifndef PPP_MPPE_H +#define PPP_MPPE_H + +#include "pppdconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + #define MPPE_PAD 4 /* MPPE growth per frame */ #define MPPE_MAX_KEY_SIZE 32 /* Largest key length */ @@ -70,7 +77,7 @@ /* Build a CI from mppe opts (see RFC 3078) */ #define MPPE_OPTS_TO_CI(opts, ci) \ do { \ - u_char *ptr = ci; /* u_char[4] */ \ + unsigned char *ptr = ci; /* unsigned char[4] */ \ \ /* H bit */ \ if (opts & MPPE_OPT_STATEFUL) \ @@ -92,7 +99,7 @@ /* The reverse of the above */ #define MPPE_CI_TO_OPTS(ci, opts) \ do { \ - u_char *ptr = ci; /* u_char[4] */ \ + unsigned char *ptr = ci; /* unsigned char[4] */ \ \ opts = 0; \ \ @@ -124,20 +131,7 @@ } while (/* CONSTCOND */ 0) -#if MPPE - -/* - * NOTE: - * Access to these variables directly is discuraged. Please - * change your code to use below accessor functions. - */ - -/* The key material generated which is used for MPPE send key */ -extern u_char mppe_send_key[MPPE_MAX_KEY_SIZE]; -/* The key material generated which is used for MPPE recv key */ -extern u_char mppe_recv_key[MPPE_MAX_KEY_SIZE]; -/* Keys are set if value is non-zero */ -extern int mppe_keys_set; +#if PPP_WITH_MPPE /* These values are the RADIUS attribute values--see RFC 2548. */ #define MPPE_ENC_POL_ENC_ALLOWED 1 @@ -152,17 +146,17 @@ void mppe_set_enc_types (int policy, int types); * Set the MPPE send and recv keys. NULL values for keys are ignored * and input values are cleared to avoid leaving them on the stack */ -void mppe_set_keys(u_char *send_key, u_char *recv_key, int keylen); +void mppe_set_keys(unsigned char *send_key, unsigned char *recv_key, int keylen); /* * Get the MPPE recv key */ -int mppe_get_recv_key(u_char *recv_key, int length); +int mppe_get_recv_key(unsigned char *recv_key, int length); /* * Get the MPPE send key */ -int mppe_get_send_key(u_char *send_key, int length); +int mppe_get_send_key(unsigned char *send_key, int length); /* * Clear the MPPE keys @@ -177,13 +171,18 @@ bool mppe_keys_isset(void); /* * Set mppe_xxxx_key from NT Password Hash Hash (MSCHAPv1), see RFC3079 */ -void mppe_set_chapv1(u_char *rchallenge, u_char PasswordHashHash[MD4_SIGNATURE_SIZE]); +void mppe_set_chapv1(unsigned char *rchallenge, unsigned char *PasswordHashHash); /* * Set the mppe_xxxx_key from MS-CHAP-v2 credentials, see RFC3079 */ -void mppe_set_chapv2(u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[MS_AUTH_NTRESP_LEN], int IsServer); +void mppe_set_chapv2(unsigned char *PasswordHashHash, + unsigned char *NTResponse, int IsServer); + +#endif // #ifdef PPP_WITH_MPPE + +#ifdef __cplusplus +} +#endif -#endif // #ifdef MPPE -#endif // #ifdef __MPPE_H__ +#endif // #ifdef PPP_MPPE_H