bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

Missing resource bundle in the bcjmail-jdk18on artifact since version 1.78

Open vegamime opened this issue 1 year ago • 1 comments

We have identified that since version 1.78, the resource bundle 'org.bouncycastle.mail.smime.validator.SignedMailValidatorMessages' is missing from the bcjmail-jdk18on artifact (but not from bcmail-jdk18on) .

This resource bundle is required by the class 'org.bouncycastle.mail.smime.validator.SignedMailValidator'.

Reading an entry from the ErrorBundle results in an exception. Example Stacktrace: org.bouncycastle.pkix.util.MissingEntryException: Can't find entry SignedMailValidator.certPathInvalid.details in resource file org.bouncycastle.mail.smime.validator.SignedMailValidatorMessages. at org.bouncycastle.pkix.util.LocalizedMessage.getEntry(Unknown Source) at org.bouncycastle.pkix.util.ErrorBundle.getDetail(Unknown Source)

Could you please make this resource bundle available again?

Affected versions: 1.78 and 1.78.1

vegamime avatar May 13 '24 08:05 vegamime

Upon reviewing the current SNAPSHOT version of bcjmail-jdk18on-1.79, it has been discovered that the mentioned resource files - SignedMailValidatorMessages.properties and SignedMailValidatorMessages_de.properties - are currently missing. Could you please provide them again? Thank you in advance!

vegamime avatar Jul 19 '24 11:07 vegamime

Upon reviewing the current version of bcjmail-jdk18on-1.79, we have been discovered that the mentioned resource files - SignedMailValidatorMessages.properties and SignedMailValidatorMessages_de.properties - are still missing. Could you please provide them again? Thank you in advance!

vegamime avatar Nov 25 '24 10:11 vegamime

Thanks for the report. Apologies for the delay... try what's in the current SNAPSHOT for 1.80 on https://downloads.bouncycastle.org/betas this should now be fixed.

dghgit avatar Dec 22 '24 03:12 dghgit

Hello David,

Thank you very much for the feedback and the provided SNAPSHOT for 1.80.

During the verification I noticed the following: In the resource file for the German language SignedMailValidatorMessages_de.properties there is probably an incorrect conversion from ISO-8859-1 to UTF-8. Instead of spezial characters like ü or ö, there is the replacement character EF BF BD encoded in UTF-8.

Could you please look at this again and correct the text entries?

Thank you in advance!

vegamime avatar Jan 07 '25 13:01 vegamime

Would you be able to submit the corrected file as a pull request? I hate to admit to this, but we'll probably get a much better result if it we do - a lot of people think Australians don't speak English properly, I'm not sure it will end well if we try to correct UTF-8 conversions for German...

dghgit avatar Jan 07 '25 14:01 dghgit

Hello David,

would it be possible to deliver the affected files in the ISO-8859-1 encoding as before and not perform a UTF-8 conversion?

In bcmail-jdk18on-1.80-SNAPSHOT, the message resources are also encoded in ISO-8859-1. Maybe in our case the conversion was done automatically by an IDE?

Best regards & thank you!

PS It looks like the class org.bouncycastle.pkix.util.LocalizedMessage also assumes that the message resources are in ISO-8859-1.

vegamime avatar Jan 08 '25 08:01 vegamime

Sure, let's give it a go. I'll put together a beta as soon as I get the files so it can be tested properly.

dghgit avatar Jan 08 '25 13:01 dghgit

Hello David,

great! I think you can use the file SignedMailValidatorMessages_de.properties from bcjmail-jdk18on-1.77 or from bcmail-jdk18on-1.80-SNAPSHOT as a source.

Apart from the encoding, these files are identical to the corresponding file from bcjmail-jdk18on-1.80-SNAPSHOT.

Best regards & many thanks!

vegamime avatar Jan 10 '25 07:01 vegamime

Ah... okay, it looks like the gradle copy was corrupting the files. I've added the files explicitly under jmail and pushed up a new beta, let me know how it goes.

dghgit avatar Jan 11 '25 23:01 dghgit

Hello David, great, that looks good! I also tested it successfully. Thank you very much!

vegamime avatar Jan 13 '25 11:01 vegamime

Hello David, thank you for restoring the affected resource bundles in version 1.80! 👍

vegamime avatar Jan 20 '25 14:01 vegamime