fix incorrect length in copyOfRange
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user