Commit graph

792 commits

Author SHA1 Message Date
Jouni Malinen
81c85c069a Convert TLS wrapper to use struct wpabuf
This converts tls_connection_handshake(),
tls_connection_server_handshake(), tls_connection_encrypt(), and
tls_connection_decrypt() to use struct wpa_buf to allow higher layer
code to be cleaned up with consistent struct wpabuf use.
2009-12-20 18:17:55 +02:00
Jouni Malinen
94c3e91fc5 Add empty FIPS PRF wrapper for CryptoAPI 2009-12-20 18:14:20 +02:00
Jouni Malinen
8f431bc808 Add empty crypto_mod_exp() wrapper for CryptoAPI. 2009-12-20 18:13:42 +02:00
Jouni Malinen
de979ef18c Fix MinGW build: CertCreateCertificateContext() is now known 2009-12-20 18:10:10 +02:00
Jouni Malinen
f266d1a162 eloop_win: Fix build after eloop user_data removal 2009-12-20 17:48:55 +02:00
Jouni Malinen
f52ab9e6b0 Fix lastReqData freeing to use wpabuf_free() 2009-12-20 17:22:25 +02:00
Jouni Malinen
eeb04821ad wpabuf: Add WPA_TRACE code to validate correct freeing of wpabuf
Use an extra header to move the returned pointer to break os_free()
or free() of the returned value and verify that the correct magic
is present when freeing or resizing the wpabuf. Show backtrace on
invalid wpabuf use.
2009-12-20 13:11:31 +02:00
Jouni Malinen
859db534bf wpabuf: Allow wpabuf_resize(NULL, len) to be used
This matches with realloc() usage, i.e., allocate a new buffer if no
buffer was specified.
2009-12-20 12:52:54 +02:00
Jouni Malinen
c479e41f53 EAP-FAST server: Piggyback Phase 2 start with end of Phase 1
If Finished message from peer has been received before the server
Finished message, start Phase 2 with the same message to avoid extra
roundtrip when the peer does not have anything to send after the server
Finished message.
2009-12-20 11:39:45 +02:00
Jouni Malinen
1a1bf008cb WPS ER: Delay wpa_supplicant termination to allow unsubscription
Instead of forcefully deinitializing ER immediately, give it some
time to complete unsubscription and call eloop_terminate() only once
ER code has completed its work.
2009-12-19 23:47:54 +02:00
Jouni Malinen
e46338fc76 WPS ER: Unsubscribe from AP events whenever removing the AP entry
Store the subscription identifier during subscription process and use
this to unsubscribe from events when removing the AP.
2009-12-19 23:20:22 +02:00
Jouni Malinen
187533a4c5 WPS: Convert Registrar PIN list to use struct dl_list 2009-12-19 22:26:55 +02:00
Jouni Malinen
96f5234735 WPS ER: Convert lists to use struct dl_list 2009-12-19 22:14:06 +02:00
Jouni Malinen
45767a9597 WPS: Remove unused net_if copy 2009-12-19 21:58:00 +02:00
Jouni Malinen
eeb49f991b driver_test: Use OS wrappers consistently for memory allocation 2009-12-19 21:49:51 +02:00
Jouni Malinen
fb4baa688b Add memory allocation analyzer to verify OS wrapper use
WPA_TRACE=y builds will now verify that memory allocation in done
consistently using os_{zalloc,malloc,realloc,strdup,free} (i.e., no
mixing of os_* functions and unwrapper functions). In addition, some
common memory allocation issues (double-free, memory leaks, etc.) are
detected automatically.
2009-12-19 21:47:56 +02:00
Jouni Malinen
f45fb672cc eloop: Do not use printf() or fprintf() directly 2009-12-19 20:27:55 +02:00
Jouni Malinen
eaa3f04b97 eloop: Use struct dl_list for timeouts 2009-12-19 20:26:22 +02:00
Jouni Malinen
0456ea16d8 eloop: Remove global user data pointer
This is not really needed since all signal handlers can use a context
pointer provided during signal handler registration.
2009-12-19 19:22:16 +02:00
Jouni Malinen
2988796257 Fix RADIUS client to cancel IPv6 socket read notifications 2009-12-19 18:52:42 +02:00
Jouni Malinen
f481459f5e Fix RADIUS server deinit to cancel timeout for session removal 2009-12-19 18:52:15 +02:00
Jouni Malinen
930f704aac Add backtrace support for debugging
WPA_TRACE=y can now be used to enable internal backtrace support that
will provide more details about implementation errors, e.g., when some
resources are not released correctly. In addition, this will print out
a backtrace automatically if SIGSEGV is received.
2009-12-19 18:40:54 +02:00
Jouni Malinen
1489e11a94 Make struct radius_msg private to radius.c
This is internal data structure for RADIUS message handling and
external code should not touch it directly.
2009-12-19 17:26:57 +02:00
Jouni Malinen
aa235d2ef7 Convert RADIUS message code to use wpabuf internally 2009-12-19 17:12:07 +02:00
Jouni Malinen
9e7245bdb4 Change radius_msg_free() to free the buffer
Since all callers were freeing the buffer immediately anyway, move
this operation into radius_msg_free() to reduce code size.
2009-12-19 16:34:41 +02:00
Jouni Malinen
d94f86d85e RADIUS message initialization cleanup 2009-12-19 16:20:53 +02:00
Jouni Malinen
d04a96b0d6 Add documentation for RADIUS code and some minor cleanup 2009-12-19 16:13:06 +02:00
Jouni Malinen
a9f92c487f WPS: Remove parent pointer from advertisement state machine 2009-12-19 14:51:36 +02:00
Jouni Malinen
158aff0035 WPS: Convert struct advertisement_state_machine to use struct dl_list 2009-12-19 14:46:52 +02:00
Jouni Malinen
ea8f09acb2 WPS: Remove unused struct subscr_addr parent pointer 2009-12-19 14:30:49 +02:00
Jouni Malinen
f1de40f728 WPS: Convert struct wps_event_ to use struct dl_list 2009-12-19 14:29:01 +02:00
Jouni Malinen
ec32c29471 WPS: Convert struct subscription to use struct dl_list 2009-12-19 14:15:43 +02:00
Jouni Malinen
f98b440c47 WPS: Convert struct subscr_addr to use dl_list 2009-12-19 13:47:00 +02:00
Jouni Malinen
dacf478352 Add generic doubly-linked list implementation 2009-12-19 13:43:25 +02:00
Masashi Honma
1c9c03d08d Mac OS X: Fix driver_osx.c build 2009-12-18 21:25:21 +02:00
Snowpin Lee
649b28f9e6 ralink: Add WPS support 2009-12-18 21:04:11 +02:00
Jouni Malinen
a6fc4f3c82 Change Linux driver wrappers to use shared netlink receive code 2009-12-18 18:24:13 +02:00
Jouni Malinen
62d680c3ca netlink: Move more of the newlink/dellink parsing into shared code 2009-12-18 17:49:07 +02:00
Jouni Malinen
f37cf89ccb netlink: Use NLMSG_OK and NLMSG_NEXT macros 2009-12-18 17:22:35 +02:00
Jouni Malinen
08063178fb nl80211/wext: Share netlink new/del link event receive code 2009-12-18 17:11:54 +02:00
Jouni Malinen
e2d02c29b5 driver_nl80211/wext: Share netlink operstate send function
As an initial step in sharing netlink helper functions among driver
wrappers, create a new file for netlink code and move operstate send
function there.
2009-12-18 16:35:33 +02:00
Jouni Malinen
3b31db5199 Fix netlink payload length calculation
nlmsghdr length needs to be removed from payload length. [Bug 341]
2009-12-18 16:14:54 +02:00
Jouni Malinen
67f0112d83 driver_test: Fix AP mode to initialize bss_ctx for first interface 2009-12-16 16:01:54 +02:00
Jouni Malinen
cdc7f66bda Fix driver_nl80211.c build without CONFIG_CLIENT_MLME 2009-12-14 21:13:58 +02:00
Jouni Malinen
d986b1b6c1 OpenSSL: Silence "Failed to read possible Application Data"
This message from tls_connection_handshake() is not really an error in
most cases, so do not show it if there was indeed no Application Data
available (which is a normal scenario and not an indication of any
error).
2009-12-14 16:09:20 +02:00
Jouni Malinen
b57e086cc1 Mark management frame processing functions to use const buffer 2009-12-13 23:25:30 +02:00
Jouni Malinen
ba091c06c5 Mark ieee802_11_parse_elems() input and parsed elems const
In addition, re-order IE pointers and u8 length so that the shorter
length fields are together to allow compiler to optimize structure size.
2009-12-13 23:11:11 +02:00
Jouni Malinen
f8b1f69561 Use generic driver events for TX status and RX reporting
Replace driver wrapper calls to hostapd_tx_status(),
hostapd_rx_from_unknown_sta(), hostapd_mgmt_rx(), and
hostapd_mgmt_tx_cb() with new generic driver events
EVENT_TX_STATUS, EVENT_RX_FROM_UNKNOWN, and EVENT_RX_MGMT.

This cleans up lot of the driver wrapper code to be less dependent
on whether it is being used within wpa_supplicant AP mode or hostapd.
2009-12-13 23:05:39 +02:00
Jouni Malinen
1b648c7e1a nl80211: Remove some of the unnecessary conditional compilation
These functions can be built for both hostapd and wpa_supplicant.
2009-12-13 21:49:53 +02:00
Jouni Malinen
fcf0f87d97 Replace hostapd_button_pushed() with generic driver event 2009-12-13 21:21:10 +02:00