This commit is contained in:
brantje 2016-10-09 20:25:01 +02:00
Родитель d6e4f32ec8 9fbcf6aefc
Коммит 02d783f39b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5FF1D117F918687F
11 изменённых файлов: 56 добавлений и 57 удалений

Просмотреть файл

@ -1,5 +1,18 @@
filter:
excluded_paths:
- 'js/vendor*'
- 'l10n/*'
- 'tests/*'
imports:
- javascript
- php
tools:
external_code_coverage: true
external_code_coverage:
timeout: 7200 # Timeout in seconds: 2 hours
php_mess_detector: true
php_code_sniffer: true
sensiolabs_security_checker: true

Просмотреть файл

@ -6,35 +6,33 @@ env:
global:
- CORE_BRANCH=master
- APP_NAME=passman
- SERVER_FOLDER=server
- CLOUD=nextcloud
matrix:
- DB=mysql
- DB=sqlite
- DB=pgsql
branches:
only:
- master
#matrix:
# allow_failures:
# - env: DB=pgsql CORE_BRANCH=master
# include:
# - php: 5.6
# env: DB=sqlite
# - php: 5.6
# env: DB=mysql
# - php: 5.6
# env: DB=pgsql CORE_BRANCH=master
# fast_finish: true
#
before_install:
# enable a display for running JavaScript tests
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# <- if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
# - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- sh -c "if [ '$CLOUD' = 'nextcloud' ]; then wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh; fi;"
- sh -c "if [ '$CLOUD' = 'owncloud' ]; then wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh; fi;"
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
# Add some output debugging information
- cd ../server
- cd ../${SERVER_FOLDER}
- ./occ check
- ./occ status
- ./occ app:list
- ./occ app:enable $APP_NAME
- nvm install 5.9
- npm install -g npm@latest
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install grunt-cli -g; fi"
@ -46,7 +44,7 @@ before_script:
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
- ./occ app:enable passman
- php -S localhost:8080 &
- cd apps/$APP_NAME/
- mkdir -p build
@ -80,10 +78,12 @@ addons:
matrix:
include:
- php: 5.6
env: DB=mysql
- php: 5.6
env: DB=pgsql
- php: 5.6
env: DB=sqlite;CLOUD=owncloud;SERVER_FOLDER=core
- php: 5.6
env: DB=mysql;CLOUD=owncloud;SERVER_FOLDER=core
- php: 5.6
env: DB=mysql;CODECHECK=1
- php: 5.6
@ -94,5 +94,9 @@ matrix:
env: DB=mysql;CODECHECK=2
- php: 7.0
env: DB=mysql;CODECHECK=2
- php: 7.0
env: DB=sqlite;CLOUD=owncloud;SERVER_FOLDER=core
- php: 7.0
env: DB=mysql;CLOUD=owncloud;SERVER_FOLDER=core
allow_failures:
- env: DB=mysql;CODECHECK=2
- env: DB=mysql;CODECHECK=2

Просмотреть файл

