@@ -89,6 +89,13 @@ int codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLeft, const c
89
89
90
90
CODEC_TRACE (("codec_pragma: entered db=%p iDb=%d pParse=%p zLeft=%s zRight=%s ctx=%p\n" , db , iDb , pParse , zLeft , zRight , ctx ));
91
91
92
+ if ( sqlite3StrICmp (zLeft , "cipher_migrate" )== 0 && !zRight ){
93
+ if (ctx ){
94
+ char * migrate_status = sqlite3_mprintf ("%d" , sqlcipher_codec_ctx_migrate (ctx ));
95
+ codec_vdbe_return_static_string (pParse , "sqlcipher_migrate" , migrate_status );
96
+ sqlite3_free (migrate_status );
97
+ }
98
+ } else
92
99
if ( sqlite3StrICmp (zLeft , "cipher_provider" )== 0 && !zRight ){
93
100
if (ctx ) { codec_vdbe_return_static_string (pParse , "cipher_provider" ,
94
101
sqlcipher_codec_get_cipher_provider (ctx ));
@@ -421,13 +428,11 @@ int sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey) {
421
428
void sqlite3CodecGetKey (sqlite3 * db , int nDb , void * * zKey , int * nKey ) {
422
429
struct Db * pDb = & db -> aDb [nDb ];
423
430
CODEC_TRACE (("sqlite3CodecGetKey: entered db=%p, nDb=%d\n" , db , nDb ));
424
-
425
431
if ( pDb -> pBt ) {
426
432
codec_ctx * ctx ;
427
433
sqlite3pager_get_codec (pDb -> pBt -> pBt -> pPager , (void * * ) & ctx );
428
-
429
434
if (ctx ) { /* if the codec has an attached codec_context user the raw key data */
430
- sqlcipher_codec_get_pass (ctx , zKey , nKey );
435
+ sqlcipher_codec_get_keyspec (ctx , zKey , nKey );
431
436
} else {
432
437
* zKey = NULL ;
433
438
* nKey = 0 ;
0 commit comments