diff --git a/server/conf.php b/server/conf.php index dbc8844..7810292 100644 --- a/server/conf.php +++ b/server/conf.php @@ -79,4 +79,8 @@ $MAX_PASSWORDS_PER_REQUEST=10; */ $REQUESTS_MIN_DELAY=1000; +/* + Clear master keys and reset passwords after 15 minutes of inactivity + */ +$CLEAR_TIME=15*60*1000; ?> \ No newline at end of file diff --git a/server/index.php b/server/index.php index 321abab..fbd82e3 100644 --- a/server/index.php +++ b/server/index.php @@ -79,6 +79,7 @@ else diff --git a/server/resources/gpass.js b/server/resources/gpass.js index 8ec3e86..39e23ae 100755 --- a/server/resources/gpass.js +++ b/server/resources/gpass.js @@ -129,6 +129,7 @@ function derive_mkey(user, mkey) var passwords; var current_user = ""; var current_mkey = ""; +var clearTimer = null; function PasswordEntry (ciphered_login, ciphered_password, salt, shadow_login) { this.ciphered_login = ciphered_login; @@ -142,6 +143,16 @@ function PasswordEntry (ciphered_login, ciphered_password, salt, shadow_login) { this.shadow_login = shadow_login; this.access_token = ""; + this.reset = function() + { + this.unciphered = false; + this.clear_url = ""; + this.clear_login = ""; + this.clear_password = ""; + this.masterkey = ""; + this.salt = salt; + } + this.encrypt = function(masterkey) { if (masterkey == this.masterkey) @@ -231,6 +242,37 @@ function PasswordEntry (ciphered_login, ciphered_password, salt, shadow_login) { } } +function clearMasterKey() +{ + current_mkey = ""; + + for(i=0; i