Update #36 - Fix incorrect use of arithmetic shift, more capes

This commit is contained in:
lax1dude
2024-06-23 17:02:58 -07:00
parent 7425179b36
commit cc1fe13421
60 changed files with 421 additions and 210 deletions

View File

@ -127,13 +127,13 @@ public class GuiUpdateVersionSlot extends GuiSlot {
if(strs.size() > 2 && screen.mx > xx + iconSize && screen.my > yy + 8 && screen.mx < xx + getListWidth() - 5 && screen.my < yy + 25) {
screen.tooltip = cert.bundleVersionComment;
}
char[] hexStr1 = new char[] { hexChars[(cert.bundleDataHash[0] >> 4) & 0xF],
hexChars[cert.bundleDataHash[1] & 0xF], hexChars[(cert.bundleDataHash[1] >> 4) & 0xF],
hexChars[cert.bundleDataHash[1] & 0xF], hexChars[(cert.bundleDataHash[2] >> 4) & 0xF],
char[] hexStr1 = new char[] { hexChars[(cert.bundleDataHash[0] >>> 4) & 0xF],
hexChars[cert.bundleDataHash[1] & 0xF], hexChars[(cert.bundleDataHash[1] >>> 4) & 0xF],
hexChars[cert.bundleDataHash[1] & 0xF], hexChars[(cert.bundleDataHash[2] >>> 4) & 0xF],
hexChars[cert.bundleDataHash[2] & 0xF] };
char[] hexStr2 = new char[] { hexChars[(cert.bundleDataHash[29] >> 4) & 0xF],
hexChars[cert.bundleDataHash[29] & 0xF], hexChars[(cert.bundleDataHash[30] >> 4) & 0xF],
hexChars[cert.bundleDataHash[30] & 0xF], hexChars[(cert.bundleDataHash[31] >> 4) & 0xF],
char[] hexStr2 = new char[] { hexChars[(cert.bundleDataHash[29] >>> 4) & 0xF],
hexChars[cert.bundleDataHash[29] & 0xF], hexChars[(cert.bundleDataHash[30] >>> 4) & 0xF],
hexChars[cert.bundleDataHash[30] & 0xF], hexChars[(cert.bundleDataHash[31] >>> 4) & 0xF],
hexChars[cert.bundleDataHash[31] & 0xF] };
screen.drawString(mc.fontRendererObj,
"Author: " + EnumChatFormatting.GRAY + cert.bundleAuthorName + EnumChatFormatting.WHITE + " Hash: "

View File

@ -141,7 +141,7 @@ public class UpdateCertificate {
sha256.update(signaturePayload, 0, signaturePayload.length);
sha256.doFinal(hash2048, 96);
hash2048[0] = (byte)((signaturePayload.length >> 8) & 0xFF);
hash2048[0] = (byte)((signaturePayload.length >>> 8) & 0xFF);
hash2048[1] = (byte)(signaturePayload.length & 0xFF);
if(!Arrays.equals(hash2048, rsa2048sumDec)) {