]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Allow minor version differences in Version attribute check
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 6 Feb 2009 12:19:59 +0000 (14:19 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 6 Feb 2009 12:19:59 +0000 (14:19 +0200)
Version attribute processing details are not described in the WPS spec,
but it is safer to allow minor version to change and only refuse to
process the message if major version is different from ours. This
matches with the behavior used in the Intel reference implementation.

src/wps/wps_i.h

index b5b1232094a883f9ac4d1c475563c508634df2a0..85adf28d4f62ddd2bc12194ed6ed1f2b8bf13872 100644 (file)
@@ -241,7 +241,8 @@ enum wps_process_res wps_registrar_process_msg(struct wps_data *wps,
 
 static inline int wps_version_supported(const u8 *version)
 {
-       return version && *version == WPS_VERSION;
+       /* Require major version match, but allow minor version differences */
+       return version && (*version & 0xf0) == (WPS_VERSION & 0xf0);
 }
 
 #endif /* WPS_I_H */