mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-05-02 06:26:16 -04:00
handle regression due to base58 stripping NULL bytes, discovered via JSVerify RNG state 0dec6b2a5f04d19873
This commit is contained in:
parent
909ff2daa7
commit
353d08daf6
4 changed files with 11 additions and 21 deletions
|
@ -1140,7 +1140,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
|
||||
// version 2 uses base58, version 1 uses base64 without decoding
|
||||
try {
|
||||
symmetricKey = CryptTool.base58decode(newKey);
|
||||
// base58 encode strips NULL bytes at the beginning of the
|
||||
// string, so we re-add them if necessary
|
||||
symmetricKey = CryptTool.base58decode(newKey).padStart(32, '\u0000');
|
||||
} catch(e) {
|
||||
symmetricKey = newKey;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue