1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Add the SQLITE_ENABLE_API_ARMOR compile-time option. This is a work in

progress and is not yet completely functional.

FossilOrigin-Name: c297a84bc678f81ffc0aa9139ab73f0ca87c1971
This commit is contained in:
drh
2014-10-24 00:35:58 +00:00
parent 4f81bbb528
commit 9ca95730e3
20 changed files with 351 additions and 46 deletions

View File

@@ -34,6 +34,11 @@ void sqlite3_randomness(int N, void *pBuf){
unsigned char t;
unsigned char *zBuf = pBuf;
#ifndef SQLITE_OMIT_AUTOINIT
if( sqlite3_initialize() ) return;
#endif
if( pBuf==0 || N<=0 ) return;
/* The "wsdPrng" macro will resolve to the pseudo-random number generator
** state vector. If writable static data is unsupported on the target,
** we have to locate the state vector at run-time. In the more common
@@ -52,12 +57,6 @@ void sqlite3_randomness(int N, void *pBuf){
sqlite3_mutex_enter(mutex);
#endif
if( N<=0 ){
wsdPrng.isInit = 0;
sqlite3_mutex_leave(mutex);
return;
}
/* Initialize the state of the random number generator once,
** the first time this routine is called. The seed value does
** not need to contain a lot of randomness since we are not