• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/hostapd/0005-WPS-Reject-a-Credential-with-invalid-passphrase.patch
Baruch SiachBaruch Siach committed 1297fc980b703 May 2016
Raw file
Source viewDiff to previous
+       wpa_printf(MSG_INFO, "WPS: Reject credential with invalid WPA/WPA2-Personal passphrase");
 
1
From ecbb0b3dc122b0d290987cf9c84010bbe53e1022 Mon Sep 17 00:00:00 2001
2
From: Jouni Malinen <jouni@qca.qualcomm.com>
3
Date: Fri, 4 Mar 2016 17:20:18 +0200
4
Subject: [PATCH] WPS: Reject a Credential with invalid passphrase
5
​
6
WPA/WPA2-Personal passphrase is not allowed to include control
7
characters. Reject a Credential received from a WPS Registrar both as
8
STA (Credential) and AP (AP Settings) if the credential is for WPAPSK or
9
WPA2PSK authentication type and includes an invalid passphrase.
10
​
11
This fixes an issue where hostapd or wpa_supplicant could have updated
12
the configuration file PSK/passphrase parameter with arbitrary data from
13
an external device (Registrar) that may not be fully trusted. Should
14
such data include a newline character, the resulting configuration file
15
could become invalid and fail to be parsed.
16
​
17
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
18
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
19
---
20
Patch status: upstream (ecbb0b3dc122b0d290987cf9c84010bbe53e1022)
21
​
22
 src/utils/common.c         | 12 ++++++++++++
23
 src/utils/common.h         |  1 +
24
 src/wps/wps_attr_process.c | 10 ++++++++++
25
 3 files changed, 23 insertions(+)
26
​
27
diff --git a/src/utils/common.c b/src/utils/common.c
28
index 450e2c6519ba..27b7c02de10b 100644
29
--- a/src/utils/common.c
30
+++ b/src/utils/common.c
31
@@ -697,6 +697,18 @@ int is_hex(const u8 *data, size_t len)
32
 }
33
 
34
 
35
+int has_ctrl_char(const u8 *data, size_t len)
36
+{
37
+   size_t i;
38
+
39
+   for (i = 0; i < len; i++) {
40
+       if (data[i] < 32 || data[i] == 127)
41
+           return 1;
42
+   }
43
+   return 0;
44
+}
45
+
46
+
47
 size_t merge_byte_arrays(u8 *res, size_t res_len,
48
             const u8 *src1, size_t src1_len,
49
             const u8 *src2, size_t src2_len)
50
diff --git a/src/utils/common.h b/src/utils/common.h
51
index 701dbb236ed5..a97224070385 100644
52
--- a/src/utils/common.h
53
+++ b/src/utils/common.h
54
@@ -488,6 +488,7 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
55
 
56
 char * wpa_config_parse_string(const char *value, size_t *len);
57
 int is_hex(const u8 *data, size_t len);
58
+int has_ctrl_char(const u8 *data, size_t len);
59
 size_t merge_byte_arrays(u8 *res, size_t res_len,
60
             const u8 *src1, size_t src1_len,
61
             const u8 *src2, size_t src2_len);
62
diff --git a/src/wps/wps_attr_process.c b/src/wps/wps_attr_process.c
63
index eadb22fe2e78..e8c4579309ab 100644
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.