added null parameters check
@@ -318,7 +318,7 @@ Signature createSignature(AlgorithmIdentifier sigAlgId)
{
ASN1Sequence seq = ASN1Sequence.getInstance(sigAlgId.getParameters());
- if (seq.size() != 0)
+ if (seq != null && seq.size() != 0)
{
try
{
@@ -330,7 +330,7 @@ Signature createSignature(AlgorithmIdentifier sigAlgId)
}
catch (IOException e)
{
- throw new GeneralSecurityException("unable to process PSS parameters", e);
+ throw new GeneralSecurityException("unable to process PSS parameters: " + e.getMessage());
}
}
}
