php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50858 $encryption_key parameter seems to be ineffective
Submitted: 2010-01-27 10:12 UTC Modified: 2010-06-13 20:05 UTC
From: roger dot olivier at gmail dot com Assigned: scottmac (profile)
Status: Not a bug Package: SQLite related
PHP Version: 5.3.1 OS: win32 only - Windows XP Sp3
Private report: No CVE-ID: None
 [2010-01-27 10:12 UTC] roger dot olivier at gmail dot com
Description:
------------
The use of the encryption_key parameter in the SQLite3::open method don't works whereas the sqlite3 extension is compiled with the support of SEE (http://www.hwaci.com/sw/sqlite/see.html)

The extension as been compiled in VC9 with the following configure : 
configure --enable-apache2-2handler --with-sqlite3=shared --enable-pdo=shared --with-pdo-sqlite=shared --enable-cgi --without-t1lib --enable-cli-win32 --with-extra-includes=d:/projets/php-sdk/Apache2/include;d:/projets/php-sdk/icu/include --with-extra-libs=d:/projets/php-sdk/Apache2/lib;d:/projets/php-sdk/icu/

The new php_sqlite3.dll and php_pdo_sqlite.dll are used to replace the dll present in the binary (still 5.3.1 VC9).

Note : The use of PRAGMA key = 'mykey' works fine , it's just the use of the encryption_key parameter which seems broken

Reproduce code:
---------------
<?php
$db = new SQLite3('db/mydb.crypt',SQLITE3_OPEN_READWRITE,'aes128:mykey');
$result = $db->query('SELECT COUNT(*) from users');
var_dump($result->fetchArray());
?>

Expected result:
----------------
array(2) { [0]=>  int(1) ["COUNT(*)"]=>  int(1) } 

Actual result:
--------------
Unable to prepare statement: 26, file is encrypted or is not a database in

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-09 23:00 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: scottmac
 [2010-06-13 20:04 UTC] felipe@php.net
-Status: Assigned +Status: Closed
 [2010-06-13 20:04 UTC] felipe@php.net
The encryption_key will be used if the SQLITE_HAS_CODEC was properly defined in the build.
 [2010-06-13 20:05 UTC] felipe@php.net
-Status: Closed +Status: Bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC