Skip to content

Commit 7dbc295

Browse files
committed
Replaces fortuna seeding mechanism for libtomcrypt with rng_get_bytes()
1 parent ea37f3d commit 7dbc295

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Notable changes to this project are documented in this file.
44
## [4.11.0] - (? 2025 - [4.11.0 changes])
55
- Converts log output to UTF-16 when writing to stdout or stderr on Windows
66
- Fixes scope issues to allow --disable-amalgamation to work properly
7+
- Replaces fortuna seeding mechanism for libtomcrypt with rng_get_bytes()
78
- Removes CocoaPods support (SQLCipher.podspec.json)
89

910
## [4.10.0] - (August 2025 - [4.10.0 changes])

src/crypto_libtomcrypt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static int sqlcipher_ltc_add_random(void *ctx, const void *buffer, int length) {
7373

7474
static int sqlcipher_ltc_activate(void *ctx) {
7575
unsigned char random_buffer[FORTUNA_MAX_SZ];
76+
int bytes = 0;
7677

7778
sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_MUTEX, "sqlcipher_ltc_activate: entering SQLCIPHER_MUTEX_PROVIDER_ACTIVATE");
7879
sqlite3_mutex_enter(sqlcipher_mutex(SQLCIPHER_MUTEX_PROVIDER_ACTIVATE));
@@ -94,8 +95,9 @@ static int sqlcipher_ltc_activate(void *ctx) {
9495
ltc_ref_count++;
9596

9697
#ifndef SQLCIPHER_TEST
97-
sqlite3_randomness(FORTUNA_MAX_SZ, random_buffer);
98+
bytes = rng_get_bytes(random_buffer, FORTUNA_MAX_SZ, NULL);
9899
#endif
100+
sqlcipher_log(SQLCIPHER_LOG_TRACE, SQLCIPHER_LOG_PROVIDER, "sqlcipher_ltc_activate: seeded fortuna with %d bytes from rng_get_bytes", bytes);
99101

100102
if(sqlcipher_ltc_add_random(ctx, random_buffer, FORTUNA_MAX_SZ) != SQLITE_OK) {
101103
return SQLITE_ERROR;

0 commit comments

Comments
 (0)