gsasl 0.3.7 → 0.4.0
raw patch · 2 files changed
+2/−62 lines, 2 files
Files
- gsasl.cabal +2/−2
- lib/Network/Protocol/SASL/GNU.hs +0/−60
gsasl.cabal view
@@ -1,5 +1,5 @@ name: gsasl-version: 0.3.7+version: 0.4.0 license: GPL-3 license-file: COPYING author: John Millikin <john@john-millikin.com>@@ -21,7 +21,7 @@ source-repository this type: git location: https://git.sr.ht/~singpolyma/gsasl-haskell- tag: haskell-gsasl_0.3.6+ tag: 0.4.0 library default-language: Haskell2010
lib/Network/Protocol/SASL/GNU.hs view
@@ -63,10 +63,6 @@ -- * Bundled codecs , toBase64 , fromBase64- , md5- , sha1- , hmacMD5- , hmacSHA1 , nonce , random ) where@@ -780,50 +776,6 @@ fromBase64 :: B.ByteString -> B.ByteString fromBase64 = base64Helper gsasl_base64_from -md5 :: B.ByteString -> B.ByteString-md5 input = unsafePerformIO $- B.unsafeUseAsCStringLen input $ \(pIn, inLen) ->- F.alloca $ \pOut ->- F.allocaBytes 16 $ \outBuf -> do- F.poke pOut outBuf- gsasl_md5 pIn (fromIntegral inLen) pOut >>= checkRC- B.packCStringLen (outBuf, 16)--sha1 :: B.ByteString -> B.ByteString-sha1 input = unsafePerformIO $- B.unsafeUseAsCStringLen input $ \(pIn, inLen) ->- F.alloca $ \pOut -> do- gsasl_sha1 pIn (fromIntegral inLen) pOut >>= checkRC- outBuf <- F.peek pOut- ret <- B.packCStringLen (outBuf, 20)- F.free outBuf- return ret---hmacMD5 :: B.ByteString -- ^ Key- -> B.ByteString -- ^ Input data- -> B.ByteString-hmacMD5 key input = unsafePerformIO $- B.unsafeUseAsCStringLen key $ \(pKey, keyLen) ->- B.unsafeUseAsCStringLen input $ \(pIn, inLen) ->- F.alloca $ \pOut ->- F.allocaBytes 16 $ \outBuf -> do- F.poke pOut outBuf- gsasl_hmac_md5 pKey (fromIntegral keyLen) pIn (fromIntegral inLen) pOut >>= checkRC- B.packCStringLen (outBuf, 16)--hmacSHA1 :: B.ByteString -- ^ Key- -> B.ByteString -- ^ Input data- -> B.ByteString-hmacSHA1 key input = unsafePerformIO $- B.unsafeUseAsCStringLen key $ \(pKey, keyLen) ->- B.unsafeUseAsCStringLen input $ \(pIn, inLen) ->- F.alloca $ \pOut ->- F.allocaBytes 20 $ \outBuf -> do- F.poke pOut outBuf- gsasl_hmac_sha1 pKey (fromIntegral keyLen) pIn (fromIntegral inLen) pOut >>= checkRC- B.packCStringLen (outBuf, 20)- -- | Returns unpredictable data of a given size nonce :: Integer -> IO B.ByteString nonce size = F.allocaBytes (fromInteger size) $ \buf -> do@@ -942,18 +894,6 @@ foreign import ccall "gsasl.h gsasl_base64_from" gsasl_base64_from :: F.CString -> F.CSize -> F.Ptr F.CString -> F.Ptr F.CSize -> IO F.CInt--foreign import ccall "gsasl.h gsasl_md5"- gsasl_md5 :: F.CString -> F.CSize -> F.Ptr F.CString -> IO F.CInt--foreign import ccall "gsasl.h gsasl_sha1"- gsasl_sha1 :: F.CString -> F.CSize -> F.Ptr F.CString -> IO F.CInt--foreign import ccall "gsasl.h gsasl_hmac_md5"- gsasl_hmac_md5 :: F.CString -> F.CSize -> F.CString -> F.CSize -> F.Ptr F.CString -> IO F.CInt--foreign import ccall "gsasl.h gsasl_hmac_sha1"- gsasl_hmac_sha1 :: F.CString -> F.CSize -> F.CString -> F.CSize -> F.Ptr F.CString -> IO F.CInt foreign import ccall "gsasl.h gsasl_nonce" gsasl_nonce :: F.CString -> F.CSize -> IO F.CInt