Skip to content

Commit

Permalink
Formatted the check that assigns AE version to correctly assign versi…
Browse files Browse the repository at this point in the history
…on to protocol (#1805)

* Potential fix for bamboo issues

* Changed SQLServerConnection to fix all protocols being assigned to AEV1

* Changed SQLServerConnection::5682 back to working state

* Added a missing pair of parantheses

* Added version change (already committed to main) to prevent pipeline errors

* Formatting plus an explanation comment

* More formatting

* hopefully the final formatting change

* Simplified the AE Version check

* Removed check for if protocol is empty, since it can never be that
  • Loading branch information
Jeffery-Wasty authored Apr 19, 2022
1 parent dc190d5 commit bec8717
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
final class SQLJdbcVersion {
static final int major = 11;
static final int minor = 1;
static final int patch = 0;
static final int patch = 1;
static final int build = 0;
/*
* Used to load mssql-jdbc_auth DLL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4554,8 +4554,11 @@ int writeAEFeatureRequest(boolean write, /* if false just calculates the length
if (write) {
tdsWriter.writeByte(TDS.TDS_FEATURE_EXT_AE); // FEATUREEXT_TC
tdsWriter.writeInt(1); // length of version
if (null == enclaveAttestationUrl || enclaveAttestationUrl.isEmpty() || (enclaveAttestationProtocol != null
&& !enclaveAttestationProtocol.equalsIgnoreCase(AttestationProtocol.NONE.toString()))) {

// For protocol = HGS,AAS, at this point it can only have a valid URL, therefore is V2
// For protocol = NONE, it is V2 regardless
// For protocol = null, we always want V1
if (null == enclaveAttestationProtocol) {
tdsWriter.writeByte(TDS.COLUMNENCRYPTION_VERSION1);
} else {
tdsWriter.writeByte(TDS.COLUMNENCRYPTION_VERSION2);
Expand Down

0 comments on commit bec8717

Please sign in to comment.