~ubuntu-branches/ubuntu/vivid/wpasupplicant/vivid

« back to all changes in this revision

Viewing changes to eap_vendor_test.c

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.1.5 upstream) (3 etch)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061005080401-r8lqlix4390yos7b
Tags: 0.5.5-2
* Update madwifi headers to latest SVN. (Closes: #388316)
* Remove failed attempt at action locking. [debian/functions.sh,
  debian/wpa_action.sh]
* Add hysteresis checking functions, to avoid "event loops" while
  using wpa-roam. [debian/functions.sh, debian/wpa_action.sh]
* Change of co-maintainer email address.
* Add ishex() function to functions.sh to determine wpa-psk value type in
  plaintext or hex. This effectively eliminates the need for the bogus and
  somewhat confusing wpa-passphrase contruct specific to our scripts and
  allows wpa-psk to work with either a 8 to 63 character long plaintext
  string or 64 character long hex string.
* Adjust README.modes to not refer to the redundant wpa-passphrase stuff.
* Add big fat NOTE about acceptable wpa-psk's to top of example gallery.
* Strip surrounding quotes from wpa-ssid if present, instead of just whining
  about them.
* Update email address in copyright blurb of functions.sh, ifupdown.sh and
  wpa_action.sh.  

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * EAP peer method: Test method for vendor specific (expanded) EAP type
3
 
 * Copyright (c) 2005, Jouni Malinen <jkmaline@cc.hut.fi>
 
3
 * Copyright (c) 2005-2006, Jouni Malinen <jkmaline@cc.hut.fi>
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License version 2 as
21
21
#include "common.h"
22
22
#include "eap_i.h"
23
23
#include "wpa_supplicant.h"
 
24
#include "eloop.h"
24
25
 
25
26
 
26
27
#define EAP_VENDOR_ID 0xfffefd
27
28
#define EAP_VENDOR_TYPE 0xfcfbfaf9
28
29
 
29
30
 
 
31
/* #define TEST_PENDING_REQUEST */
 
32
 
30
33
struct eap_vendor_test_data {
31
34
        enum { INIT, CONFIRM, SUCCESS } state;
 
35
        int first_try;
32
36
};
33
37
 
34
38
 
39
43
        if (data == NULL)
40
44
                return NULL;
41
45
        data->state = INIT;
 
46
        data->first_try = 1;
42
47
        return data;
43
48
}
44
49
 
50
55
}
51
56
 
52
57
 
 
58
#ifdef TEST_PENDING_REQUEST
 
59
static void eap_vendor_ready(void *eloop_ctx, void *timeout_ctx)
 
60
{
 
61
        struct eap_sm *sm = eloop_ctx;
 
62
        wpa_printf(MSG_DEBUG, "EAP-VENDOR-TEST: Ready to re-process pending "
 
63
                   "request");
 
64
        eap_notify_pending(sm);
 
65
}
 
66
#endif /* TEST_PENDING_REQUEST */
 
67
 
 
68
 
53
69
static u8 * eap_vendor_test_process(struct eap_sm *sm, void *priv,
54
70
                                    struct eap_method_ret *ret,
55
71
                                    const u8 *reqData, size_t reqDataLen,
90
106
                return NULL;
91
107
        }
92
108
 
 
109
        if (data->state == CONFIRM) {
 
110
#ifdef TEST_PENDING_REQUEST
 
111
                if (data->first_try) {
 
112
                        data->first_try = 0;
 
113
                        wpa_printf(MSG_DEBUG, "EAP-VENDOR-TEST: Testing "
 
114
                                   "pending request");
 
115
                        ret->ignore = TRUE;
 
116
                        eloop_register_timeout(1, 0, eap_vendor_ready, sm,
 
117
                                               NULL);
 
118
                        return NULL;
 
119
                }
 
120
#endif /* TEST_PENDING_REQUEST */
 
121
        }
 
122
 
93
123
        ret->ignore = FALSE;
94
124
        req = (const struct eap_hdr *) reqData;
95
125