Re: BCTLS 1.61 Potential Issue

Peter Dettman <[email protected]> Mon, 25 Feb 2019 10:33:51 +0700
Newsgroups gmane.comp.encryption.bouncy-castle.devel
Message-ID <[email protected]>
Hi Stathis,
Thanks for reporting this. We've made a quick fix that avoids the
circular initialization and will look at a better refactoring of
TlsUtils at some point.

Regards,
Pete Dettman

On 19/2/19 11:33 pm, Stathis Deligeorgopoulos wrote:
> Hello Everyone,
> 
> I was just testing the bctls-jdk15on-161 and encountered the following
> problem.
> 
> When making a call to the SignatureAndHashAlgorithm class before having
> used the TlsUtils class a NulPointerException is thrown. To replicate
> just make a call to
> 
> SignatureAndHashAlgorithm signatureAndHashAlgorithm = new
> SignatureAndHashAlgorithm(HashAlgorithm.sha1, SignatureAlgorithm.rsa);
> 
> without any other BC calls before it.
> 
> This has to do with the fact that the static objects in
> SignatureAndHashAlgorithm use the class constructor that calls TlsUtils
> and parts of the static initialization of TlsUtils lead to the use of
> static SignatureAndHashAlgorithm Objects that have not yet been
> initialized.
> 
> When a call to the TlsUtils class is made first, then there is no error.
> 
> I hope the information helps.
> 
> With Regard,
> Stathis
>