sending challenge on paste creation, adding logic to store and check it on view requests
This commit is contained in:
@@ -26,6 +26,9 @@
|
||||
},
|
||||
"time_to_live": {
|
||||
"@type": "pb:RemainingSeconds"
|
||||
},
|
||||
"challenge": {
|
||||
"@type": "pb:Challenge"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4229,7 +4229,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
||||
|
||||
// prepare server interaction
|
||||
ServerInteraction.prepare();
|
||||
ServerInteraction.setCryptParameters(TopNav.getPassword());
|
||||
const key = CryptTool.getSymmetricKey(),
|
||||
password = TopNav.getPassword();
|
||||
ServerInteraction.setCryptParameters(password, key);
|
||||
|
||||
// set success/fail functions
|
||||
ServerInteraction.setSuccess(showCreatedPaste);
|
||||
@@ -4250,7 +4252,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
||||
TopNav.getOpenDiscussion() ? 1 : 0,
|
||||
TopNav.getBurnAfterReading() ? 1 : 0
|
||||
]);
|
||||
ServerInteraction.setUnencryptedData('meta', {'expire': TopNav.getExpiration()});
|
||||
ServerInteraction.setUnencryptedData('meta', {
|
||||
'expire': TopNav.getExpiration(),
|
||||
'challenge': CryptTool.getCredentials(key, password)
|
||||
});
|
||||
|
||||
// prepare PasteViewer for later preview
|
||||
PasteViewer.setText(plainText);
|
||||
|
||||
@@ -92,6 +92,9 @@
|
||||
"@type": "dp:Second",
|
||||
"@minimum": 1
|
||||
},
|
||||
"Challenge": {
|
||||
"@type": "pb:Base64"
|
||||
},
|
||||
"CipherParameters": {
|
||||
"@container": "@list",
|
||||
"@value": [
|
||||
|
||||
Reference in New Issue
Block a user