8206171: Signature#getParameters for RSASSA-PSS throws ProviderException when not initialized

Changed SunRsaSign and SunMSCAPI provider to return null and updated javadoc

Reviewed-by: weijun, mullan
This commit is contained in:
Valerie Peng 2018-07-23 23:18:19 +00:00
parent 7723d3a1e9
commit df08003471
4 changed files with 40 additions and 41 deletions

View file

@ -605,16 +605,15 @@ public class RSAPSSSignature extends SignatureSpi {
@Override
protected AlgorithmParameters engineGetParameters() {
if (this.sigParams == null) {
throw new ProviderException("Missing required PSS parameters");
}
try {
AlgorithmParameters ap =
AlgorithmParameters.getInstance("RSASSA-PSS");
ap.init(this.sigParams);
return ap;
} catch (GeneralSecurityException gse) {
throw new ProviderException(gse.getMessage());
AlgorithmParameters ap = null;
if (this.sigParams != null) {
try {
ap = AlgorithmParameters.getInstance("RSASSA-PSS");
ap.init(this.sigParams);
} catch (GeneralSecurityException gse) {
throw new ProviderException(gse.getMessage());
}
}
return ap;
}
}