-
Notifications
You must be signed in to change notification settings - Fork 21
Description
The AESKeyWrap code has the following APIs:
byte[] wrap(byte[] data, int start, int length)
and
byte[] unwrap(byte[] data, int start, int length)
Need to update parameter check in unwrap and copyOfRange to follow the parameter definitions;
in wrap
update byte[] inData = Arrays.copyOfRange(data, start, length);
to byte[] inData = Arrays.copyOfRange(data, start, **start+**length);
in unwrap
update check
if (data == null || start < 0 || length < start || data.length < (length - start))
to
if (data == null || start < 0 || length < start || data.length < (length + start))
and
update byte[] inData = Arrays.copyOfRange(data, start, length);
to
byte[] inData = Arrays.copyOfRange(data, start, **start+**length);
Note: We can not add any tests to verify the above since this are an internal functions and are ALWAYS called with start = 0 and length = data.length