@ -17,6 +17,11 @@ Features:
- Password analyzer
- Share passwords
## Tested on
- NextCloud 10+
- ownCloud 9.1+
##Screenshots
![Logged in to vault](http://i.imgur.com/ciShQZg.png)

Просмотреть файл

@ -305,8 +305,8 @@
$scope.$digest();
};
$scope.fileLoadError = function (error, file) {
console.log(error, file);
$scope.fileLoadError = function (error) {
console.log('Error loading file', error);
};
$scope.selected_file = '';

Просмотреть файл

@ -64,7 +64,6 @@
}
ShareService.getCredendialsSharedWithUs(vault.guid).then(function (shared_credentials) {
console.log('Shared credentials', shared_credentials);
for (var c = 0; c < shared_credentials.length; c++) {
var _shared_credential = shared_credentials[c];
var decrypted_key = EncryptService.decryptString(_shared_credential.shared_key);
@ -132,7 +131,6 @@
};
$scope.acceptShareRequest = function (share_request) {
console.log('Accepted share request', share_request);
var crypted_shared_key = share_request.shared_key;
var private_key = EncryptService.decryptString(VaultService.getActiveVault().private_sharing_key);
@ -356,7 +354,6 @@
};
$rootScope.$on('logout', function () {
console.log('Logout received, clean up');
$scope.active_vault = null;
$scope.credentials = [];
// $scope.$parent.selectedVault = false;
@ -365,7 +362,6 @@
$scope.downloadFile = function (credential, file) {
console.log(credential, file);
var callback = function (result) {
var key = null;
if (!result.hasOwnProperty('file_data')) {

Просмотреть файл

@ -178,8 +178,8 @@
$scope.$digest();
};
$scope.fileLoadError = function (error, file) {
console.log(error, file);
$scope.fileLoadError = function (error) {
console.log('Error loading file', error);
};
$scope.selected_file = '';
@ -228,7 +228,7 @@
//@TODO validation
//@TODO When credential is expired and has renew interval set, calc new expire time.
delete $scope.storedCredential.password_repeat;
console.log($scope.storedCredential);
if (!$scope.storedCredential.credential_id) {
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
CredentialService.createCredential($scope.storedCredential).then(function (result) {

Просмотреть файл

@ -30,10 +30,9 @@
}
VaultService.getVault($scope.active_vault).then(function (vault) {
vault.vaultKey = SettingsService.getSetting('defaultVaultPass');
vault.vaultKey = VaultService.getActiveVault().vaultKey;
delete vault.credentials;
VaultService.setActiveVault(vault);
console.log(vault);
$scope.vault_settings = vault.vault_settings;
if(!$scope.vault_settings.hasOwnProperty('pwSettings')){
$scope.vault_settings.pwSettings = {
@ -125,10 +124,6 @@
}
});
if ($scope.active_vault) {
}
$rootScope.$on('logout', function () {
$scope.selectedVault = false;
});
@ -189,7 +184,7 @@
var changeCredential = function (index, oldVaultPass, newVaultPass) {
CredentialService.reencryptCredential(_selected_credentials[index].guid, oldVaultPass, newVaultPass).progress(function (data) {
$scope.cur_state = data;
}).then(function (data) {
}).then(function () {
var percent = index / _selected_credentials.length * 100;
$scope.change_pw = {
percent: percent,
@ -199,11 +194,9 @@
if (index < _selected_credentials.length - 1) {
changeCredential(index + 1, oldVaultPass, newVaultPass);
} else {
console.log('Update complete!');
vault.private_sharing_key = EncryptService.decryptString(angular.copy(vault.private_sharing_key), oldVaultPass);
vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass);
VaultService.updateSharingKeys(vault).then(function (result) {
VaultService.updateSharingKeys(vault).then(function () {
$rootScope.$broadcast('logout');
NotificationService.showNotification('Please login with your new vault password', 5000);
});

Просмотреть файл

@ -138,8 +138,7 @@
$scope.$watch('share_settings.upload_progress.done', function () {
console.log();
if ($scope.share_settings.upload_progress.done === $scope.share_settings.upload_progress.total && $scope.share_settings.upload_progress.total > 0) {
if ($scope.share_settings.upload_progress.done === $scope.share_settings.upload_progress.total && $scope.share_settings.upload_progress.total > 0) {
getAcl();
}
});
@ -204,9 +203,7 @@
_credential = CredentialService.encryptCredential(_credential, old_key);
CredentialService.updateCredential(_credential, true).then(function () {
NotificationService.showNotification('Credential unshared', 4000);
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).progress(function (data) {
console.log(data);
}).then(function (data) {
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function (data) {
getAcl();
});
});
@ -224,14 +221,13 @@
user.vaults = data;
var start = new Date().getTime() / 1000;
ShareService.cypherRSAStringWithPublicKeyBulkAsync(user.vaults, enc_key)
.progress(function (data) {
.progress(function () {
$scope.share_settings.cypher_progress.done++;
$scope.share_settings.cypher_progress.percent = $scope.share_settings.cypher_progress.done / $scope.share_settings.cypher_progress.total * 100;
$scope.$digest();
})
.then(function (result) {
console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]");
$scope.share_settings.cypher_progress.times.push({
$scope.share_settings.cypher_progress.times.push({
time: ((new Date().getTime() / 1000) - start),
user: data[0].user_id
});
@ -257,8 +253,7 @@
$scope.share_settings.upload_progress.total = 0;
//Credential is already shared
if ($scope.storedCredential.shared_key && $scope.storedCredential.shared_key !== '' && $scope.storedCredential.shared_key !== null) {
console.log('Shared key found');
var enc_key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
var enc_key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
if ($scope.share_settings.linkSharing.enabled) {
var expire_time = new Date(angular.copy($scope.share_settings.linkSharing.settings.expire_time)).getTime() / 1000;
var shareObj = {
@ -298,10 +293,7 @@
var old_key = VaultService.getActiveVault().vaultKey;
CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function (data) {
console.log(data);
}).then(function (data) {
console.log(data);
//This is here is not called
}).then(function (data) {
var _credential = data.cryptogram;
_credential.set_share_key = true;
_credential.skip_revision = true;

Просмотреть файл

@ -47,7 +47,6 @@
$scope.progress = progress > 0 ? 2 : 1;
$scope.$digest();
}).then(function (kp) {
console.log('stuff done');
$scope.generating = false;
var pem = ShareService.rsaKeyPairToPEM(kp);

Просмотреть файл

@ -116,13 +116,12 @@
try {
field_decrypted_value = EncryptService.decryptString(fieldValue, key);
} catch (e) {
console.log(e);
throw e;
}
try {
credential[field] = JSON.parse(field_decrypted_value);
} catch (e) {
console.log('Field' + field + ' in ' + credential.label + ' could not be parsed! Value:' + fieldValue);
console.warn('Field' + field + ' in ' + credential.label + ' could not be parsed! Value:' + fieldValue);
}

Просмотреть файл

@ -165,13 +165,12 @@
try {
field_decrypted_value = EncryptService.decryptString(fieldValue, sharedKey);
} catch (e) {
console.log(e);
throw e;
}
try {
_credential[field] = JSON.parse(field_decrypted_value);
} catch (e) {
console.log('Field' + field + ' in ' + _credential.label + ' could not be parsed! Value:' + fieldValue);
console.warn('Field' + field + ' in ' + _credential.label + ' could not be parsed! Value:' + fieldValue);
throw e;
}
}
@ -185,7 +184,6 @@
var step = function () {
// run for 100 ms
if (!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) {
// console.log(state);
if (state.p !== null) {
// progress(50);
this.call_progress(50);