Skip to content

Commit

Permalink
Merge pull request #785 from david-puglielli/ae-test-experiments
Browse files Browse the repository at this point in the history
Fixed akv test failures with win encryption
  • Loading branch information
david-puglielli authored May 30, 2018
2 parents 9e75dfe + 9d1eafd commit 4509756
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Test connection keywords for Azure Key Vault for Always Encrypted.
<?php
require_once('pdo_ae_azure_key_vault_common.php');

// This test only applies to Azure Key Vault, or to no encryption at all
if ($keystore != 'none' and $keystore != 'akv') {
echo "Done.\n";
exit();
}

// We will test the direct product (set of all possible combinations) of the following
$columnEncryption = ['enabled', 'disabled', 'notvalid', ''];
$keyStoreAuthentication = ['KeyVaultPassword', 'KeyVaultClientSecret', 'KeyVaultNothing', ''];
Expand Down
10 changes: 8 additions & 2 deletions test/functional/sqlsrv/sqlsrv_ae_azure_key_vault_keywords.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Test connection keywords for Azure Key Vault for Always Encrypted.
<?php
require_once('sqlsrv_ae_azure_key_vault_common.php');

// This test only applies to Azure Key Vault, or to no encryption at all
if ($keystore != 'none' and $keystore != 'akv') {
echo "Done.\n";
exit();
}

// We will test the direct product (set of all possible combinations) of the following
$columnEncryption = ['enabled', 'disabled', 'notvalid', ''];
$keyStoreAuthentication = ['KeyVaultPassword', 'KeyVaultClientSecret', 'KeyVaultNothing', ''];
Expand Down Expand Up @@ -123,7 +129,7 @@ for ($i = 0; $i < sizeof($columnEncryption); ++$i) {
if (sqlsrv_execute($stmt) == false) {
$errors = sqlsrv_errors();

if (!AE\isColEncrypted()) {
if (!AE\isDataEncrypted()) {
checkErrors(
$errors,
array('CE258', '0'),
Expand All @@ -142,7 +148,7 @@ for ($i = 0; $i < sizeof($columnEncryption); ++$i) {
} else {
// The INSERT query succeeded with bad credentials, which
// should only happen when encryption is not enabled.
if (AE\isColEncrypted()) {
if (AE\isDataEncrypted()) {
fatalError("Successful insertion with bad credentials\n");
}
}
Expand Down

0 comments on commit 4509756

Please sign in to comment.