X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fpeap.h;h=f11312ebfc6f857681cd9dbb59a337a06752c474;hb=509f04959ad891d7f981f035ed461d51bd1f74b0;hp=fd002d2970c50a03950d16a192aa73f77b43d0e2;hpb=4e2c49755175d05f7f4a3c1c70a42d2eef9d7839;p=ppp.git diff --git a/pppd/peap.h b/pppd/peap.h index fd002d2..f11312e 100644 --- a/pppd/peap.h +++ b/pppd/peap.h @@ -1,15 +1,36 @@ /* - * Copyright (c) 2011 + * Copyright (c) 2011 Rustam Kovhaev. All rights reserved. + * Copyright (c) 2021 Eivind Næss. All rights reserved. * - * Authors: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * Rustam Kovhaev + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef PPP_PEAP_H #define PPP_PEAP_H -#define EAPT_MSCHAPV2 26 +#include "pppdconf.h" #define PEAP_PHASE_1 1 #define PEAP_PHASE_2 2 @@ -22,8 +43,6 @@ #define PEAP_CAPABILITIES_TYPE 254 #define PEAP_CAPABILITIES_LEN 12 -#define SHA_HASH_LEN 20 - #define PEAP_TLV_TYPE 12 #define PEAP_TLV_LENGTH_FIELD 56 #define PEAP_TLV_SUBTYPE_REQUEST 0 @@ -60,7 +79,21 @@ #define EAP_TLS_KEY_LEN 0x40 #define TLS_RECORD_MAX_SIZE 0x4000 -void peap_process(eap_state *esp, u_char id, u_char *inp, - int len, char *rhostname); +struct peap_state; + +/** + * Initialize the PEAP structure + */ +int peap_init(struct peap_state** psm, const char *remote_name); + +/** + * Process a PEAP packet + */ +int peap_process(eap_state *esp, u_char id, u_char *inp, int len); + +/** + * Clean up the PEAP structure + */ +void peap_finish(struct peap_state **psm); #endif /* PPP_PEAP_H */