|
17 | 17 | import de.rub.nds.tlsscanner.core.vector.Vector;
|
18 | 18 | import java.util.LinkedList;
|
19 | 19 | import java.util.List;
|
| 20 | +import java.util.Objects; |
20 | 21 |
|
21 | 22 | /** */
|
22 | 23 | public class InvalidCurveVector implements Vector {
|
@@ -137,18 +138,34 @@ public List<NamedGroup> getEcdsaRequiredGroups() {
|
137 | 138 | return ecdsaRequiredGroups;
|
138 | 139 | }
|
139 | 140 |
|
140 |
| - public boolean equals(InvalidCurveVector toCompare) { |
141 |
| - if (protocolVersion != toCompare.getProtocolVersion() |
142 |
| - || cipherSuite != toCompare.getCipherSuite() |
143 |
| - || namedGroup != toCompare.getNamedGroup() |
144 |
| - || pointFormat != toCompare.getPointFormat() |
145 |
| - || twistAttack != toCompare.isTwistAttack() |
146 |
| - || attackInRenegotiation != toCompare.isAttackInRenegotiation() |
147 |
| - || !ecdsaRequiredGroups.equals(toCompare.getEcdsaRequiredGroups())) { |
| 141 | + @Override |
| 142 | + public boolean equals(Object obj) { |
| 143 | + if (this == obj) { |
| 144 | + return true; |
| 145 | + } |
| 146 | + if (obj == null || getClass() != obj.getClass()) { |
148 | 147 | return false;
|
149 | 148 | }
|
| 149 | + InvalidCurveVector toCompare = (InvalidCurveVector) obj; |
| 150 | + return protocolVersion == toCompare.getProtocolVersion() |
| 151 | + && cipherSuite == toCompare.getCipherSuite() |
| 152 | + && namedGroup == toCompare.getNamedGroup() |
| 153 | + && pointFormat == toCompare.getPointFormat() |
| 154 | + && twistAttack == toCompare.isTwistAttack() |
| 155 | + && attackInRenegotiation == toCompare.isAttackInRenegotiation() |
| 156 | + && Objects.equals(ecdsaRequiredGroups, toCompare.getEcdsaRequiredGroups()); |
| 157 | + } |
150 | 158 |
|
151 |
| - return true; |
| 159 | + @Override |
| 160 | + public int hashCode() { |
| 161 | + return Objects.hash( |
| 162 | + protocolVersion, |
| 163 | + cipherSuite, |
| 164 | + namedGroup, |
| 165 | + pointFormat, |
| 166 | + twistAttack, |
| 167 | + attackInRenegotiation, |
| 168 | + ecdsaRequiredGroups); |
152 | 169 | }
|
153 | 170 |
|
154 | 171 | public void setEcdsaRequiredGroups(List<NamedGroup> ecdsaRequiredGroups) {
|
|
0 commit comments