Skip to content

Commit f4656be

Browse files
committed
Resolved PR comments: refactoring, comments, removal of uneccessary code
1 parent 938938d commit f4656be

File tree

3 files changed

+260
-256
lines changed

3 files changed

+260
-256
lines changed

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,18 +1956,16 @@ Connection connectInternal(Properties propsIn,
19561956
sPropValue = activeConnectionProperties.getProperty(sPropKey);
19571957
if (null != sPropValue) {
19581958
enclaveAttestationProtocol = sPropValue;
1959-
if (!AttestationProtocol.isValidAttestationProtocol(enclaveAttestationProtocol)) {
1960-
throw new SQLServerException(
1961-
SQLServerException.getErrString("R_enclaveInvalidAttestationProtocol"), null);
1962-
}
19631959

19641960
if (enclaveAttestationProtocol.equalsIgnoreCase(AttestationProtocol.HGS.toString())) {
19651961
this.enclaveProvider = new SQLServerVSMEnclaveProvider();
19661962
} else if (enclaveAttestationProtocol.equalsIgnoreCase(AttestationProtocol.NONE.toString())) {
19671963
this.enclaveProvider = new SQLServerNoneEnclaveProvider();
1968-
}else {
1969-
// If it's a valid Provider & not HGS (or NONE), then it has to be AAS
1964+
} else if (enclaveAttestationProtocol.equalsIgnoreCase(AttestationProtocol.AAS.toString())) {
19701965
this.enclaveProvider = new SQLServerAASEnclaveProvider();
1966+
} else {
1967+
throw new SQLServerException(
1968+
SQLServerException.getErrString("R_enclaveInvalidAttestationProtocol"), null);
19711969
}
19721970
}
19731971

0 commit comments

Comments
 (0)