mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-28 17:48:48 +01:00
Implemented legacy public key signature
This commit is contained in:
parent
193b0c2735
commit
d0debf1d94
@ -0,0 +1,8 @@
|
||||
package de.florianmichael.viafabricplus.injection.access;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public interface IKeyPairResponse {
|
||||
|
||||
ByteBuffer viafabricplus_getLegacyPublicKeySignature();
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.authlib;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.mojang.authlib.yggdrasil.response.KeyPairResponse;
|
||||
import de.florianmichael.viafabricplus.injection.access.IKeyPairResponse;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@Mixin(KeyPairResponse.class)
|
||||
public class MixinKeyPairResponse implements IKeyPairResponse {
|
||||
|
||||
@SerializedName("publicKeySignature")
|
||||
private ByteBuffer viafabricplus_legacyKeySignature;
|
||||
|
||||
@Override
|
||||
public ByteBuffer viafabricplus_getLegacyPublicKeySignature() {
|
||||
return this.viafabricplus_legacyKeySignature;
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft;
|
||||
|
||||
import com.mojang.authlib.yggdrasil.response.KeyPairResponse;
|
||||
import de.florianmichael.viafabricplus.injection.access.IKeyPairResponse;
|
||||
import de.florianmichael.viafabricplus.injection.access.IPublicKeyData;
|
||||
import net.minecraft.client.util.ProfileKeysImpl;
|
||||
import net.minecraft.network.encryption.PlayerPublicKey;
|
||||
@ -31,7 +32,6 @@ public class MixinProfileKeysImpl {
|
||||
|
||||
@Inject(method = "decodeKeyPairResponse", at = @At("RETURN"))
|
||||
private static void trackLegacyKey(KeyPairResponse keyPairResponse, CallbackInfoReturnable<PlayerPublicKey.PublicKeyData> cir) {
|
||||
// ((IPublicKeyData) (Object) cir.getReturnValue()).viafabricplus_setV1Key(keyPairResponse.getLegacyPublicKeySignature());
|
||||
// TODO | Track Key
|
||||
((IPublicKeyData) (Object) cir.getReturnValue()).viafabricplus_setV1Key(((IKeyPairResponse) keyPairResponse).viafabricplus_getLegacyPublicKeySignature());
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,8 @@
|
||||
"fixes.viaversion.protocol1_9to1_8.MixinViaIdleThread",
|
||||
"jsonwebtoken.MixinClasses",
|
||||
"jsonwebtoken.MixinDefaultCompressionCodecResolver",
|
||||
"jsonwebtoken.MixinDefaultJwtParserBuilder"
|
||||
"jsonwebtoken.MixinDefaultJwtParserBuilder",
|
||||
"fixes.authlib.MixinKeyPairResponse"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
Loading…
Reference in New Issue
Block a user