ensure burn after reading and status messages are only changed after a successfull decryption

This commit is contained in:
El RIDO 2017-03-13 19:30:44 +01:00
parent 9deaed9406
commit ee43557a4f
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 14 additions and 15 deletions

View File

@ -3764,15 +3764,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
} else { } else {
decryptPaste(paste, key, password); decryptPaste(paste, key, password);
} }
} catch(err) {
Alert.hideLoading();
// log and show error
console.error(err);
Alert.showError('Could not decrypt data (Wrong key?)');
// still go on to potentially show potentially partially decrypted data
}
// shows the remaining time (until) deletion // shows the remaining time (until) deletion
PasteStatus.showRemainingTime(paste.meta); PasteStatus.showRemainingTime(paste.meta);
@ -3784,6 +3776,13 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
Alert.hideLoading(); Alert.hideLoading();
TopNav.showViewButtons(); TopNav.showViewButtons();
} catch(err) {
Alert.hideLoading();
// log and show error
console.error(err);
Alert.showError('Could not decrypt data (Wrong key?)');
}
} }
/** /**

View File

@ -69,7 +69,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYpK88nUEIgIruOud+YW0LKt+V+PVZZ1OEuO6SF49Yo6Dl0q/DCjJlHQ+RhSgkuexdSnpE9+ira9GJ1wih+e5A==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-hGJxoiUhU8ByJ5Q8QsnfUzrb202C8og2STIg8P/y+ZgEo7zUOZSSRvH9JT6p9TnEmgulqaLOZ16sQBBpLaTdpQ==" crossorigin="anonymous"></script>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]--> <![endif]-->

View File

@ -47,7 +47,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYpK88nUEIgIruOud+YW0LKt+V+PVZZ1OEuO6SF49Yo6Dl0q/DCjJlHQ+RhSgkuexdSnpE9+ira9GJ1wih+e5A==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-hGJxoiUhU8ByJ5Q8QsnfUzrb202C8og2STIg8P/y+ZgEo7zUOZSSRvH9JT6p9TnEmgulqaLOZ16sQBBpLaTdpQ==" crossorigin="anonymous"></script>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]--> <![endif]-->