"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java" between
pdfbox-2.0.23-src.zip and pdfbox-2.0.24-src.zip

About: Apache PDFBox is a Java PDF library tool that allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents.

SecurityHandler.java  (pdfbox-2.0.23-src):SecurityHandler.java  (pdfbox-2.0.24-src)
skipping to change at line 383 skipping to change at line 383
cipher.init(decrypt ? Cipher.DECRYPT_MODE : Cipher.ENCRYPT_MODE, keySpec , ips); cipher.init(decrypt ? Cipher.DECRYPT_MODE : Cipher.ENCRYPT_MODE, keySpec , ips);
return cipher; return cipher;
} }
private boolean prepareAESInitializationVector(boolean decrypt, byte[] iv, I nputStream data, OutputStream output) throws IOException private boolean prepareAESInitializationVector(boolean decrypt, byte[] iv, I nputStream data, OutputStream output) throws IOException
{ {
if (decrypt) if (decrypt)
{ {
// read IV from stream // read IV from stream
int ivSize = (int) IOUtils.populateBuffer(data, iv); int ivSize = (int) IOUtils.populateBuffer(data, iv);
if (ivSize == -1) if (ivSize == 0)
{ {
return false; return false;
} }
if (ivSize != iv.length) if (ivSize != iv.length)
{ {
throw new IOException( throw new IOException(
"AES initialization vector not fully read: only " "AES initialization vector not fully read: only "
+ ivSize + " bytes read instead of " + iv.length ); + ivSize + " bytes read instead of " + iv.length );
} }
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)