Skip to content

Commit 5b74cef

Browse files
committed
Fix wrong cipher selection (issue #26)
If cipher schemes 'aes128cbc' and/or 'aes256cbc' are excluded from the build, selecting the cipher via URI parameter leads to a crash, because a wrong (excluded) cipher is selected due to using the wrong cipher index.
1 parent ae6459c commit 5b74cef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cipher_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,11 @@ sqlite3mcConfigureFromUri(sqlite3* db, const char *zDbName, int configDefault)
654654
int hmacCheck = sqlite3_uri_boolean(dbFileName, "hmac_check", 1);
655655
if (configDefault)
656656
{
657-
sqlite3mc_config(db, "default:cipher", j);
657+
sqlite3mc_config(db, "default:cipher", globalCodecParameterTable[j].m_id);
658658
}
659659
else
660660
{
661-
sqlite3mc_config(db, "cipher", j);
661+
sqlite3mc_config(db, "cipher", globalCodecParameterTable[j].m_id);
662662
}
663663
if (!hmacCheck)
664664
{

0 commit comments

Comments
 (0)