Skip to content

Commit

Permalink
fix: missing optional argument for input 'triplesecDecrypt'
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jun 23, 2020
1 parent 6ebb264 commit bdef802
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To securely use the latest distribution of blockstack.js from a CDN, use the fol

<!-- cdn -->
```html
<script src="https://unpkg.com/blockstack@21.1.0/dist/blockstack.js" integrity="sha384-ih7ey+1zWWfjxI5kbiPbhvBVeAnAkY09UCPqAgMU5UGk5qIAvY5oFViMwHQSbrgR" crossorigin="anonymous"></script>
<script src="https://unpkg.com/blockstack@21.2.0/dist/blockstack.js" integrity="sha384-pLudaGmeqD4oSzT7O98RLpFBVjoGcByz0BLTmYug5vQ49r6iqot6f/yXxpzXr+sC" crossorigin="anonymous"></script>
```
<!-- cdnstop -->

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockstack",
"version": "21.1.0",
"version": "21.2.0",
"description": "The Blockstack Javascript library for authentication, identity, and storage.",
"main": "lib/index",
"unpkg": "dist/blockstack.js",
Expand Down
24 changes: 12 additions & 12 deletions src/encryption/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function decryptMnemonicBuffer(dataBuffer: Buffer, password: string): Prom
const iv = keysAndIV.slice(32, 48)

const decipher = await createCipher()
const decryptedResult = await decipher.decrypt('aes-128-cbc', encKey, iv, cipherText)
const decryptedResult = await decipher.decrypt('aes-128-cbc', encKey, iv, cipherText);

const hmacSha256 = await createHmacSha256()
const hmacDigest = await hmacSha256.digest(macKey, hmacPayload)
Expand Down Expand Up @@ -147,19 +147,19 @@ function decryptLegacy(dataBuffer: Buffer,
* @private
* @ignore
*/
export async function decryptMnemonic(data: (string | Buffer),
password: string,
triplesecDecrypt: TriplesecDecryptSignature
): Promise<string> {
const dataBuffer = Buffer.isBuffer(data) ? data : Buffer.from(data, 'hex')
export async function decryptMnemonic(
data: string | Buffer,
password: string,
triplesecDecrypt?: TriplesecDecryptSignature
) {
const dataBuffer = Buffer.isBuffer(data) ? data : Buffer.from(data, 'hex');
try {
return await decryptMnemonicBuffer(dataBuffer, password)
return await decryptMnemonicBuffer(dataBuffer, password);
} catch (err) {
// If it was a password error, don't even bother with legacy
if (err instanceof PasswordError) {
throw err
if (err instanceof PasswordError) {
throw err;
}
const data = await decryptLegacy(dataBuffer, password, triplesecDecrypt)
return data.toString()
const data = await decryptLegacy(dataBuffer, password, triplesecDecrypt);
return data.toString();
}
}

0 comments on commit bdef802

Please sign in to comment.