Only allow key sizes of 16 in native cipher
This commit is contained in:
parent
a9b2660aa8
commit
90104b03b7
@ -59,6 +59,7 @@ public class NativeCipher implements BungeeCipher
|
|||||||
@Override
|
@Override
|
||||||
public void init(boolean forEncryption, SecretKey key) throws GeneralSecurityException
|
public void init(boolean forEncryption, SecretKey key) throws GeneralSecurityException
|
||||||
{
|
{
|
||||||
|
Preconditions.checkArgument( key.getEncoded().length == 16, "Invalid key size" );
|
||||||
if ( pointer != 0 )
|
if ( pointer != 0 )
|
||||||
{
|
{
|
||||||
nativeCipher.free( pointer );
|
nativeCipher.free( pointer );
|
||||||
|
Loading…
Reference in New Issue
Block a user