propagate from branch 'i2p.i2p.zzz.sam' (head b328f0edb961263d7606ea964ecb3f7c319ca1cf)

to branch 'i2p.i2p' (head 7b4c0525be182722ef2cc7b564691f27d997da3b)
This commit is contained in:
zzz
2015-11-27 20:58:18 +00:00
30 changed files with 2753 additions and 689 deletions

View File

@@ -158,13 +158,7 @@ public class RouterPasswordManager extends PasswordManager {
String pfx = realm;
if (user != null && user.length() > 0)
pfx += '.' + user;
byte[] salt = new byte[SALT_LENGTH];
_context.random().nextBytes(salt);
byte[] pwHash = _context.keyGenerator().generateSessionKey(salt, DataHelper.getUTF8(pw)).getData();
byte[] shashBytes = new byte[SHASH_LENGTH];
System.arraycopy(salt, 0, shashBytes, 0, SALT_LENGTH);
System.arraycopy(pwHash, 0, shashBytes, SALT_LENGTH, SessionKey.KEYSIZE_BYTES);
String shash = Base64.encode(shashBytes);
String shash = createHash(pw);
Map<String, String> toAdd = Collections.singletonMap(pfx + PROP_SHASH, shash);
List<String> toDel = new ArrayList<String>(4);
toDel.add(pfx + PROP_PW);