Skip to content

Commit cde1767

Browse files
committed
Don't hash in preparePassphrase to make integration test pass!
1 parent affd2ed commit cde1767

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

lib/core-integration/src/Test/Integration/Scenario/API/Byron/Transactions.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import Data.Text.Class
6262
import Numeric.Natural
6363
( Natural )
6464
import Test.Hspec
65-
( ActionWith, SpecWith, describe, pendingWith )
65+
( ActionWith, SpecWith, describe )
6666
import Test.Hspec.Expectations.Lifted
6767
( shouldBe, shouldNotBe )
6868
import Test.Hspec.Extra
@@ -123,7 +123,6 @@ import qualified Cardano.Wallet.Primitive.Types.TokenPolicy as TokenPolicy
123123
import qualified Data.ByteString as BS
124124
import qualified Data.ByteString.Char8 as B8
125125
import qualified Data.Text as T
126-
import qualified Data.Text.Encoding as T
127126
import qualified Network.HTTP.Types.Status as HTTP
128127

129128
data TestCase a = TestCase

lib/core/src/Cardano/Wallet/Primitive/AddressDerivation.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ import Control.Monad
104104
import Crypto.Hash
105105
( Digest, HashAlgorithm )
106106
import Crypto.Hash.Utils
107-
( blake2b224, blake2b256 )
107+
( blake2b224 )
108108
import Crypto.KDF.PBKDF2
109109
( Parameters (..), fastPBKDF2_SHA512 )
110110
import Crypto.Random.Types
@@ -585,17 +585,17 @@ encryptPassphrase (Passphrase bytes) = do
585585
<> BA.convert @ByteString (fastPBKDF2_SHA512 params bytes salt)
586586

587587
-- | Manipulation done on legacy passphrases before getting encrypted.
588+
--
589+
-- NOTE March 2022:
590+
-- It seems like the idea that some manipulation should be done was incorrect.
591+
-- We could remove this fucntion then.
588592
preparePassphrase
589593
:: PassphraseScheme
590594
-> Passphrase "raw"
591595
-> Passphrase "encryption"
592596
preparePassphrase = \case
593597
EncryptWithPBKDF2 -> coerce
594-
EncryptWithScrypt -> Passphrase . hashMaybe
595-
where
596-
hashMaybe pw@(Passphrase bytes)
597-
| pw == mempty = BA.convert bytes
598-
| otherwise = BA.convert $ blake2b256 bytes
598+
EncryptWithScrypt -> coerce
599599

600600
-- | Check whether a 'Passphrase' matches with a stored 'Hash'
601601
checkPassphrase

0 commit comments

Comments
 (0)