mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 23:30:55 +03:00
why copyOf(), when its a new byte[] anyway
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
*/
|
*/
|
||||||
package net.schmizz.sshj.transport.kex;
|
package net.schmizz.sshj.transport.kex;
|
||||||
|
|
||||||
import net.schmizz.sshj.common.ByteArrayUtils;
|
|
||||||
import net.schmizz.sshj.common.SSHRuntimeException;
|
import net.schmizz.sshj.common.SSHRuntimeException;
|
||||||
import net.schmizz.sshj.common.SecurityUtils;
|
import net.schmizz.sshj.common.SecurityUtils;
|
||||||
|
|
||||||
@@ -95,7 +94,7 @@ public class DH {
|
|||||||
}
|
}
|
||||||
e = ((javax.crypto.interfaces.DHPublicKey) myKpair.getPublic()).getY();
|
e = ((javax.crypto.interfaces.DHPublicKey) myKpair.getPublic()).getY();
|
||||||
}
|
}
|
||||||
return ByteArrayUtils.copyOf(e.toByteArray());
|
return e.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getK() {
|
public byte[] getK() {
|
||||||
@@ -110,7 +109,7 @@ public class DH {
|
|||||||
}
|
}
|
||||||
K = new BigInteger(myKeyAgree.generateSecret());
|
K = new BigInteger(myKeyAgree.generateSecret());
|
||||||
}
|
}
|
||||||
return ByteArrayUtils.copyOf(K.toByteArray());
|
return K.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user