From: <Gre...@ri...> - 2008-09-24 13:11:10
|
Hello, If the pgp files are > 10KB we were having trouble decrypting messages with and error "Read tried past end of inputstream". There were a couple of previous similar messages but none of any help. We are using the EncryptedMessage decrypt(..) method to extract the payload (as per examples). eg: msg = emsg.decrypt(bundle, passPhrase.toCharArray()); Looks like there is a mistake where it does not read the bytes correctly. The change below seems to address the problem. cryptix.openpgp.io.PGPLengthDataInputStream in the cryptix-openpgp-provider.jar line #157 needs to be amended: // } else if (chunkLength > chunkBytesRead) { } else if (chunkBytesRead <= chunkLength ) { Now seems to work OK. I think the change now reads upto but not the last byte, so the next read works as expected. The < 10KB files never got to this code as the read was done in one go. Hope this helps. Cheers Greg Cheers Greg Share our environment commitment - conserve resources and contribute to the reduction of CO2 emissions by not printing the email unless absolutely necessary to do so. Any opinions expressed are those of the author, not Ricoh UK Ltd. This communication does not constitute either offer or acceptance of any contractually binding agreement. Such offer or acceptance must be communicated in writing. It is the responsibility of the recipient to ensure this email and attachments are free from computer viruses before use and the sender accepts no responsibility or liability for any such computer viruses. Ricoh UK Ltd. may monitor the content of emails sent and received via its network for the purpose of ensuring compliance with its policies and procedures. This communication contains information, which may be confidential or privileged. The information is intended solely for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this communication in error, please notify the sender immediately by return email with a copy to pos...@ri... . Please contact us on +44 (0) 208 261 4000 if you need assistance. Registered in England No: 1505381 VAT No: GB 354 2816 54 |