fixed title.keys key size

This commit is contained in:
Dmitry Isaenko 2019-08-19 19:26:59 +03:00
parent 4e1bacd4fc
commit e8755fbe2f
3 changed files with 5 additions and 6 deletions

View file

@ -107,8 +107,7 @@ public class ListSelectorController implements Initializable {
}
private void validateAndAdd(String addingItem){
if (!observableList.contains(addingItem)) {
if (!observableList.contains(addingItem))
observableList.add(addingItem);
}
}
}

View file

@ -163,8 +163,8 @@ public class SettingsController implements Initializable {
String[] keyValue;
LinkedHashMap<String, String> preparedPairsMap = new LinkedHashMap<>();
while ((fileLine = br.readLine()) != null){
keyValue = fileLine.trim().split("\\s+?=\\s+?", 2);
if (keyValue.length == 2 && keyValue[0].length() == 32 && keyValue[1].length() == 32){
keyValue = fileLine.trim().split("\\s*=\\s*", 2);
if (keyValue.length == 2 && keyValue[0].length() > 16 && ! (keyValue[0].length() > 32) && keyValue[1].length() == 32){
preparedPairsMap.put(keyValue[0], keyValue[1]);
}
}

View file

@ -257,9 +257,9 @@ public class NCAProvider {
key = decryptedKey2; // TODO: Just remember this dumb hack
}
else {
byte[] rightsIDkey = hexStrToByteArray(keys.get(byteArrToHexString(rightsId)));
try {
byte[] rightsIDkey = hexStrToByteArray(keys.get(byteArrToHexString(rightsId))); // throws NullPointerException
SecretKeySpec skSpec = new SecretKeySpec(
hexStrToByteArray(keys.get(String.format("titlekek_%02d", cryptoTypeReal))
), "AES");