Skip to content
Snippets Groups Projects
Commit 57a7dde6 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Stay away from String where I can

parent 4fca14fb
Branches
No related tags found
1 merge request!22Ristretto-flavored PrivacyPass
......@@ -52,6 +52,7 @@ executable PaymentServer-generate-key
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wmissing-import-lists -Wunused-imports
build-depends: base
, text
, PaymentServer
default-language: Haskell2010
......
......@@ -2,6 +2,14 @@ module Main
( main
) where
import Prelude hiding
( putStrLn
)
import Data.Text.IO
( putStrLn
)
import PaymentServer.Ristretto
( randomSigningKey
)
......
......@@ -73,11 +73,11 @@ ristretto textSigningKey textTokens = do
-- | randomSigningKey generates a new signing key at random and returns it
-- encoded as a base64 string.
randomSigningKey :: IO String
randomSigningKey :: IO Text
randomSigningKey = do
cSigningKey <- signing_key_random
cString <- signing_key_encode_base64 cSigningKey
signing_key_destroy cSigningKey
result <- peekCString cString
free cString
return result
return $ pack result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment