Skip to content

Commit 79a50de

Browse files
committed
Prepare release of wxSQLite3 4.9.8
- Update to SQLite3 Multiple Ciphers 1.8.0 (based on SQLite 3.44.1) - Added new cipher scheme Ascon-128 (Lightweight Authenticated Encryption)
1 parent 2358974 commit 79a50de

9 files changed

+2137
-125
lines changed

configure.ac

+16-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl Copyright (C) 2017-2023 Ulrich Telle <[email protected]>, Vadim Zeitlin
44
dnl
55
dnl This file is covered by the same licence as the entire wxSQLite3 package.
66

7-
AC_INIT([wxsqlite3], [4.9.7], [[email protected]])
7+
AC_INIT([wxsqlite3], [4.9.8], [[email protected]])
88

99
dnl This is the version tested with, might work with earlier ones.
1010
AC_PREREQ([2.69])
@@ -82,13 +82,23 @@ AC_ARG_WITH([rc4],
8282
AS_IF([test "x$with_rc4" = xno],
8383
[AC_DEFINE([WXSQLITE3_HAVE_CIPHER_RC4], [0], [Define if you have RC4 disabled])])
8484

85+
AC_ARG_WITH([ascon128],
86+
[AS_HELP_STRING([--without-ascon128],
87+
[Disable support for Ascon 128 Encryption])],
88+
[],
89+
[with_ascon128=yes])
90+
91+
AS_IF([test "x$with_ascon128" = xno],
92+
[AC_DEFINE([WXSQLITE3_HAVE_CIPHER_ASCON128], [0], [Define if you have Ascon 128 disabled])])
93+
8594
AC_ARG_ENABLE(codec,
8695
[ --enable-codec[=<codec type>] Specify the codec type:
8796
aes128: AES 128 Bit CBC Encryption
8897
aes256: AES 256 Bit CBC Encryption
8998
chacha20 [default]: ChaCha20-Poly1305 Encryption
9099
sqlcipher: SQLCipher Encryption
91-
rc4: RC4 Encryption],
100+
rc4: RC4 Encryption
101+
ascon128: Ascon 128 Encryption],
92102
[if test "x$enableval" = "xaes128" && test "x$with_aes128cbc" = xyes ; then
93103
codec_type=CODEC_TYPE_AES128
94104
elif test "x$enableval" = "xaes256" && test "x$with_aes256cbc" = xyes ; then
@@ -99,6 +109,8 @@ AC_ARG_ENABLE(codec,
99109
codec_type=CODEC_TYPE_SQLCIPHER
100110
elif test "x$enableval" = "xrc4" && test "x$with_rc4" = xyes ; then
101111
codec_type=CODEC_TYPE_RC4
112+
elif test "x$enableval" = "xascon128" && test "x$with_ascon128" = xyes ; then
113+
codec_type=CODEC_TYPE_ASCON128
102114
else
103115
echo
104116
echo "Error!"
@@ -112,7 +124,8 @@ AS_IF([test "x$with_aes128cbc" = xno &&
112124
test "x$with_aes256cbc" = xno &&
113125
test "x$with_chacha20" = xno &&
114126
test "x$with_sqlcipher" = xno &&
115-
test "x$with_rc4" = xno],
127+
test "x$with_rc4" = xno &&
128+
test "x$with_ascon128" = xno],
116129
[AC_DEFINE([WXSQLITE3_HAVE_CODEC], [0], [All ciphers disabled so encryption is disabled])])
117130

118131
dnl We only need the libraries above for the main library itself, but the

include/wx/wxsqlite3.h

+70-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ enum wxSQLite3CipherType
3838
WXSQLITE_CIPHER_AES256,
3939
WXSQLITE_CIPHER_CHACHA20,
4040
WXSQLITE_CIPHER_SQLCIPHER,
41-
WXSQLITE_CIPHER_RC4
41+
WXSQLITE_CIPHER_RC4,
42+
WXSQLITE_CIPHER_ASCON128
4243
};
4344

4445
#define WXSQLITE_ERROR 1000
@@ -133,6 +134,7 @@ enum wxSQLite3StatementStatus
133134
#define WXSQLITE_DIRECTONLY 0x000080000
134135
#define WXSQLITE_SUBTYPE 0x000100000
135136
#define WXSQLITE_INNOCUOUS 0x000200000
137+
#define WXSQLITE_RESULT_SUBTYPE 0x001000000
136138

137139
inline void operator++(wxSQLite3LimitType& value)
138140
{
@@ -1221,6 +1223,73 @@ class WXDLLIMPEXP_SQLITE3 wxSQLite3CipherRC4 : public wxSQLite3Cipher
12211223
bool m_legacy; ///< Flag for legacy mode
12221224
};
12231225

1226+
/// Cipher class representing Ascon-128 encryption with Ascon tag
1227+
class WXDLLIMPEXP_SQLITE3 wxSQLite3CipherAscon128 : public wxSQLite3Cipher
1228+
{
1229+
public:
1230+
/// Constructor
1231+
wxSQLite3CipherAscon128();
1232+
1233+
/// Copy constructor
1234+
wxSQLite3CipherAscon128(const wxSQLite3CipherAscon128& cipher);
1235+
1236+
/// Destructor
1237+
virtual ~wxSQLite3CipherAscon128();
1238+
1239+
/// Initialize the cipher instance based on global default settings
1240+
/**
1241+
* The parameters of the cipher instance are initialize with the global default settings of the associated cipher type.
1242+
* \return true if the cipher instance could be initialized successfully, false otherwise
1243+
*/
1244+
virtual bool InitializeFromGlobalDefault();
1245+
1246+
/// Initialize the cipher instance based on current settings
1247+
/**
1248+
* The parameters of the cipher instance are initialize with the current settings of the associated cipher type
1249+
* as defined in the given database connection.
1250+
* \param db database instance representing a database connection
1251+
* \return true if the cipher instance could be initialized successfully, false otherwise
1252+
*/
1253+
virtual bool InitializeFromCurrent(wxSQLite3Database& db);
1254+
1255+
/// Initialize the cipher instance based on current default settings
1256+
/**
1257+
* The parameters of the cipher instance are initialize with the current default settings of the associated cipher type
1258+
* as defined in the given database connection.
1259+
* \param db database instance representing a database connection
1260+
* \return true if the cipher instance could be initialized successfully, false otherwise
1261+
*/
1262+
virtual bool InitializeFromCurrentDefault(wxSQLite3Database& db);
1263+
1264+
/// Apply the cipher parameters to a database connection
1265+
/**
1266+
* The parameters of the cipher instance are applied to the given database connection.
1267+
* \param db database instance representing a database connection
1268+
* \return true if the cipher parameters could be applied successfully, false otherwise
1269+
*/
1270+
virtual bool Apply(wxSQLite3Database& db) const;
1271+
virtual bool Apply(void* dbHandle) const;
1272+
1273+
#if 0
1274+
// Currently no legacy mode available
1275+
/// Set legacy mode
1276+
void SetLegacy(bool legacy) { m_legacy = legacy; }
1277+
1278+
/// Get legacy mode
1279+
bool GetLegacy() const { return m_legacy; }
1280+
#endif
1281+
1282+
/// Set iteration count of KDF function for ordinary key
1283+
void SetKdfIter(int kdfIter) { m_kdfIter = kdfIter; }
1284+
1285+
/// Get iteration count of KDF function for ordinary key
1286+
int GetKdfIter() const { return m_kdfIter; }
1287+
1288+
private:
1289+
bool m_legacy; ///< Flag for legacy mode
1290+
int m_kdfIter; ///< Iteration count for KDF function
1291+
};
1292+
12241293

12251294
/// Interface for a user defined hook function
12261295
/**

include/wx/wxsqlite3_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#define WXSQLITE3_MAJOR_VERSION 4
1616
#define WXSQLITE3_MINOR_VERSION 9
17-
#define WXSQLITE3_RELEASE_NUMBER 7
17+
#define WXSQLITE3_RELEASE_NUMBER 8
1818
#define WXSQLITE3_SUBRELEASE_NUMBER 0
19-
#define WXSQLITE3_VERSION_STRING "wxSQLite3 4.9.7"
19+
#define WXSQLITE3_VERSION_STRING "wxSQLite3 4.9.8"
2020

2121
#endif // WXSQLITE3_VERSION_H_

include/wx/wxsqlite3def.h

+7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@
4646
4747
<dl>
4848
49+
<dt><b>4.9.8</b> - <i>November 2023</i></dt>
50+
<dd>
51+
Upgrade to <i>SQLite3 Multiple Ciphers version 1.8.0 (SQLite version 3.44.1)</i><br>
52+
Added new cipher scheme Ascon-128 (Lightweight Authenticated Encryption)
53+
54+
</dd>
55+
4956
<dt><b>4.9.7</b> - <i>November 2023</i></dt>
5057
<dd>
5158
Upgrade to <i>SQLite3 Multiple Ciphers version 1.7.4 (SQLite version 3.44.0)</i><br>

readme.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Currently the following encryption schemes are supported:
2828
- AES 256 Bit CBC - No HMAC ([wxSQLite3](https://github.com/utelle/wxsqlite3))
2929
- ChaCha20 - Poly1305 HMAC ([sqleet](https://github.com/resilar/sqleet)) (**default**)
3030
- AES 256 Bit CBC - SHA1/SHA256/SHA512 HMAC ([SQLCipher](https://www.zetetic.net/sqlcipher/) versions 1 - 4)
31-
- RC4 - No HMAC ([System.Data.SQLite](http://system.data.sqlite.org/))
31+
- RC4 - No HMAC ([System.Data.SQLite](https://system.data.sqlite.org/))
32+
- Ascon 128 - Ascon Tag ([Ascon](https://ascon.iaik.tugraz.at/)) (since version 4.9.8)
3233

3334
## Important Notes
3435

@@ -48,6 +49,9 @@ Since August 2020 a new implementation of an encryption extension, capable of su
4849

4950
## <a name="history"></a>Version history
5051

52+
* 4.9.8 - *November 2023*
53+
- Upgrade to SQLite3 Multiple Ciphers version 1.8.0 (SQLite version 3.44.1)
54+
- Added new cipher scheme Ascon-128 (Lightweight Authenticated Encryption)
5155
* 4.9.7 - *November 2023*
5256
- Upgrade to SQLite3 Multiple Ciphers version 1.7.4 (SQLite version 3.44.0)
5357
- Prevent crashes due to uninitialized cipher tables (issue #113)

samples/treeview/treeviewapp.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ TreeviewSampleApp::OnInit()
102102
int
103103
TreeviewSampleApp::OnExit()
104104
{
105+
try
106+
{
107+
m_db.Close();
108+
}
109+
catch (wxSQLite3Exception& e)
110+
{
111+
}
112+
105113
wxSQLite3Database::ShutdownSQLite();
106114
return wxApp::OnExit();
107115
}

0 commit comments

Comments
 (0)