src/java.base/share/classes/sun/security/util/CurveDB.java
changeset 55667 6521aec1c26e
parent 47216 71c04702a3d5
child 55671 d755f53becea
equal deleted inserted replaced
55666:340d73f42b3c 55667:6521aec1c26e
     1 /*
     1 /*
     2  * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   102             // components ourselves.
   102             // components ourselves.
   103             // Quick field size check first
   103             // Quick field size check first
   104             if (namedCurve.getCurve().getField().getFieldSize() != fieldSize) {
   104             if (namedCurve.getCurve().getField().getFieldSize() != fieldSize) {
   105                 continue;
   105                 continue;
   106             }
   106             }
   107             if (namedCurve.getCurve().equals(params.getCurve()) == false) {
   107             if (ECUtil.equals(namedCurve, params)) {
   108                 continue;
   108                 // everything matches our named curve, return it
       
   109                 return namedCurve;
   109             }
   110             }
   110             if (namedCurve.getGenerator().equals(params.getGenerator()) ==
       
   111                     false) {
       
   112                 continue;
       
   113             }
       
   114             if (namedCurve.getOrder().equals(params.getOrder()) == false) {
       
   115                 continue;
       
   116             }
       
   117             if (namedCurve.getCofactor() != params.getCofactor()) {
       
   118                 continue;
       
   119             }
       
   120             // everything matches our named curve, return it
       
   121             return namedCurve;
       
   122         }
   111         }
   123         // no match found
   112         // no match found
   124         return null;
   113         return null;
   125     }
   114     }
   126 
   115