Bug#910394: sqlcipher: Crashes on running any SQL Statement (with a key)

2018-10-25 Thread Mark Eichin
Oh, this is already known upstream: 
https://github.com/sqlcipher/sqlcipher/issues/196

so it should be "merely" a matter of getting the sid version into 
stretch-backports.



Bug#910394: sqlcipher: Crashes on running any SQL Statement (with a key)

2018-10-24 Thread Mark Eichin
Freshly installed to test this:

i-meant-that$ dpkg --status sqlcipher|grep Version
Version: 3.2.0-2
i-meant-that$ sqlcipher mydata.db
SQLCipher version 3.8.6 2014-08-15 11:46:33
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> pragma key = 'passphrase';
sqlite> create table memos(text, priority INTEGER);
Segmentation fault

ie. one line from https://www.zetetic.net/sqlcipher/sqlcipher-api/ about
actually setting a key, plus the first line of the man page example.

(Bonus points for maybe adding any mention at all of "pragma key" to the man 
page :-)

i-meant-that$ gdb --quiet -ex run --args sqlcipher mydata.db
SQLCipher version 3.8.6 2014-08-15 11:46:33
sqlite> pragma key = 'passphrase';
sqlite> create table memos(text, priority INTEGER);

Program received signal SIGSEGV, Segmentation fault.
0x76fc195f in EVP_EncryptUpdate () from 
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
(gdb) where
#0  0x76fc195f in EVP_EncryptUpdate () from 
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#1  0x77b22e3b in sqlcipher_openssl_cipher (ctx=0x5579c238, 
mode=, key=0x5579c258 
"\352U\243\236\375\266\026\037\242\247\370\232\215\323\063O\362-w\367\223c\242ɑ^W_]\254#)",
key_sz=, iv=0x55797f98 
"+\372\032\331\003O\271\246\201>\210\210\360\375W\034\253p\227\303\315\331Y\210@\252\233\\\212<\032y\177\334\330\030\231\213F\177.\365\032\222\360\063\361\067q",
in=0x5579d1b8 "\004", in_sz=960, out=0x55797bd8 "") at 
sqlite3.c:16517
#2  0x77b3347e in sqlcipher_page_cipher (ctx=ctx@entry=0x55797b38, 
for_ctx=, pgno=1, mode=1, page_sz=, 
in=0x5579d1b8 "\004", out=0x55797bd8 "") at sqlite3.c:15696
#3  0x77b45104 in sqlite3Codec (iCtx=0x55797b38, 
data=0x5579d1a8, pgno=1, mode=6) at sqlite3.c:14389
#4  0x77b53799 in pager_write_pagelist 
(pPager=pPager@entry=0x55785a78, pList=0x5579d5e0) at sqlite3.c:48086
#5  0x77b5b5fa in sqlite3PagerCommitPhaseOne (pPager=0x55785a78, 
zMaster=zMaster@entry=0x0, noSync=noSync@entry=0) at sqlite3.c:50033
#6  0x77b5b7cf in sqlite3PagerCommitPhaseOne (noSync=0, zMaster=0x0, 
pPager=) at sqlite3.c:49932
#7  sqlite3BtreeCommitPhaseOne (p=0x55785558, zMaster=zMaster@entry=0x0) at 
sqlite3.c:57764
#8  0x77b5f421 in sqlite3BtreeCommitPhaseOne (zMaster=0x0, p=) at sqlite3.c:89551
#9  vdbeCommit (p=0x5579cb48, db=0x5576ec58) at sqlite3.c:1586
#10 sqlite3VdbeHalt (p=p@entry=0x5579cb48) at sqlite3.c:1993
#11 0x77b8e926 in sqlite3VdbeExec (p=p@entry=0x5579cb48) at 
sqlite3.c:71867
#12 0x77b8f8cf in sqlite3Step (p=0x5579cb48) at sqlite3.c:69631
#13 sqlite3_step (pStmt=) at sqlite3.c:4161
#14 0xa9d3 in shell_exec (db=0x5576ec58, zSql=0x5576ebc0 
"create table memos(text, priority INTEGER);", pArg=0x7fffd2d0, 
pzErrMsg=0x7fffd138, xCallback=0x9a90 )
at ./src/shell.c:1360
#15 0xbbdf in process_input (p=0x7fffd2d0, in=0x0) at 
./src/shell.c:3613
#16 0x7406 in main (argc=, argv=) at 
./src/shell.c:4129