-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split akv verification tests to fix SSL issue #781
Split akv verification tests to fix SSL issue #781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several things: (1) please drop test tables at the end of your tests (2) now that the tests are split, they share the same code except how to connect -- suggestion: for easier maintenance, move the same methods to one file to be included in the tests (3) why str size 64? If it's a constant, you might consider using the keyword const
and upper case letters for the constants (4) to be consistent with the naming scheme, please add underscores _
for the file names usernamepassword
and clientsecret
(5) please fix the comments in values.php
Regarding strsize, it's 64 just to make sure the column size is large enough to accommodate the string values in values.php that are used for this test. But it changes in other AE tests that use other longer strings in values.php. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please read my comments / questions.
// Set up the columns and build the insert query. Each data type has an | ||
// AE-encrypted and a non-encrypted column side by side in the table. | ||
// If column encryption is not set in MsSetup.inc, this function simply | ||
// creates two non-encrypted columns side-by-side for each type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I agree with your comment here because you have a specific connection string in your test, so it's not really affected by the flags in MsSetup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ColumnMeta does use the flags in MsSetup though, so setting $keystore and $dataEncrypted to encrypt in MsSetup will encrypt the _AE columns if the rest of the connection string enables encryption.
require_once("MsCommon_mid-refactor.inc"); | ||
require_once("MsSetup.inc"); | ||
require_once('values.php'); | ||
require_once('pdo_ae_azure_key_vault_common.php'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you drop the your test table(s) in this test and the sqlsrv equivalent one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, at the end of insertDataAndVerify() in the new common files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... I don't see this insertDataAndVerify() anywhere... not sure how I miss it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in sqlsrv_ae_azure_key_vault_common.php and pdo_ae_azure_key_vault_common.php.
require_once('pdo_ae_azure_key_vault_common.php'); | ||
|
||
$strsize = 64; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment to explain why you picked 64 for the strsize
require_once('sqlsrv_ae_azure_key_vault_common.php'); | ||
|
||
$strsize = 64; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment about 64 please
@@ -114,7 +85,7 @@ for ($i = 0; $i < sizeof($columnEncryption); ++$i) { | |||
checkErrors( | |||
$errors, | |||
array('08001','0'), | |||
array('08001','-1'), // SSL error occurs in Ubuntu | |||
array('08001','-1'), // SSL error on some Linuxes | |||
array('IMSSP','-110'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still have SSL errors after this split?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because I did not split the keywords test. This test runs through 254 connections so splitting is not practical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How often does the SSL error occur? Does it always happen after the first successful connection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember how often it happens...
require_once('sqlsrv_ae_azure_key_vault_common.php'); | ||
|
||
$strsize = 64; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you use 64 in almost every AKV test -- why not create a constant in values.php and reference it in all your tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not forget to fix the remaining SSL issues
Drop tables in pdo keyword test too
Otherwise approved.
Removed *_verification.phpt and replaced with _usernamepassword.phpt and _clientsecret.phpt.
This change is