Closed
Bug 728636
Opened 14 years ago
Closed 14 years ago
Conversion of email address to account should lowercase
Categories
(Firefox for Android Graveyard :: Android Sync, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla13
People
(Reporter: rnewman, Assigned: rnewman)
Details
We only lowercase the output.
public static String usernameFromAccount(String account) throws NoSuchAlgorithmException, UnsupportedEncodingException {
if (account == null || account.equals("")) {
throw new IllegalArgumentException("No account name provided.");
}
if (account.matches("^[A-Za-z0-9._-]+$")) {
return account;
}
return Utils.sha1Base32(account);
}
public static byte[] sha1(String utf8)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
return sha1.digest(utf8.getBytes("UTF-8"));
}
public static String sha1Base32(String utf8)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
return new Base32().encodeAsString(sha1(utf8)).toLowerCase();
}
This, of course, will b0rk setup for anyone who capitalizes their email address (or whose Android keyboard does it for them).
| Assignee | ||
Comment 1•14 years ago
|
||
| Assignee | ||
Comment 2•14 years ago
|
||
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Comment 3•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Updated•13 years ago
|
Product: Mozilla Services → Android Background Services
Updated•8 years ago
|
Product: Android Background Services → Firefox for Android
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•