fix incorrect length in copyOfRange
This commit is contained in:
parent
5d40822ea5
commit
b3a5b7e04a
|
@ -112,7 +112,7 @@ public class PsoDecryptTokenOp {
|
||||||
private byte[] decryptSessionKeyEcdh(byte[] encryptedSessionKeyMpi, ECKeyFormat eckf, CanonicalizedPublicKey publicKey)
|
private byte[] decryptSessionKeyEcdh(byte[] encryptedSessionKeyMpi, ECKeyFormat eckf, CanonicalizedPublicKey publicKey)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
int mpiLength = getMpiLength(encryptedSessionKeyMpi);
|
int mpiLength = getMpiLength(encryptedSessionKeyMpi);
|
||||||
byte[] encryptedPoint = Arrays.copyOfRange(encryptedSessionKeyMpi, 2, mpiLength);
|
byte[] encryptedPoint = Arrays.copyOfRange(encryptedSessionKeyMpi, 2, mpiLength + 2);
|
||||||
|
|
||||||
X9ECParameters x9Params = NISTNamedCurves.getByOID(eckf.getCurveOID());
|
X9ECParameters x9Params = NISTNamedCurves.getByOID(eckf.getCurveOID());
|
||||||
ECPoint p = x9Params.getCurve().decodePoint(encryptedPoint);
|
ECPoint p = x9Params.getCurve().decodePoint(encryptedPoint);
|
||||||
|
|
Loading…
Reference in a new issue