mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-27 05:42:24 +00:00
8037846: Ensure streaming of input cipher streams
Reviewed-by: xuelei, valeriep
This commit is contained in:
parent
883d16c219
commit
e55eebc5ed
@ -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;
|
||||
@ -302,6 +306,7 @@ public class CipherInputStream extends FilterInputStream {
|
||||
}
|
||||
}
|
||||
catch (BadPaddingException | IllegalBlockSizeException ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
ostart = 0;
|
||||
ofinish = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user