mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 12:03:02 +00:00
Some Java crypto providers don't allow IvParameterSpec objects for GCM ciphers, so use GCMParameterSpec instead
This commit is contained in:
parent
a0f93a2dc3
commit
fe58361724
@ -19,6 +19,7 @@ import javax.crypto.IllegalBlockSizeException;
|
|||||||
import javax.crypto.NoSuchPaddingException;
|
import javax.crypto.NoSuchPaddingException;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import javax.crypto.ShortBufferException;
|
import javax.crypto.ShortBufferException;
|
||||||
|
import javax.crypto.spec.GCMParameterSpec;
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
|
||||||
import com.limelight.nvstream.ConnectionContext;
|
import com.limelight.nvstream.ConnectionContext;
|
||||||
@ -402,7 +403,7 @@ public class ControllerStream {
|
|||||||
Cipher cipher;
|
Cipher cipher;
|
||||||
try {
|
try {
|
||||||
cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv));
|
cipher.init(Cipher.ENCRYPT_MODE, key, new GCMParameterSpec(128, iv));
|
||||||
|
|
||||||
// This is also non-ideal. Java gives us <ciphertext><tag> but we want to send <tag><ciphertext>
|
// This is also non-ideal. Java gives us <ciphertext><tag> but we want to send <tag><ciphertext>
|
||||||
// so we'll take the output and arraycopy it into the right spot in the output buffer
|
// so we'll take the output and arraycopy it into the right spot in the output buffer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user