Development snapshot
This commit is contained in:
parent
16a5ace434
commit
6870add18f
|
@ -107,14 +107,16 @@ class Hooks {
|
|||
* @param array $params keys: uid, password
|
||||
*/
|
||||
public static function setPassphrase( $params ) {
|
||||
|
||||
trigger_error("HOSH");
|
||||
// Only attempt to change passphrase if server-side encryption
|
||||
// is in use (client-side encryption does not have access to
|
||||
// the necessary keys)
|
||||
if ( Crypt::mode() == 'server' ) {
|
||||
|
||||
$session = new Session();
|
||||
|
||||
// Get existing decrypted private key
|
||||
$privateKey = $_SESSION['privateKey'];
|
||||
$privateKey = $session->getPrivateKey();
|
||||
|
||||
// Encrypt private key with new user pwd as passphrase
|
||||
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent( $privateKey, $params['password'] );
|
||||
|
|
|
@ -45,24 +45,6 @@ class Crypt {
|
|||
* @return string 'client' or 'server'
|
||||
*/
|
||||
public static function mode( $user = null ) {
|
||||
|
||||
// $mode = \OC_Appconfig::getValue( 'files_encryption', 'mode', 'none' );
|
||||
//
|
||||
// if ( $mode == 'user') {
|
||||
// if ( !$user ) {
|
||||
// $user = \OCP\User::getUser();
|
||||
// }
|
||||
// $mode = 'none';
|
||||
// if ( $user ) {
|
||||
// $query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
|
||||
// $result = $query->execute(array($user));
|
||||
// if ($row = $result->fetchRow()){
|
||||
// $mode = $row['mode'];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return $mode;
|
||||
|
||||
return 'server';
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ class Keymanager {
|
|||
* as no encryption takes place here
|
||||
*/
|
||||
public static function setPrivateKey( $key ) {
|
||||
|
||||
trigger_error("MOSH");
|
||||
$user = \OCP\User::getUser();
|
||||
|
||||
$view = new \OC_FilesystemView( '/' . $user . '/files_encryption' );
|
||||
|
|
Loading…
Reference in New Issue