BadPaddingExceptions should be rethrown as RuntimeExceptions.

This commit is contained in:
akwizgran
2011-09-19 14:53:44 +01:00
parent 11cf84dedc
commit f6e5ef415a

View File

@@ -51,7 +51,7 @@ implements ConnectionEncrypter {
try { try {
out.write(frameCipher.doFinal(mac)); out.write(frameCipher.doFinal(mac));
} catch(BadPaddingException badCipher) { } catch(BadPaddingException badCipher) {
throw new IOException(badCipher); throw new RuntimeException(badCipher);
} catch(IllegalBlockSizeException badCipher) { } catch(IllegalBlockSizeException badCipher) {
throw new RuntimeException(badCipher); throw new RuntimeException(badCipher);
} }
@@ -85,7 +85,7 @@ implements ConnectionEncrypter {
try { try {
out.write(ivCipher.doFinal(iv)); out.write(ivCipher.doFinal(iv));
} catch(BadPaddingException badCipher) { } catch(BadPaddingException badCipher) {
throw new IOException(badCipher); throw new RuntimeException(badCipher);
} catch(IllegalBlockSizeException badCipher) { } catch(IllegalBlockSizeException badCipher) {
throw new RuntimeException(badCipher); throw new RuntimeException(badCipher);
} }