[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809
vikrama
vikrama at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:27 UTC 2010
The following commit has been merged in the upstream branch:
commit e0c9d5b12a041506ae058d47eaf57f566eb3cda3
Author: vikrama <vikrama at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Mon Jul 5 22:25:20 2010 +0000
Bug Fix:
When a 64 bit hex password is entered, wpa_supplicant fails with the
error:
"wpa_supplicant (pid) Line 0: Invalid passphrase length 64 (expected:
8..63)"
The fix is to not quote 64 char long hexadecimal passwords. Tested
dd-wrt on a 64 char hex password.
git-svn-id: http://zxing.googlecode.com/svn/trunk@1468 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/src/com/google/zxing/client/android/wifi/NetworkUtil.java b/android/src/com/google/zxing/client/android/wifi/NetworkUtil.java
index 9a84d43..b3740c8 100644
--- a/android/src/com/google/zxing/client/android/wifi/NetworkUtil.java
+++ b/android/src/com/google/zxing/client/android/wifi/NetworkUtil.java
@@ -46,7 +46,7 @@ final class NetworkUtil {
int lastPos = string.length() - 1;
if (lastPos < 0 || (string.charAt(0) == '"' && string.charAt(lastPos) == '"')) {
return string;
- }
+ }
return '\"' + string + '\"';
}
@@ -59,7 +59,7 @@ final class NetworkUtil {
if (!(c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f')) {
return false;
}
- }
+ }
return true;
}
diff --git a/android/src/com/google/zxing/client/android/wifi/WifiActivity.java b/android/src/com/google/zxing/client/android/wifi/WifiActivity.java
index f18282d..bdeeb4c 100644
--- a/android/src/com/google/zxing/client/android/wifi/WifiActivity.java
+++ b/android/src/com/google/zxing/client/android/wifi/WifiActivity.java
@@ -124,12 +124,22 @@ public class WifiActivity extends Activity {
// Adding a WPA or WPA2 network
private int changeNetworkWPA(NetworkSetting input) {
WifiConfiguration config = changeNetworkCommon(input);
- config.preSharedKey = NetworkUtil.convertToQuotedString(input.getPassword());
+ final String pass = input.getPassword();
+ // Hex passwords that are 64 bits long are not to be quoted.
+ if (pass.matches("[0-9A-Fa-f]{64}")){
+ Log.d(TAG, "A 64 bit hex password entered.");
+ config.preSharedKey = pass;
+ } else {
+ Log.d(TAG, "A normal password entered: I am quoting it.");
+ config.preSharedKey = NetworkUtil.convertToQuotedString(pass);
+ }
config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
- config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
// For WPA
config.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
// For WPA2
+ config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
+ config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
+ config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
return requestNetworkChange(config);
}
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list