@@ -89,6 +89,13 @@ int codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLeft, const c
8989
9090 CODEC_TRACE (("codec_pragma: entered db=%p iDb=%d pParse=%p zLeft=%s zRight=%s ctx=%p\n" , db , iDb , pParse , zLeft , zRight , ctx ));
9191
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
9299 if ( sqlite3StrICmp (zLeft , "cipher_provider" )== 0 && !zRight ){
93100 if (ctx ) { codec_vdbe_return_static_string (pParse , "cipher_provider" ,
94101 sqlcipher_codec_get_cipher_provider (ctx ));
@@ -421,13 +428,11 @@ int sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey) {
421428void sqlite3CodecGetKey (sqlite3 * db , int nDb , void * * zKey , int * nKey ) {
422429 struct Db * pDb = & db -> aDb [nDb ];
423430 CODEC_TRACE (("sqlite3CodecGetKey: entered db=%p, nDb=%d\n" , db , nDb ));
424-
425431 if ( pDb -> pBt ) {
426432 codec_ctx * ctx ;
427433 sqlite3pager_get_codec (pDb -> pBt -> pBt -> pPager , (void * * ) & ctx );
428-
429434 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 );
431436 } else {
432437 * zKey = NULL ;
433438 * nKey = 0 ;
0 commit comments