how do you check? I mean the code that does the check only!silverstorm82 wrote:I am sorry to ask again for help here.
I used the sqlite3.lib/.dll in the /sqlite3/secure subfolder and copied the files to sqlite3/lib subdirectory and compiled wxSQLite3. But HasEncryptionSupport() still returns false and when using ReKey() an exception is thrown ("Encryption support not available").
Any ideas here? If I understood correctly the preprocessor symbols
SQLITE_HAS_CODEC
CODEC_TYPE=CODEC_TYPE_AES128
SQLITE_CORE
THREADSAFE=1
have to be set when wxSQLite ist compiled, which I did. As the explanation in the readme is not very clear about where to set the symbols exactly, could you provide a detailled description please?
Greetings,
Jens
Compile wxSQLite with encryption and linkingSQLite3.dll sta Topic is solved
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
The check was performed after having opened the database file:
All included in a derived class of wxSQLite3Database. The reason why there are two check with HasEncryptionSupport() is that I thought that ReKey might change the status.
Code: Select all
try
{
wxASSERT(HasEncryptionSupport());
ReKey(wxT("TEST"));
wxASSERT(HasEncryptionSupport());
}
catch (wxSQLite3Exception& err)
{
wxMessageBox(err.GetMessage());
}
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Does demo that comes with wxSqlite3 work?
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Well, I can use wxSQLite3 and SQLite databases quite well without any problems. The only thing that does not work is the encryption support.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
If you link example with same library and run it, it will print messages including if encryption works ok. How did you compile wxSQLite3 anyway?silverstorm82 wrote:Well, I can use wxSQLite3 and SQLite databases quite well without any problems. The only thing that does not work is the encryption support.
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
I can see from sample the code issilverstorm82 wrote:The check was performed after having opened the database file:
All included in a derived class of wxSQLite3Database. The reason why there are two check with HasEncryptionSupport() is that I thought that ReKey might change the status.Code: Select all
try { wxASSERT(HasEncryptionSupport()); ReKey(wxT("TEST")); wxASSERT(HasEncryptionSupport()); } catch (wxSQLite3Exception& err) { wxMessageBox(err.GetMessage()); }
Code: Select all
if (wxSQLite3Database::HasEncryptionSupport())
{
db.Open(dbFile, wxString(wxT("password")));
}
else
{
db.Open(dbFile);
}
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Well, the minimal example crashes at startup (unhandled exception). Update HERE: The minimal example works now but skips all tests regarding encryption.
I compiled the wxSqlite3 using the Visual Studio solution which was no problem.
returns false
Just to make clear what I already did:
1.) Copied the sqlite3.lib from sqlite3/secure/aes128 to the sqlite3/lib directory. However, the last time I compiled wxSQLite3 I linked directly to the file in the aes128 directory instead of the file in the sqlite3/lib directory.
2.) Compiled wxSQLite3 using the standard settings.
3.) Linked my project against those compiled files.
4.) Copied the .dll files to the working directory of my project.
I compiled the wxSqlite3 using the Visual Studio solution which was no problem.
Code: Select all
wxASSERT(wxSQLite3Database::HasEncryptionSupport());
Just to make clear what I already did:
1.) Copied the sqlite3.lib from sqlite3/secure/aes128 to the sqlite3/lib directory. However, the last time I compiled wxSQLite3 I linked directly to the file in the aes128 directory instead of the file in the sqlite3/lib directory.
2.) Compiled wxSQLite3 using the standard settings.
3.) Linked my project against those compiled files.
4.) Copied the .dll files to the working directory of my project.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
can you recompile/link the wxsqlite3?silverstorm82 wrote:Well, the minimal example crashes at startup (unhandled exception). Update HERE: The minimal example works now but skips all tests regarding encryption.
I compiled the wxSqlite3 using the Visual Studio solution which was no problem.
returns falseCode: Select all
wxASSERT(wxSQLite3Database::HasEncryptionSupport());
Just to make clear what I already did:
1.) Copied the sqlite3.lib from sqlite3/secure/aes128 to the sqlite3/lib directory. However, the last time I compiled wxSQLite3 I linked directly to the file in the aes128 directory instead of the file in the sqlite3/lib directory.
2.) Compiled wxSQLite3 using the standard settings.
3.) Linked my project against those compiled files.
4.) Copied the .dll files to the working directory of my project.
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
I already did to make sure that I linked against correct sqlite3.dll...
Perhaps I've got to compile the sqlite3.lib / .dll myself instead of using the one that is provided in the sqlite3/secure/aes128 directory. That's the last idea I have.
Perhaps I've got to compile the sqlite3.lib / .dll myself instead of using the one that is provided in the sqlite3/secure/aes128 directory. That's the last idea I have.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
You should have done that in the first place and copy it to the dir you want. refere tosilverstorm82 wrote:I already did to make sure that I linked against correct sqlite3.dll...
Perhaps I've got to compile the sqlite3.lib / .dll myself instead of using the one that is provided in the sqlite3/secure/aes128 directory. That's the last idea I have.
http://forums.wxwidgets.org/viewtopic.p ... 17#p116512
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Well, the readme states that for windows, precompiled .lib and .dll files are provided in the aes128 subdirectory... That's what I tried. However, recompiling did not work as well.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
How did you recompile?silverstorm82 wrote:However, recompiling did not work as well.
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Like in the instructions:
1.) Created any empty project for a static linked library called sqlite3secure
2.) Copied all files from sqlite3/secure/src/codec-c to the projects directory.
3.) Downloaded the amalgamation sources from the mentioned website and extracted the contents to the projects directory, which is the step of copying the amalgamation souces to the codec-c directory.
4.) Set the preprocessor directives SQLITE_HAS_CODEC and CODEC_TYPE=CODEC_TYPE_AES128.
5.) Compiled the project, which worked fine and resulted in a sqlite3secure.lib file.
6.) Opened the wxSQLite3 project file and changed all references from sqlite3.lib to sqlite3secure.lib so that wxSQLite3 is linked against the just compiled library file.
7.) Compiled wxSQLite3 (worked fine).
Did I miss anything?
1.) Created any empty project for a static linked library called sqlite3secure
2.) Copied all files from sqlite3/secure/src/codec-c to the projects directory.
3.) Downloaded the amalgamation sources from the mentioned website and extracted the contents to the projects directory, which is the step of copying the amalgamation souces to the codec-c directory.
4.) Set the preprocessor directives SQLITE_HAS_CODEC and CODEC_TYPE=CODEC_TYPE_AES128.
5.) Compiled the project, which worked fine and resulted in a sqlite3secure.lib file.
6.) Opened the wxSQLite3 project file and changed all references from sqlite3.lib to sqlite3secure.lib so that wxSQLite3 is linked against the just compiled library file.
7.) Compiled wxSQLite3 (worked fine).
Did I miss anything?
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Yes. On compiling wxSQLite3 itself you have to specify the preprocessor symbol WXSQLITE3_HAVE_CODEC. This can be done from the preprocessor settings of your IDE (or from the command line of make) or by editing the header file wxsqlite3opt.h.silverstorm82 wrote:Like in the instructions:
1.) Created any empty project for a static linked library called sqlite3secure
2.) Copied all files from sqlite3/secure/src/codec-c to the projects directory.
3.) Downloaded the amalgamation sources from the mentioned website and extracted the contents to the projects directory, which is the step of copying the amalgamation souces to the codec-c directory.
4.) Set the preprocessor directives SQLITE_HAS_CODEC and CODEC_TYPE=CODEC_TYPE_AES128.
5.) Compiled the project, which worked fine and resulted in a sqlite3secure.lib file.
6.) Opened the wxSQLite3 project file and changed all references from sqlite3.lib to sqlite3secure.lib so that wxSQLite3 is linked against the just compiled library file.
7.) Compiled wxSQLite3 (worked fine).
Did I miss anything?
BTW the readme file coming with wxSQLite3 is very clear in this respect. Under the heading "Optional key based database encryption support" you find the following note:
Regards,Additionally the preprocessor symbol WXSQLITE3_HAVE_CODEC must be defined when compiling wxSQLite3.
Ulrich
-
- Knows some wx things
- Posts: 32
- Joined: Wed Aug 17, 2011 5:13 pm
Re: Compile wxSQLite with encryption and linkingSQLite3.dll
Hello Ulrich,
thank you for the reply. It worked now. I must admit that I did not recognize that sentence in the readme.txt file as in my opinion the instructions in this thread were the same as in the readme. But the weren't. I am sorry for my mistake.
Anyway, thanks to you both for all your patience and your help on this problem.
Greetings,
Jens
thank you for the reply. It worked now. I must admit that I did not recognize that sentence in the readme.txt file as in my opinion the instructions in this thread were the same as in the readme. But the weren't. I am sorry for my mistake.
Anyway, thanks to you both for all your patience and your help on this problem.
Greetings,
Jens