Skip to content

Commit 1a7712e

Browse files
committed
Fixed failing tests
1 parent 0570d8e commit 1a7712e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/constants/AlgorithmResolver.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public static KeyExchangeAlgorithm getKeyExchangeAlgorithm(CipherSuite cipherSui
160160
if (cipherSuite == CipherSuite.TLS_FALLBACK_SCSV
161161
|| cipherSuite == CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV
162162
|| cipherSuite == CipherSuite.TLS_UNKNOWN_CIPHER) {
163-
throw new IllegalArgumentException("The CipherSuite:" + cipherSuite.name()
163+
throw new UnsupportedOperationException("The CipherSuite:" + cipherSuite.name()
164164
+ " does not specify a KeyExchangeAlgorithm");
165165
}
166166
throw new UnsupportedOperationException("The key exchange algorithm in " + cipherSuite.toString()
@@ -253,7 +253,8 @@ public static CipherAlgorithm getCipher(CipherSuite cipherSuite) {
253253
if (cipherSuite == CipherSuite.TLS_FALLBACK_SCSV
254254
|| cipherSuite == CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV
255255
|| cipherSuite == CipherSuite.TLS_UNKNOWN_CIPHER) {
256-
throw new IllegalArgumentException("The CipherSuite:" + cipherSuite.name() + " does not specify a Cipher");
256+
throw new UnsupportedOperationException("The CipherSuite:" + cipherSuite.name()
257+
+ " does not specify a Cipher");
257258
}
258259
throw new UnsupportedOperationException("The cipher algorithm in " + cipherSuite + " is not supported yet.");
259260
}
@@ -354,7 +355,7 @@ public static MacAlgorithm getMacAlgorithm(ProtocolVersion protocolVersion, Ciph
354355
if (cipherSuite == CipherSuite.TLS_FALLBACK_SCSV
355356
|| cipherSuite == CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV
356357
|| cipherSuite == CipherSuite.TLS_UNKNOWN_CIPHER) {
357-
throw new IllegalArgumentException("The CipherSuite:" + cipherSuite.name()
358+
throw new UnsupportedOperationException("The CipherSuite:" + cipherSuite.name()
358359
+ " does not specify a MAC-Algorithm");
359360
}
360361
if (result != null) {

TLS-Core/src/test/java/de/rub/nds/tlsattacker/core/constants/AlgorithmResolverTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ public void testAllCipherSuitesGetKeyExchange() {
158158
// Checks that we can retrieve all ciphersuites key exchange algorithms
159159
// and
160160
// that none throws an unsupported operation exception
161-
// Only IllegalArgmumentExceptions are allowed here
161+
// Only UnsupportedOperationException are allowed here
162162
for (CipherSuite suite : CipherSuite.values()) {
163163
try {
164164
AlgorithmResolver.getKeyExchangeAlgorithm(suite);
165-
} catch (IllegalArgumentException E) {
165+
} catch (UnsupportedOperationException E) {
166166
}
167167
}
168168
}
@@ -212,7 +212,7 @@ public void testGetAllCipher() {
212212
for (CipherSuite suite : CipherSuite.values()) {
213213
try {
214214
AlgorithmResolver.getCipher(suite);
215-
} catch (IllegalArgumentException E) {
215+
} catch (UnsupportedOperationException E) {
216216
}
217217
}
218218
}
@@ -239,7 +239,7 @@ public void testGetAllCipherTypes() {
239239
for (CipherSuite suite : CipherSuite.values()) {
240240
try {
241241
AlgorithmResolver.getCipherType(suite);
242-
} catch (IllegalArgumentException E) {
242+
} catch (UnsupportedOperationException E) {
243243
}
244244
}
245245
}
@@ -306,7 +306,7 @@ public void getAllMacAlgorithms() {
306306
try {
307307
AlgorithmResolver.getMacAlgorithm(ProtocolVersion.SSL3, suite);
308308
AlgorithmResolver.getMacAlgorithm(ProtocolVersion.TLS12, suite);
309-
} catch (IllegalArgumentException E) {
309+
} catch (UnsupportedOperationException E) {
310310

311311
}
312312
}

0 commit comments

Comments
 (0)