utelle / SQLite3MultipleCiphers

SQLite3 encryption extension with support for multiple ciphers
https://utelle.github.io/SQLite3MultipleCiphers/
MIT License
382 stars 73 forks source link

Various symbols should be SQLITE_PRIVATE or SQLITE_API #166

Closed rogerbinns closed 3 months ago

rogerbinns commented 3 months ago

There are various crypto symbols that in the amalgamation should be declared SQLITE_PRIVATE because they are private to this library. Similarly sqlite3mc_initialize/shutdown should be SQLITE_API.

apsw sets SQLITE_API and SQLITE_EXTERN to static and the resulting DLL contains a single exported symbol required by Python to load the extension. To repeat do this in the apsw-sqlite3mc project under Linux:

python3 setup.py build_ext --inplace --force --enable-all-extensions
nm  --extern-only --defined-only apsw/__init__.*.so | awk '{print $3}' | grep -v PyInit_apsw

Current list of publicly exported symbols:

ascon_aead_decrypt
ascon_aead_encrypt
ascon_hash
ascon_pbkdf2
ascon_pbkdf2_init
chacha20_ismemset
chacha20_rng
chacha20_xor
fastpbkdf2_hmac_sha1
fastpbkdf2_hmac_sha256
fastpbkdf2_hmac_sha512
poly1305
poly1305_tagcmp
RijndaelBlockDecrypt
RijndaelBlockEncrypt
RijndaelCreate
RijndaelDecrypt
RijndaelEncrypt
RijndaelInit
RijndaelInvalidate
RijndaelKeyEncToDec
RijndaelKeySched
RijndaelPadDecrypt
RijndaelPadEncrypt
sha1_final
sha1_init
sha1_transform
sha1_update
sha224
sha224_final
sha224_h0
sha224_init
sha224_update
sha256
sha256_final
sha256_h0
sha256_init
sha256_k
sha256_transform
sha256_update
sha384
sha384_final
sha384_h0
sha384_init
sha384_update
sha512
sha512_final
sha512_h0
sha512_init
sha512_k
sha512_transform
sha512_update
sqlcipher_hmac
sqlite3mc_initialize
sqlite3mc_shutdown
utelle commented 3 months ago

I will adjust the function signatures accordingly.

utelle commented 3 months ago

The attribute SQLITE_PRIVATE was added to several internal functions (where it was missing) in commit 56ac1e2f7a703efe2924ea0fa0691bbe03bb03f4.

rogerbinns commented 3 months ago

Confirmed - no external symbols visible now.