Skip to content

Commit ff1211a

Browse files
authored
Merge pull request #6470 from blockchain/fix/login-tfa
fix(login-tfa): Change crypto implementation used in 2FA.
2 parents 67d6e23 + 1ad7d33 commit ff1211a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/blockchain-wallet-v4/src/types/Wrapper.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ import * as Options from './Options'
88
import Type from './Type'
99
import * as Wallet from './Wallet'
1010

11-
let _window = {}
12-
if (typeof window === 'undefined' || !window) _window = {}
13-
else _window = window
14-
15-
// Global Crypto object
16-
const { Crypto } = _window
17-
1811
const PAYLOAD_VERSION = crypto.SUPPORTED_ENCRYPTION_VERSION
1912

2013
/* Wrapper :: {
@@ -149,7 +142,7 @@ export const fromEncPayload = curry((password, payload) => {
149142
const wrapper = {
150143
password,
151144
payload: JSON.stringify(payload),
152-
payload_checksum: Crypto ? Crypto.SHA256(JSON.stringify(payload), { asHex: true }) : undefined,
145+
payload_checksum: crypto.sha256(JSON.stringify(payload)).toString('hex'),
153146
pbkdf2Iterations,
154147
version
155148
}

0 commit comments

Comments
 (0)