Skip to content
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

Adjust encryption tests to check sqlite3mc #567

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

utelle
Copy link
Contributor

@utelle utelle commented Nov 10, 2023

  • Adjust existing tests to work with sqlite3mc (access with default encryption scheme)
  • Add tests for accessing SQLCipher encrypted databases via sqlite3mc

- Adjust existing tests to work with sqlite3mc (access with default encryption scheme)
- Add tests for accessing SQLCipher encrypted databases via sqlite3mc
@utelle
Copy link
Contributor Author

utelle commented Nov 10, 2023

@ericsink
Unfortunately, the encryption tests failed again. The reason is that obviously the test database files were not copied to the working directory of the test application. When a database file is not found SQLite will create a new database file (unless told otherwise). And of course the new empty database file doesn't have the tables that are queried.

I had added the following lines in the test project files:

  <ItemGroup>
    <None Update="..\common\sqlcipher-2.0-beta-testkey.db" CopyToOutputDirectory="PreserveNewest" />
    <None Update="..\common\sqlcipher-4.0-testkey.db" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

That had worked in my own repo, but does not here. What do I have to specify that the database files are copied to the right directory?

@ericsink
Copy link
Owner

Ah, I see. I hadn't looked at the PR content at all yet, so I didn't notice those new files. Up until now, tests_xunit.cs hasn't needed any dependencies.

The first problem I see is that the two csproj files you modified are not actually the ones used during tests.

Sorry for the confusion -- this repo isn't very intuitive.

Let me take a look at this myself. You've written the tests. I'll try to get them integrated.

@ericsink ericsink merged commit c0d263f into ericsink:master Nov 10, 2023
1 check failed
@utelle
Copy link
Contributor Author

utelle commented Nov 10, 2023

Ah, I see. I hadn't looked at the PR content at all yet, so I didn't notice those new files. Up until now, tests_xunit.cs hasn't needed any dependencies.

I would love to get away without dependent database files. Theoretically, the library could generate encrypted database files on its own, but that would make the test useless, because it would only prove that the library can read and write databases created by itself. But we want to test that we can read and write original SQLCipher database files.

The first problem I see is that the two csproj files you modified are not actually the ones used during tests.

Oops, I haven't searched at different locations after having found the project files I modified.

Let me take a look at this myself. You've written the tests. I'll try to get them integrated.

Obviously, you managed to do that. Thanks.

@ericsink
Copy link
Owner

Actually so far I just merged the PR leaving it broken. I'm working now on fixing it. 😬

@utelle
Copy link
Contributor Author

utelle commented Nov 10, 2023

Actually so far I just merged the PR leaving it broken. I'm working now on fixing it. 😬

Yeah, I saw that now, but only after I had already submiited my previous comment.

It shouldn't be too difficult to fix, once the right project file(s) is/are identified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants