aboutsummaryrefslogtreecommitdiff
path: root/src/share/classes/javax
diff options
context:
space:
mode:
authorascarpino <none@none>2014-04-14 21:04:33 +0000
committerascarpino <none@none>2014-04-14 21:04:33 +0000
commit2ff623c154b0f9350ea23b8c5dad6c18de54358c (patch)
treeeee959cfd2192e35a87acf2ffb8146cd448e3f88 /src/share/classes/javax
parenta9adaec705cb38c0ad8cd7dee42b5cf0ce9ae8b2 (diff)
8037846: Ensure streaming of input cipher streams
Reviewed-by: xuelei, valeriep
Diffstat (limited to 'src/share/classes/javax')
-rw-r--r--src/share/classes/javax/crypto/CipherInputStream.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/share/classes/javax/crypto/CipherInputStream.java b/src/share/classes/javax/crypto/CipherInputStream.java
index 0e80a6013..0889c970f 100644
--- a/src/share/classes/javax/crypto/CipherInputStream.java
+++ b/src/share/classes/javax/crypto/CipherInputStream.java
@@ -107,9 +107,10 @@ public class CipherInputStream extends FilterInputStream {
done = true;
try {
obuffer = cipher.doFinal();
+ } catch (IllegalBlockSizeException | BadPaddingException e) {
+ obuffer = null;
+ throw new IOException(e);
}
- catch (IllegalBlockSizeException e) {obuffer = null;}
- catch (BadPaddingException e) {obuffer = null;}
if (obuffer == null)
return -1;
else {
@@ -120,7 +121,10 @@ public class CipherInputStream extends FilterInputStream {
}
try {
obuffer = cipher.update(ibuffer, 0, readin);
- } catch (IllegalStateException e) {obuffer = null;};
+ } catch (IllegalStateException e) {
+ obuffer = null;
+ throw e;
+ }
ostart = 0;
if (obuffer == null)
ofinish = 0;
@@ -308,6 +312,7 @@ public class CipherInputStream extends FilterInputStream {
}
}
catch (BadPaddingException | IllegalBlockSizeException ex) {
+ throw new IOException(ex);
}
ostart = 0;
ofinish = 0;