Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
673ad74b
Commit
673ad74b
authored
May 29, 2018
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipython-kernel: use cryptonite instead of SHA
parent
65ee1299
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
ipython-kernel.cabal
ipython-kernel/ipython-kernel.cabal
+3
-2
ZeroMQ.hs
ipython-kernel/src/IHaskell/IPython/ZeroMQ.hs
+4
-2
No files found.
ipython-kernel/ipython-kernel.cabal
View file @
673ad74b
...
@@ -39,17 +39,18 @@ library
...
@@ -39,17 +39,18 @@ library
bytestring ,
bytestring ,
cereal ,
cereal ,
containers ,
containers ,
cryptonite ,
directory ,
directory ,
temporary ,
temporary ,
filepath ,
filepath ,
process ,
process ,
memory ,
mtl ,
mtl ,
text ,
text ,
transformers ,
transformers ,
unordered-containers,
unordered-containers,
uuid ,
uuid ,
zeromq4-haskell ,
zeromq4-haskell
SHA
-- Example program
-- Example program
executable simple-calc-example
executable simple-calc-example
...
...
ipython-kernel/src/IHaskell/IPython/ZeroMQ.hs
View file @
673ad74b
...
@@ -17,12 +17,14 @@ module IHaskell.IPython.ZeroMQ (
...
@@ -17,12 +17,14 @@ module IHaskell.IPython.ZeroMQ (
import
Control.Concurrent
import
Control.Concurrent
import
Control.Exception
import
Control.Exception
import
Control.Monad
import
Control.Monad
import
qualified
Crypto.Hash
as
Hash
import
Crypto.Hash.Algorithms
(
SHA256
)
import
qualified
Crypto.MAC.HMAC
as
HMAC
import
Data.Aeson
import
Data.Aeson
import
Data.ByteString
(
ByteString
)
import
Data.ByteString
(
ByteString
)
import
qualified
Data.ByteString.Char8
as
Char
import
qualified
Data.ByteString.Char8
as
Char
import
qualified
Data.ByteString.Lazy
as
LBS
import
qualified
Data.ByteString.Lazy
as
LBS
import
Data.Char
import
Data.Char
import
Data.Digest.Pure.SHA
as
SHA
import
Data.Monoid
((
<>
))
import
Data.Monoid
((
<>
))
import
qualified
Data.Text.Encoding
as
Text
import
qualified
Data.Text.Encoding
as
Text
import
System.ZMQ4
as
ZMQ4
hiding
(
stdin
)
import
System.ZMQ4
as
ZMQ4
hiding
(
stdin
)
...
@@ -336,7 +338,7 @@ sendMessage debug hmacKey socket message = do
...
@@ -336,7 +338,7 @@ sendMessage debug hmacKey socket message = do
-- Compute the HMAC SHA-256 signature of a bytestring message.
-- Compute the HMAC SHA-256 signature of a bytestring message.
hmac
::
ByteString
->
ByteString
hmac
::
ByteString
->
ByteString
hmac
=
Char
.
pack
.
SHA
.
showDigest
.
SHA
.
hmacSha256
(
LBS
.
fromStrict
hmacKey
)
.
LBS
.
fromStrict
hmac
=
Char
.
pack
.
show
.
(
HMAC
.
hmacGetDigest
::
HMAC
.
HMAC
SHA256
->
Hash
.
Digest
SHA256
)
.
HMAC
.
hmac
hmacKey
-- Pieces of the message.
-- Pieces of the message.
head
=
header
message
head
=
header
message
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment