Index: head/net/hostapd/Makefile =================================================================== --- head/net/hostapd/Makefile (revision 422687) +++ head/net/hostapd/Makefile (revision 422688) @@ -1,38 +1,37 @@ # Created by: Craig Leres # $FreeBSD$ PORTNAME= hostapd -PORTVERSION= 2.4 -PORTREVISION= 2 +PORTVERSION= 2.5 CATEGORIES= net MASTER_SITES= http://w1.fi/releases/ MAINTAINER= leres@ee.lbl.gov COMMENT= IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator LICENSE= BSD3CLAUSE USES= cpe gmake ssl CPE_VENDOR= w1.f1 BUILD_WRKSRC= ${WRKSRC}/hostapd CONFIGURE_ARGS= --with-ssl-dir=${OPENSSLBASE} PLIST_FILES= sbin/hostapd sbin/hostapd_cli man/man1/hostapd_cli.1.gz \ man/man8/hostapd.8.gz post-patch: @${REINPLACE_CMD} -e 's|@$$(E) " CC " $$<|@$$(E) " $$(CC) " $$<|' \ ${BUILD_WRKSRC}/Makefile @${SED} -e 's|@PREFIX@|${PREFIX}|g' ${FILESDIR}/config \ >> ${WRKSRC}/hostapd/.config do-install: ${INSTALL_PROGRAM} ${WRKSRC}/hostapd/hostapd ${STAGEDIR}${PREFIX}/sbin ${INSTALL_PROGRAM} ${WRKSRC}/hostapd/hostapd_cli \ ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd_cli.1 \ ${STAGEDIR}${MANPREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd.8 \ ${STAGEDIR}${MANPREFIX}/man/man8 .include Index: head/net/hostapd/distinfo =================================================================== --- head/net/hostapd/distinfo (revision 422687) +++ head/net/hostapd/distinfo (revision 422688) @@ -1,2 +1,3 @@ -SHA256 (hostapd-2.4.tar.gz) = 6fe0eb6bd1c9cbd24952ece8586b6f7bd14ab358edfda99794e79b9b9dbd657f -SIZE (hostapd-2.4.tar.gz) = 1658872 +TIMESTAMP = 1467776602 +SHA256 (hostapd-2.5.tar.gz) = 8e272d954dc0d7026c264b79b15389ec2b2c555b32970de39f506b9f463ec74a +SIZE (hostapd-2.5.tar.gz) = 1720783 Index: head/net/hostapd/files/patch-src_drivers_driver__bsd.c =================================================================== --- head/net/hostapd/files/patch-src_drivers_driver__bsd.c (revision 422687) +++ head/net/hostapd/files/patch-src_drivers_driver__bsd.c (nonexistent) @@ -1,14 +0,0 @@ ---- src/drivers/driver_bsd.c.orig 2015-03-15 17:30:39 UTC -+++ src/drivers/driver_bsd.c -@@ -623,7 +623,11 @@ rtbuf_len(void) - static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, - int reason_code); - -+#ifdef __DragonFly__ -+const char * -+#else - static const char * -+#endif - ether_sprintf(const u8 *addr) - { - static char buf[sizeof(MACSTR)]; Property changes on: head/net/hostapd/files/patch-src_drivers_driver__bsd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/hostapd/files/patch-src_eap__server_eap__server__pwd.c =================================================================== --- head/net/hostapd/files/patch-src_eap__server_eap__server__pwd.c (revision 422687) +++ head/net/hostapd/files/patch-src_eap__server_eap__server__pwd.c (nonexistent) @@ -1,60 +0,0 @@ ---- src/eap_server/eap_server_pwd.c.orig 2015-03-15 17:30:39 UTC -+++ src/eap_server/eap_server_pwd.c -@@ -634,9 +634,21 @@ eap_pwd_process_commit_resp(struct eap_s - BIGNUM *x = NULL, *y = NULL, *cofactor = NULL; - EC_POINT *K = NULL, *point = NULL; - int res = 0; -+ size_t prime_len, order_len; - - wpa_printf(MSG_DEBUG, "EAP-pwd: Received commit response"); - -+ prime_len = BN_num_bytes(data->grp->prime); -+ order_len = BN_num_bytes(data->grp->order); -+ -+ if (payload_len != 2 * prime_len + order_len) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Commit payload length %u (expected %u)", -+ (unsigned int) payload_len, -+ (unsigned int) (2 * prime_len + order_len)); -+ goto fin; -+ } -+ - if (((data->peer_scalar = BN_new()) == NULL) || - ((data->k = BN_new()) == NULL) || - ((cofactor = BN_new()) == NULL) || -@@ -752,6 +764,13 @@ eap_pwd_process_confirm_resp(struct eap_ - u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr; - int offset; - -+ if (payload_len != SHA256_MAC_LEN) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Confirm payload length %u (expected %u)", -+ (unsigned int) payload_len, SHA256_MAC_LEN); -+ goto fin; -+ } -+ - /* build up the ciphersuite: group | random_function | prf */ - grp = htons(data->group_num); - ptr = (u8 *) &cs; -@@ -901,11 +920,21 @@ static void eap_pwd_process(struct eap_s - * the first fragment has a total length - */ - if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) { -+ if (len < 2) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Frame too short to contain Total-Length field"); -+ return; -+ } - tot_len = WPA_GET_BE16(pos); - wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments, total " - "length = %d", tot_len); - if (tot_len > 15000) - return; -+ if (data->inbuf) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Unexpected new fragment start when previous fragment is still in use"); -+ return; -+ } - data->inbuf = wpabuf_alloc(tot_len); - if (data->inbuf == NULL) { - wpa_printf(MSG_INFO, "EAP-pwd: Out of memory to " Property changes on: head/net/hostapd/files/patch-src_eap__server_eap__server__pwd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/hostapd/files/patch-src_ap_wmm.c =================================================================== --- head/net/hostapd/files/patch-src_ap_wmm.c (revision 422687) +++ head/net/hostapd/files/patch-src_ap_wmm.c (nonexistent) @@ -1,12 +0,0 @@ ---- src/ap/wmm.c.orig 2015-03-15 17:30:39 UTC -+++ src/ap/wmm.c -@@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_d - return; - } - -+ if (left < 0) -+ return; /* not a valid WMM Action frame */ -+ - /* extract the tspec info element */ - if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { - hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, Property changes on: head/net/hostapd/files/patch-src_ap_wmm.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/hostapd/files/patch-src_eap__peer_eap__pwd.c =================================================================== --- head/net/hostapd/files/patch-src_eap__peer_eap__pwd.c (revision 422687) +++ head/net/hostapd/files/patch-src_eap__peer_eap__pwd.c (nonexistent) @@ -1,77 +0,0 @@ ---- src/eap_peer/eap_pwd.c.orig 2015-03-15 17:30:39 UTC -+++ src/eap_peer/eap_pwd.c -@@ -301,6 +301,23 @@ eap_pwd_perform_commit_exchange(struct e - BIGNUM *mask = NULL, *x = NULL, *y = NULL, *cofactor = NULL; - u16 offset; - u8 *ptr, *scalar = NULL, *element = NULL; -+ size_t prime_len, order_len; -+ -+ if (data->state != PWD_Commit_Req) { -+ ret->ignore = TRUE; -+ goto fin; -+ } -+ -+ prime_len = BN_num_bytes(data->grp->prime); -+ order_len = BN_num_bytes(data->grp->order); -+ -+ if (payload_len != 2 * prime_len + order_len) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Commit payload length %u (expected %u)", -+ (unsigned int) payload_len, -+ (unsigned int) (2 * prime_len + order_len)); -+ goto fin; -+ } - - if (((data->private_value = BN_new()) == NULL) || - ((data->my_element = EC_POINT_new(data->grp->group)) == NULL) || -@@ -500,6 +517,18 @@ eap_pwd_perform_confirm_exchange(struct - u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr; - int offset; - -+ if (data->state != PWD_Confirm_Req) { -+ ret->ignore = TRUE; -+ goto fin; -+ } -+ -+ if (payload_len != SHA256_MAC_LEN) { -+ wpa_printf(MSG_INFO, -+ "EAP-pwd: Unexpected Confirm payload length %u (expected %u)", -+ (unsigned int) payload_len, SHA256_MAC_LEN); -+ goto fin; -+ } -+ - /* - * first build up the ciphersuite which is group | random_function | - * prf -@@ -783,11 +812,23 @@ eap_pwd_process(struct eap_sm *sm, void - * if it's the first fragment there'll be a length field - */ - if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) { -+ if (len < 2) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Frame too short to contain Total-Length field"); -+ ret->ignore = TRUE; -+ return NULL; -+ } - tot_len = WPA_GET_BE16(pos); - wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments whose " - "total length = %d", tot_len); - if (tot_len > 15000) - return NULL; -+ if (data->inbuf) { -+ wpa_printf(MSG_DEBUG, -+ "EAP-pwd: Unexpected new fragment start when previous fragment is still in use"); -+ ret->ignore = TRUE; -+ return NULL; -+ } - data->inbuf = wpabuf_alloc(tot_len); - if (data->inbuf == NULL) { - wpa_printf(MSG_INFO, "Out of memory to buffer " -@@ -873,6 +914,7 @@ eap_pwd_process(struct eap_sm *sm, void - /* - * we have output! Do we need to fragment it? - */ -+ lm_exch = EAP_PWD_GET_EXCHANGE(lm_exch); - len = wpabuf_len(data->outbuf); - if ((len + EAP_PWD_HDR_SIZE) > data->mtu) { - resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_PWD, data->mtu, Property changes on: head/net/hostapd/files/patch-src_eap__peer_eap__pwd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/hostapd/files/patch-src_wps_httpread.c =================================================================== --- head/net/hostapd/files/patch-src_wps_httpread.c (revision 422687) +++ head/net/hostapd/files/patch-src_wps_httpread.c (nonexistent) @@ -1,16 +0,0 @@ ---- src/wps/httpread.c.orig 2015-03-15 17:30:39 UTC -+++ src/wps/httpread.c -@@ -533,6 +533,13 @@ static void httpread_read_handler(int sd - if (!isxdigit(*cbp)) - goto bad; - h->chunk_size = strtoul(cbp, NULL, 16); -+ if (h->chunk_size < 0 || -+ h->chunk_size > h->max_bytes) { -+ wpa_printf(MSG_DEBUG, -+ "httpread: Invalid chunk size %d", -+ h->chunk_size); -+ goto bad; -+ } - /* throw away chunk header - * so we have only real data - */ Property changes on: head/net/hostapd/files/patch-src_wps_httpread.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/hostapd/files/patch-src_utils_os.h =================================================================== --- head/net/hostapd/files/patch-src_utils_os.h (nonexistent) +++ head/net/hostapd/files/patch-src_utils_os.h (revision 422688) @@ -0,0 +1,17 @@ +--- src/utils/os.h.orig 2016-09-17 20:36:13 UTC ++++ src/utils/os.h +@@ -246,12 +246,14 @@ char * os_readfile(const char *name, siz + */ + int os_file_exists(const char *fname); + ++#ifndef __FreeBSD__ + /** + * os_fdatasync - Sync a file's (for a given stream) state with storage device + * @stream: the stream to be flushed + * Returns: 0 if the operation succeeded or -1 on failure + */ + int os_fdatasync(FILE *stream); ++#endif + + /** + * os_zalloc - Allocate and zero memory Property changes on: head/net/hostapd/files/patch-src_utils_os.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/hostapd/files/patch-src_utils_os__unix.c =================================================================== --- head/net/hostapd/files/patch-src_utils_os__unix.c (nonexistent) +++ head/net/hostapd/files/patch-src_utils_os__unix.c (revision 422688) @@ -0,0 +1,18 @@ +--- src/utils/os_unix.c.orig 2015-09-27 19:02:05 UTC ++++ src/utils/os_unix.c +@@ -442,6 +442,7 @@ int os_file_exists(const char *fname) + } + + ++#ifndef __FreeBSD__ + int os_fdatasync(FILE *stream) + { + if (!fflush(stream)) { +@@ -459,6 +460,7 @@ int os_fdatasync(FILE *stream) + + return -1; + } ++#endif + + + #ifndef WPA_TRACE Property changes on: head/net/hostapd/files/patch-src_utils_os__unix.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property