Skip to content

Commit c68b4e0

Browse files
committed
gost now cahtes index out of bounds exception - ugly but i dont know...
1 parent db32ccd commit c68b4e0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/protocol/preparator/GOSTClientKeyExchangePreparator.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,15 @@ private void prepareCek() {
198198
byte[] wrapped = wrap(true, msg.getComputations().getPremasterSecret().getValue(), sBoxName);
199199

200200
byte[] cek = new byte[32];
201-
if (wrapped.length <= cek.length) {
202-
System.arraycopy(wrapped, 0, cek, 0, cek.length);
203-
} else {
204-
// This case is for fuzzing purposes only.
205-
System.arraycopy(wrapped, 0, cek, 0, wrapped.length);
201+
try {
202+
if (wrapped.length <= cek.length) {
203+
System.arraycopy(wrapped, 0, cek, 0, cek.length);
204+
} else {
205+
// This case is for fuzzing purposes only.
206+
System.arraycopy(wrapped, 0, cek, 0, wrapped.length - 1);
207+
}
208+
} catch (ArrayIndexOutOfBoundsException E) {
209+
LOGGER.warn("Something going wrong here...");
206210
}
207211
msg.getComputations().setEncryptedKey(cek);
208212

0 commit comments

Comments
 (0)