8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support

Fixed SignatureUtil and ECDSA signature impl to handle EC parameters

Reviewed-by: weijun
This commit is contained in:
Valerie Peng 2019-07-11 20:11:47 +00:00
parent 27c77d3d29
commit 175faeeadf
5 changed files with 189 additions and 33 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -104,21 +104,10 @@ public class CurveDB {
if (namedCurve.getCurve().getField().getFieldSize() != fieldSize) {
continue;
}
if (namedCurve.getCurve().equals(params.getCurve()) == false) {
continue;
if (ECUtil.equals(namedCurve, params)) {
// everything matches our named curve, return it
return namedCurve;
}
if (namedCurve.getGenerator().equals(params.getGenerator()) ==
false) {
continue;
}
if (namedCurve.getOrder().equals(params.getOrder()) == false) {
continue;
}
if (namedCurve.getCofactor() != params.getCofactor()) {
continue;
}
// everything matches our named curve, return it
return namedCurve;
}
// no match found
return null;